6 Application Instructions API 00-49
DVP-PLC Application Manual
6-15
API Mnemonic Operands
Function
08
FOR
Start of a FOR-NEXT Loop
Controllers
ES/EX/SS SA/SX/SC EH/SV
Bit Devices
Word Devices
Program Steps
Type
OP
X Y M S K H
KnX
KnY KnM KnS T C D E F
S
* *
*
*
*
*
*
*
*
*
*
FOR: 3 steps
PULSE 16-bit 32-bit
ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV
Operands:
S
: The number of repeated nested loops
Explanations:
1.
No contact to drive the instruction is required.
2.
See the specifications of each model for their range of use.
API Mnemonic
Function
09
NEXT
End of a FOR-NEXT Loop
Controllers
ES/EX/SS SA/SX/SC EH/SV
OP Descriptions
Program
Steps
N/A
NEXT: 1 steps
PULSE 16-bit 32-bit
ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV ES EX SS SA SX SC EH SV
Explanations:
1.
No operand. No contact to drive the instruction is required.
2.
FOR instruction indicates FOR ~ NEXT loops executing back and forth N times before escaping for the next
execution.
3.
N = K1 ~ K32,767. N is regarded as K1 when N
≤
1.
4.
When FOR~NEXT loops are not executed, the user can use the CJ instruction to escape the loops.
5.
Error will occur when
a) NEXT instruction is before FOR instruction.
b) FOR instruction exists but NEXT instruction does not exist.
c) There is NEXT instruction after FEND or END instruction.
d) The number of instructions between FOR ~ NEXT differs.
6.
FOR~NEXT loops can be nested for maximum five levels. Be careful that if there are too many loops, the
increased PLC scan time may cause timeout of watchdog timer and error. Users can use WDT instruction to
modify this problem.
Program Example 1:
After program A has been executed for 3 times, it will resume its execution after NEXT instruction. Program B will be
executed for 4 times whenever program A is executed once. Therefore, program B will be executed 3 × 4 = 12 times
in total.
Содержание DVP-PLC
Страница 1: ...PLC PLC...
Страница 28: ...1 Basic Principles of PLC Ladder Diagram DVP PLC Application Manual 1 24 MEMO...
Страница 192: ...4 Step Ladder Instructions DVP PLC Application Manual 4 22 MEMO...
Страница 250: ...6 Application Instructions API 00 49 DVP PLC Application Manual 6 38 X0 DIV D0 D10 D20 D0 D10 K4Y0 DIV...
Страница 270: ...6 Application Instructions API 00 49 DVP PLC Application Manual 6 58 RST M0 X0 RST T0 RST Y0 FMOV K0 D10 K5...
Страница 337: ...7 Application Instructions API 50 99 DVP PLC APPLICATION MANUAL 7 53 X10 STMR T10 K50 Y0 Y3 X10 Y1 Y2 5 sec 5 sec...
Страница 458: ...8 Application Instructions API 100 149 DVP PLC Application Manual 8 56 or relay itself See 2 3 for more information...
Страница 472: ...8 Application Instructions API 100 149 DVP PLC Application Manual 8 70 MEMO...
Страница 574: ...9 Application Instructions API 150 199 DVP PLC Application Manual 9 102 MEMO...