Conditional Jump NOT
If the content of the accumulator is FALSE, the program execution is continued at the label defined in the operand field.
Any existing label in the program is valid. The value in the accumulator must be of data type BOOL.
var_1 and var_2 can be of any data type since comparison is defined for any data type. var_3, var_4 and var_5 must be of numeric data types according to the operations performed with them. LABEL1 and LABEL2 must be valid labels within the program. The jump is only executed if the accu holds the value FALSE. Otherwise, program execution continues with the statement following the JMPCN command.
A colon must follow the label itself, in the JMPCN statement, however, the colon after the label name has to be omitted.
Labels can only be inserted at the beginning of a network. A label can be inserted at the beginning of any network, even if it is not jumped to. (e.g. LABEL0 in this code sample fragment).
In the POU header, all input and output variables are declared that are used for programming this function.
(* Beginning of network 0 *) |
|||
LABEL0: |
LD |
var_1 |
(* Load var_1 in accu *) |
EQ |
var_2 |
(* Compare accu with var_2; store result of comparison in accu; result is of type BOOL*) |
|
JMPC |
LABEL1 |
(* If accu contains FALSE continue program execution at position LABEL1 *) |
|
(* Beginning of network 1 *) |
|||
LABEL1: |
MUL |
var_3 |
(* Multiply accu by var_3 *) |
SUB |
var_4 |
(* Subtract var_4 from accu; result is store in accu *) |
|
ST |
var_5 |
(* Store accu in var_5 *) |