PLC sensor status logic

CAI_Support said:
Thanks, Tom.
in this question there is something about " CZ TSn BADSENSOR" may need little clarification. When board just started, the CZ checking may got value not truly reflect sensor status, since it will take up to 2 seconds to get sensor status updated.  Your project showed how to avoid those problem by goto another label in the code.
Now, I think he wants to explain how your code handle only sending one email at a time.
Thanks for explaining- I think my problem is another one. The structure of the main program: I learned that I may have a LOOP, so far only START to END. Does the program continue into Subprogramms if they are placed before the END statement?
 
How program flow is totally controlled by PLC code. You can call one sub, then calling another sub inside first sub, the limitation is up to 8 layers call sub allowed.
You can use goto command to decide where to go next execution.
If you do not have any flow control logic, WebControl PLC will keep looping from start to end and start all over again.
If you never put callsub command in PLC code, it will not goto any subroutine.  Subroutine should be placed below END line, so that it is clear to programmer actually that is not part of main program.
 
Back
Top