Branching Instructions; Label (Label); Ljmp (Label Jump) - IDEC FC4A-C10R2 User Manual

Fc4a series microsmart micro programmable logic controller
Table of Contents

Advertisement

18: P
ROGRAM
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)

LABEL
***
Applicable CPU Modules
FC4A-C10R2/C
FC4A-C16R2/C
X
Valid Operands
Operand
Label number

LJMP (Label Jump)

LJMP
*****
Applicable CPU Modules
FC4A-C10R2/C
FC4A-C16R2/C
X
Valid Operands
Operand
S1 (Source 1)
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.
B
RANCHING
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 portion 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.
FC4A-C24R2/C
X
X
Function
Tag for LJMP and LCAL
When input is on, jump to the address with label 0 through 127 designated by S1.
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.
FC4A-C24R2/C
X
X
Function
Label number to jump to
« FC4A M
I
NSTRUCTIONS
FC4A-D20K3/S3
X
I
Q
— — — — — — —
FC4A-D20K3/S3
X
I
Q
— — — — — —
S
U
'
M
ICRO
MART
SER
S
ANUAL
FC4A-D20RK1/RS1 & FC4A-D40K3/S3
X
M
R
T
C
D
Constant
FC4A-D20RK1/RS1 & FC4A-D40K3/S3
X
M
R
T
C
D
Constant
X
»
Repeat
0-127
Repeat
0-127
18-1

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents