Lcal (Label Call); Lret (Label Return) - IDEC MICROSmart FC6A Series Ladder Programming Manual

Automation organizer windldr
Hide thumbs Also See for MICROSmart FC6A Series:
Table of Contents

Advertisement

LCAL (Label Call)

LCAL
*****
Valid Devices
Device
S1 (Source 1)
For valid device address ranges, see "Device Addresses" on page 2-1.
Since the LCAL instruction is executed in each scan while input is on, a pulse input from a SOTU or SOTD instruction should be used.
Note: Make sure that a LABEL instruction of the label number used for a LCAL instruction is programmed. When designating S1 using other than a
constant, the value for the label is a variable. When using a variable for a label, make sure that all probable LABEL numbers are included in the user
program. If a matching label does not exist, a user program execution error will result, turning on special internal relay M8004 and the ERR LED on
the FC6A Series MICROSmart.

LRET (Label Return)

This instruction returns to the address of the LCAL (label call) instruction.
LRET
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 user program execution error will result, turning on special internal relay M8004 and the ERR LED on
the FC6A Series MICROSmart.
Valid Devices
Device
When input is on, the address with label 0 through 255 assigned by S1 is called. When input is off, no call
S1
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
user program execution error will result, turning on special internal relay M8004 and the ERR LED on the
FC6A Series MICROSmart.
Function
Label number to call
Function
FC6A S
MICROS
ERIES
MART
13: P
I
Q
M
R
I
Q
M
L
P
M
ADDER
ROGRAMMING
ANUAL
B
ROGRAM
RANCHING
T
C
D
P
Constant
X
0-255
R
T
C
D
P
Constant
FC9Y-B1726
I
NSTRUCTIONS
Repeat
Repeat
13-3

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents