<4. Control Application Creation>
2. Modify the control logic
Modify the logic within the user function.
The figure below shows the logic after modification using jump and return
functions described in Section 9.1.7, “Jump, Connector and Return Functions” of
Chapter 9, “Advanced Engineering.”
Firstly, if the mode, status or alarm condition becomes true, variable “V001”
becomes true.
Next, the preset duration TM is compared against 0 second using EQ.
If the preset duration is 0 second, logic execution jumps to label “TM_SET_0s”,
skipping TON_1. As a result, terminal “OUT” becomes true when the condition is
true without executing the duration logic.
On the other hand, if TM is set to a non-zero value, the jump is ignored and
TON_1 is executed.
Moreover, as a RETURN function is coded below TON_1, subsequent logic is
not executed if a duration is specified using TM.
After modifying the control logic, compile the project.