« FC4A M
ICRO
S
MART
U
SER
’
S
M
ANUAL
»
18-1
18: P
ROGRAM
B
RANCHING
I
NSTRUCTIONS
Introduction
The program branching instructions reduce execution time by making it possible to bypass portions of the program when-
ever certain conditions are not satisfied.
The basic program branching instructions are LABEL and LJMP, which are used to tag an address and jump to the address
which has been tagged. Programming tools include “either/or” options between numerous portions of a program and the
ability to call one of several subroutines which return execution to where the normal program left off.
The DI or EI instruction disables or enables interrupt inputs and timer interrupt individually.
LABEL (Label)
Applicable CPU Modules
Valid Operands
LJMP (Label Jump)
Applicable CPU Modules
Valid Operands
For the valid operand number range, see pages 6-1 and 6-2.
Since the LJMP 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 LJMP 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.
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
Label number
Tag for LJMP and LCAL
—
—
—
—
—
—
—
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
S1 (Source 1)
Label number to jump to
—
—
—
—
—
—
X
0-127
—
This is the label number, from 0 to 127, used at the program address where the execution of pro-
gram instructions begins for a program branch.
An END instruction may be used to separate a tagged por tion of the program from the main pro-
gram. In this way, scan time is minimized by
not
executing the program branch unless input condi-
tions are satisfied.
Note:
The same label number cannot be used more than once.
LABEL
***
When input is on, jump to the address with label 0 through 127 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 por tions of a program.
Program execution does
not
return to the instruction following the LJMP instruction, after
the program branch.
LJMP
S1
*****
Summary of Contents for FC4A-C10R2
Page 1: ...FC4A SERIES Micro Programmable Logic Controller User s Manual FC9Y B812 ...
Page 6: ...PREFACE 4 FC4A MICROSMART USER S MANUAL ...
Page 94: ...2 MODULE SPECIFICATIONS 2 74 FC4A MICROSMART USER S MANUAL ...
Page 184: ...6 ALLOCATION NUMBERS 6 20 FC4A MICROSMART USER S MANUAL ...
Page 218: ...8 ADVANCED INSTRUCTIONS 8 8 FC4A MICROSMART USER S MANUAL ...
Page 240: ...11 BINARY ARITHMETIC INSTRUCTIONS 11 8 FC4A MICROSMART USER S MANUAL ...
Page 244: ...12 BOOLEAN COMPUTATION INSTRUCTIONS 12 4 FC4A MICROSMART USER S MANUAL ...
Page 252: ...13 SHIFT ROTATE INSTRUCTIONS 13 8 FC4A MICROSMART USER S MANUAL ...
Page 274: ...15 WEEK PROGRAMMER INSTRUCTIONS 15 8 FC4A MICROSMART USER S MANUAL ...
Page 378: ...22 DUAL TEACHING TIMER INSTRUCTIONS 22 4 FC4A MICROSMART USER S MANUAL ...
Page 386: ...23 INTELLIGENT MODULE ACCESS INSTRUCTIONS 23 8 FC4A MICROSMART USER S MANUAL ...
Page 408: ...24 ANALOG I O CONTROL 24 22 FC4A MICROSMART USER S MANUAL ...
Page 426: ...26 COMPUTER LINK COMMUNICATION 26 6 FC4A MICROSMART USER S MANUAL ...