![IDEC OpenNet series Скачать руководство пользователя страница 265](http://html.mh-extra.com/html/idec/opennet-series/opennet-series_user-manual_617384265.webp)
18: P
ROGRAM
B
RANCHING
I
NSTRUCTIONS
18-4
O
PEN
N
ET
C
ONTROLLER
U
SER
’
S
M
ANUAL
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.
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 rung 1, input I1.
M8122 is the 100-msec clock special internal relay.
When jump occurs to label 1, output Q1 oscillates in 100-msec increments.
Program execution returns to rung 1, input I2.
M8123 is the 10-msec clock special internal relay.
When jump occurs to label 2, output Q2 oscillates in 10-msec increments.
Program execution returns to rung 1, END.
LABEL
0
Rung 1
I0
LCAL
S1
0
END
I1
LCAL
S1
1
I2
LCAL
S1
2
Rung 2
M8121
LRET
LABEL
1
Rung 3
M8122
LRET
LABEL
2
Rung 4
M8123
LRET
Q0
Q1
Q2
Phone: 800.894.0412 - Fax: 888.723.4773 - Web: www.clrwtr.com - Email: [email protected]