![IDEC MICROSmart FC5A Series User Manual Download Page 128](http://html.mh-extra.com/html/idec/microsmart-fc5a-series/microsmart-fc5a-series_user-manual_617369128.webp)
11:
P
ROGRAM
B
RANCHING
I
NSTRUCTIONS
11
‐
4
FC5A
M
ICRO
S
MART
U
SER
’
S
M
ANUAL
FC9Y
‐
B1273
Correct
Structure
for
Calling
Subroutine
When
a
LCAL
instruction
is
executed,
the
remaining
program
instructions
on
the
same
rung
may
not
be
executed
upon
return,
if
input
conditions
are
changed
by
the
subroutine.
After
the
LRET
instruction
of
a
subroutine,
program
execution
begins
with
the
instruction
following
the
LCAL
instruction,
depending
on
current
input
condition.
When
instructions
following
a
LCAL
instruction
must
be
executed
after
the
subroutine
is
called,
make
sure
the
subroutine
does
not
change
input
conditions
unfavorably.
In
addition,
include
subsequent
instructions
in
a
new
ladder
line,
sepa
‐
rated
from
the
LCAL
instruction.
Example:
LCAL
and
LRET
The
following
example
demonstrates
a
program
to
call
three
different
portions
of
program
depending
on
the
input.
When
the
subroutine
is
complete,
program
execution
returns
to
the
instruction
following
the
LCAL
instruction.
I0
LCAL
S1
0
REP
S1
–
D0
D1
–
D1
MOV(W)
REP
S1
–
D20
D1
–
D21
MOV(W)
Correct
I0
LCAL
S1
0
REP
S1
–
D0
D1
–
D1
MOV(W)
REP
S1
–
D20
D1
–
D21
MOV(W)
Incorrect
Separate
the
ladder
line
for
each
LCAL
instruction.
I0
status
may
be
changed
by
the
subroutine
upon
return.
M0
S
M0
S
I0
When
input
I0
is
on,
program
execution
jumps
to
label
0.
When
input
I1
is
on,
program
execution
jumps
to
label
1.
When
input
I2
is
on,
program
execution
jumps
to
label
2.
M8121
is
the
1
‐
sec
clock
special
internal
relay.
When
jump
occurs
to
label
0,
output
Q0
oscillates
in
1
‐
sec
increments.
Program
execution
returns
to
the
address
of
input
I1.
M8122
is
the
100
‐
ms
clock
special
internal
relay.
When
jump
occurs
to
label
1,
output
Q1
oscillates
in
100
‐
ms
increments.
Program
execution
returns
to
the
address
of
input
I2.
M8123
is
the
10
‐
ms
clock
special
internal
relay.
When
jump
occurs
to
label
2,
output
Q2
oscillates
in
10
‐
ms
increments.
Program
execution
returns
to
the
address
of
END.
I0
LCAL
S1
0
END
I1
LCAL
S1
1
I2
LCAL
S1
2
M8121
LRET
M8122
LRET
M8123
LRET
Q0
Q1
Q2
LABEL
0
LABEL
1
LABEL
2
Summary of Contents for MICROSmart FC5A Series
Page 1: ...FC5A SERIES FC9Y B1273 1 User s Manual Advanced Volume ...
Page 2: ......
Page 8: ...Preface 6 FC5A MicroSmart User s Manual FC9Y B1273 ...
Page 14: ...TABLE OF CONTENTS vi FC5A MICROSMART USER S MANUAL FC9Y B1273 ...
Page 52: ...4 DATA COMPARISON INSTRUCTIONS 4 10 FC5A MICROSMART USER S MANUAL FC9Y B1273 ...
Page 72: ...5 Binary Arithmetic Instructions 5 20 FC5A MicroSmart User s Manual FC9Y B1273 ...
Page 88: ...7 SHIFT ROTATE INSTRUCTIONS 7 12 FC5A MicroSmart User s Manual FC9Y B1273 ...
Page 112: ...8 DATA CONVERSION INSTRUCTIONS 8 24 FC5A MicroSmart User s Manual FC9Y B1273 ...
Page 138: ...11 PROGRAM BRANCHING INSTRUCTIONS 11 14 FC5A MICROSMART USER S MANUAL FC9Y B1273 ...
Page 178: ...13 PULSE INSTRUCTIONS 13 32 FC5A MICROSMART USER S MANUAL FC9Y B1273 ...
Page 202: ...14 PID INSTRUCTION 14 24 FC5A MICROSMART USER S MANUAL FC9Y B1273 ...
Page 206: ...15 DUAL TEACHING TIMER INSTRUCTIONS 15 4 FC5A MICROSMART USER S MANUAL FC9Y B1273 ...
Page 214: ...16 INTELLIGENT MODULE ACCESS INSTRUCTIONS 16 8 FC5A MICROSMART USER S MANUAL FC9Y B1273 ...
Page 248: ...21 COMPUTER LINK COMMUNICATION 21 4 FC5A MICROSMART USER S MANUAL FC9Y B1273 ...
Page 272: ...23 MODBUS TCP COMMUNICATION 23 10 FC5A MICROSMART USER S MANUAL FC9Y B1273 ...
Page 332: ...25 EXPANSION RS232C RS485 COMMUNICATION 25 16 FC5A MICROSMART USER S MANUAL FC9Y B1273 ...
Page 341: ...NOTE FC5A MICROSMART USER S MANUAL FC9Y B1273 1 ...
Page 342: ...NOTE 2 FC5A MICROSMART USER S MANUAL FC9Y B1273 ...