Execute a logic program only when a condition is true.
In AC450, we have a function block called "BLOCK" which is used to controll the execution of PC Programs.
i.e, The Blocks created on the lower level to this block will be executed only if the ON terminal of this block is true.
Attached snap fro ref:
Is there any equvalent block in AC800M Library.
Thanks in Advance.
The two systems are quite different in architecture, and there is no real equivalent FB, but there are other ways to do it. One is to let the code execute, but disable the En-pin on the blocks that write the outputs. Another possibility is to write control modules and abort execution.
There are surely other ways to do it, let´s see what the community has to say.
There are several ways to do this. Here are some suggestions ...
- Use an SFC. ( Note that if speed of execution is critical SFC's are relatively slow to transition between steps as it takes 3 program scan cycles to execute each P0,N and P1 action in turn, so take care)
- Use FBD and turn on the "Enable" input of the function blocks. (You have this option when you insert any Function Block, and you can do this in ST as well whenever you call an FB ). You can either "Enable" just the result of your calculation or you can write the whole function as a single user defined Function Block and just "Enable" it.
- Write everything in a big "If, Then, Else" statement ...
- Write all your conditional code in a single code block. At the Top if the Code block use an "If (logical_test) Then Return;" or or "Enable" a Return(); Function Block. This will terminate execution of the current code block.