18: P
ROGRAM
B
RANCHING
I
NSTRUCTIONS
« FC4A M
ICRO
S
MART
U
SER
’
S
M
ANUAL
»
18-3
LCAL (Label Call)
Applicable CPU Modules
Valid Operands
For the valid operand number range, see pages 6-1 and 6-2.
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 as required.
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 CPU module.
LRET (Label Return)
Applicable CPU Modules
Valid Operands
FC4A-C10R2/C
FC4A-C16R2/C
FC4A-C24R2/C
FC4A-D20K3/S3
FC4A-D20RK1/RS1 & FC4A-D40K3/S3
X
X
X
X
X
Operand
Function
I
Q
M
R
T
C
D
Constant
Repeat
S1 (Source 1)
Label number to call
—
—
—
—
—
—
X
0-127
—
FC4A-C10R2/C
FC4A-C16R2/C
FC4A-C24R2/C
FC4A-D20K3/S3
FC4A-D20RK1/RS1 & FC4A-D40K3/S3
X
X
X
X
X
Operand
Function
I
Q
M
R
T
C
D
Constant
Repeat
—
—
—
—
—
—
—
—
—
—
—
When input is on, the address with label 0 through 127 designated by S1 is called. When
input is off, no call takes place, and program execution proceeds with the next instruc-
tion.
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 subrou-
tines called by the LCAL instruction.
A maximum of four LCAL instructions can be nested. When more than four LCAL instruc-
tions are nested, a user program execution error will result, turning on special internal
relay M8004 and the ERR LED on the CPU module.
LCAL
S1
*****
This instruction is placed at the end of a subroutine called by the LCAL instruction. When the subrou-
tine 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 star ting 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 CPU module.
LRET
Содержание FC4A-C10R2
Страница 1: ...FC4A SERIES Micro Programmable Logic Controller User s Manual FC9Y B812 ...
Страница 6: ...PREFACE 4 FC4A MICROSMART USER S MANUAL ...
Страница 94: ...2 MODULE SPECIFICATIONS 2 74 FC4A MICROSMART USER S MANUAL ...
Страница 184: ...6 ALLOCATION NUMBERS 6 20 FC4A MICROSMART USER S MANUAL ...
Страница 218: ...8 ADVANCED INSTRUCTIONS 8 8 FC4A MICROSMART USER S MANUAL ...
Страница 240: ...11 BINARY ARITHMETIC INSTRUCTIONS 11 8 FC4A MICROSMART USER S MANUAL ...
Страница 244: ...12 BOOLEAN COMPUTATION INSTRUCTIONS 12 4 FC4A MICROSMART USER S MANUAL ...
Страница 252: ...13 SHIFT ROTATE INSTRUCTIONS 13 8 FC4A MICROSMART USER S MANUAL ...
Страница 274: ...15 WEEK PROGRAMMER INSTRUCTIONS 15 8 FC4A MICROSMART USER S MANUAL ...
Страница 378: ...22 DUAL TEACHING TIMER INSTRUCTIONS 22 4 FC4A MICROSMART USER S MANUAL ...
Страница 386: ...23 INTELLIGENT MODULE ACCESS INSTRUCTIONS 23 8 FC4A MICROSMART USER S MANUAL ...
Страница 408: ...24 ANALOG I O CONTROL 24 22 FC4A MICROSMART USER S MANUAL ...
Страница 426: ...26 COMPUTER LINK COMMUNICATION 26 6 FC4A MICROSMART USER S MANUAL ...