
TU RS485/ETH serie
CD Automation srl
27
Timers
Activation of an Internal Timer
Sets an Internal Timer and starts to count. During the count, the bit relative to the Timer selected
in the System Register “Timers Enable”, will be forced to 0. At the end of the count, the bit will be
forced to 1.
It is possible to check the status of the bit to determine the end of the time set.
Variables:
Timer
Number of the Internal Timer to enable
msec
Timer Pre-set (milliseconds)
Reg
If Timer = 0 is the value of time in msec.
Goto
Unconditioned jump to a Function Block.
Executes an unconditioned jump to a Function Block. The Function Block recalled must have a unique Label.
It is possible to select the Label of the Function Block which jump to, sorting out it between those available in
the list box “Func.Block”. The list is automatically updated each time that the user identifies a new Block; in the
case of the list is empty the value 0 appears.
Variables:
Func.Block
Pointer to the Function Block which jump to.
If (bit)
Conditioned jump to a Function Block.
Executes a conditioned jump to the Function Block indicated in the variable “Goto if true” if the status of the bit
selected is 1, while if the status of the bit is 0 jumps to the Function Block indicated in the variable “Goto if
false”. All of the Function Blocks called must have a unique Label. It is possible to select the Label of the
Function Block which jump to, sorting out it between those available in the list box “Goto if true” and “Goto if
false” . The lists are automatically updated each time that the user identifies a new Block; in the case of the list
is empty the value 0 appears.
Variables:
Source
Internal Register used as reference
Bit
Number of the bit to control (0÷15)
Goto if True
Pointer to the Function Block which jump to (if Bit=1)
Goto if False
Pointer to the Function Block which jump to (if Bit=0)
Call
Recall a Subroutine
Executes a jump to the first Function Block of a Subroutine; at the end of the Subroutine (command “Return”),
the Function Block successive to the block “Call” will be executed. The Function Block recalled must have a
unique Label. It is possible to select the Label of the Function Block which jump to, sorting out it between
those available in the list box “Func.Block”. The list is automatically updated each time that the user identifies
a new Block; in the case of the list is empty the value 0 appears.
NOTE: for each block “Call” must correspond a block “Return”, otherwise it is possible to occur in a “Stack
Overflow” error (refer to the section Troubleshooting).
Variables:
Func.Block
Pointer to the Function Block which jump to
Return
Return from a Subroutine
Indicates the end of a Subroutine. The Program will return to the Block following the Function Block “Call”.
NOTE: for each block “Return” must correspond a block “Call”, otherwise it is possible to occur in a “Stack
Overflow” error (refer to the section Troubleshooting).