S7 - Always ON (or OFF)

Steve Etter

Lifetime Supporting Member + Moderator
Join Date
Apr 2002
Location
Morristown, TN
Posts
965
I know this is a pretty basic, but I haven't been able to find it in the manual. Is there an "Always ON" or "Always OFF" bit available in the S7-300 CPU?

In the Mitsubishi Q-Series they are SM400 and SM401 (ON/OFF, respectively) and in the A-series they are M9036 and M9037, so I suspect such bits exist in the Siemens.

Thanks in advance,
Steve
 
There isn't one - I create my own using M flags. e.g. M0.0=always off, M0.1=always on. Use the following at the start of OB1

SET
S M0.1
R M0.0
 
I do similar, I don't use MB0 though, as this is the default for the clock byte and whenever I use it I keep MB0 for clock (too lazy to change it ;)).

Usually I then follow that up by using MB1 as memory and MB2 as one-shots of the clock bits, so I tend to use MB3 bits.
 
Its good to have known status bits for switching other things in logic at times.

In Siemens for example, you may have a sub-routine set up for multiple tasks and you could use an always on or off flag to preset a condition that isn't used for the current task.

Some people also use them when commissioning to override things that are incomplete or force a state, they then search for them at the end to ensure the code is as it should be.
 
PeterW said:
Some people also use them when commissioning to override things that are incomplete or force a state, they then search for them at the end to ensure the code is as it should be.
That is really the big one, in my opinion, but the other time when I find them most useful is when I have to make a modification where my code changes will need to be tested under running conditions.

In this instance, I like to create a "modification attempt" bit (M99.0 for example) that is held off using an "Always Off". Then, anywhere in the program where I will making changes, I insert opposing "active" M99.0 bits in the old logic and "inactive" ones in the new logic.

Once done, I can test the new code by simply replacing the "Always Off" bit with an "Always On". If all is well, I will typically leave it this way for a period of time so that should a problem arise all changes are easy to find and, if necessary, can be completely removed. If all is not well, I can very quickly revert back to the "original" code with minimal downtime.

This method has saved my a** on more than one occassion.

Steve
 
Steve Etter said:
That is really the big one, in my opinion, but the other time when I find them most useful is when I have to make a modification where my code changes will need to be tested under running conditions.

In this instance, I like to create a "modification attempt" bit (M99.0 for example) that is held off using an "Always Off". Then, anywhere in the program where I will making changes, I insert opposing "active" M99.0 bits in the old logic and "inactive" ones in the new logic.

Once done, I can test the new code by simply replacing the "Always Off" bit with an "Always On". If all is well, I will typically leave it this way for a period of time so that should a problem arise all changes are easy to find and, if necessary, can be completely removed. If all is not well, I can very quickly revert back to the "original" code with minimal downtime.

This method has saved my a** on more than one occassion.

Steve

Thanks for the info. I have always found it good practice to give yourself a quick way out in the event a program change does not produce the desired effect. I have seen this save a lot of peoples a****.
 
Electrically_Bound said:
I briefly worked at a place as a technician where they used some Omron PLCs and noticed the presence of Always On and Always Off bits. What exactly are those bits used for?

Another use would be where an instruction (e.g. ADD, COMPARE etc) needs an input before the instruction can execute, but you want the instruction to execute continually.
 

Similar Topics

So I've been told time and time again that a PID (or PIDE) instruction should never be conditionally enabled/disabled and the only thing that...
Replies
7
Views
709
Found this online :hmmm: Kind of funny :) We use "Always Off" for Dummy Code to Monitor tags in the ladder to avoid [AFI]'s from throwing...
Replies
17
Views
3,078
Hello Guys, This has been an issue that has been annoying me for a while. I am using windows 10 and when I connect to PLC's, cameras and other...
Replies
8
Views
3,297
Does anyone know how an always off set off contacts works in a GE PAC rx3i I was trying to not let a call block execute and thought putting an...
Replies
3
Views
1,627
hello I have 7cp476 cpu why can led always open and No connection
Replies
1
Views
157
Back
Top Bottom