SmartAXIS Touch User's Manual 12-25
2 Ladder Program
12
Control Function
LABEL
Label
This is the label number, from 0 to 127 (all-in-one type
CPU) or 0 to 255 (slim type CPU), used at the program
address where the execution of program instructions
begins for a program branch.
An END instruction may be used to separate a tagged
portion of the program from the main program. In this
way, scan time is minimized by
not
executing the
program branch unless input conditions are satisfied.
Note: The same label number cannot be used more
than once.
YES
LJMP
Label Jump
When input is on, jump to the address with label 0
through 127 (all-in-one type CPU) or 0 to 255 (slim type
CPU) designated by S1.
When input is off, no jump takes place, and program
execution proceeds with the next instruction.
The LJMP instruction is used as an “either/or” choice
between two portions of a program. Program execution
does
not
return to the instruction following the LJMP
instruction, after the program branch.
YES
LCAL
Label Call
When input is on, the address with label 0 through 127
(all-in-one type CPU) or 0 to 255 (slim type CPU)
designated by S1 is called. When input is off, no call
takes place, and program execution proceeds with the
next instruction.
The LCAL instruction calls a subroutine, and returns to
the main program after the branch is executed. A LRET
instruction (see below) must be placed at the end of a
program branch which is called, so that normal program
execution resumes by returning to the instruction
following the LCAL instruction.
Note: The END instruction must be used to separate the
main program from any subroutines called by the LCAL
instruction.
A maximum of four LCAL instructions can be nested.
When more than four LCAL instructions are nested, a
ladder program execution error will result, turning on
special internal relay M8004.
YES
LRET
Label Return
This instruction is placed at the end of a subroutine
called by the LCAL instruction. When the subroutine is
completed, normal program execution resumes by
returning to the instruction following the LCAL
instruction.
The LRET must be placed at the end of the subroutine
starting with a LABEL instruction. When the LRET is
programmed at other places, a ladder program execution
error will result, turning on special internal relay M8004.
YES
DJNZ
Decrement Jump Non-zero
When input is on, the value stored in the data register
designated by S1 is decremented by one and is checked.
If the resultant value is not 0, program execution jumps
to address with label 0 through 127 (all-in-one CPU) or
255 (slim CPU) designated by S2. If the decrement
results in 0, no jump takes place, and program execution
proceeds with the next instruction.
YES
Symbol Name and Diagram Function
Interrupt
Program
Execution