17.03.2014 Views

DVP-ES2-EX2-SS2-SA2-SX2-Operation Manual

DVP-ES2-EX2-SS2-SA2-SX2-Operation Manual

DVP-ES2-EX2-SS2-SA2-SX2-Operation Manual

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

3. Instruction Set<br />

API Mnemonic Operands Function<br />

08 FOR Start of a FOR-NEXT Loop<br />

Controllers<br />

<strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong> <strong>SA2</strong><br />

SE<br />

<strong>SX2</strong><br />

Type<br />

Bit Devices Word devices Program Steps<br />

OP X Y M S K H KnX KnY KnM KnS T C D E F<br />

S * * * * * * * * * * *<br />

<strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong> <strong>SA2</strong><br />

SE<br />

FOR: 3 steps<br />

PULSE 16-bit 32-bit<br />

<strong>SA2</strong><br />

<strong>SX2</strong> <strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong> <strong>SX2</strong> <strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong><br />

SE<br />

<strong>SA2</strong><br />

SE<br />

<strong>SX2</strong><br />

Operands:<br />

S: The number of times for the loop to be repeated.<br />

API Mnemonic Function<br />

09 NEXT End of a FOR-NEXT Loop<br />

Controllers<br />

<strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong> <strong>SA2</strong><br />

SE<br />

<strong>SX2</strong><br />

OP Descriptions Program Steps<br />

N/A No contact to drive the instruction is required. NEXT: 1 step<br />

PULSE 16-bit 32-bit<br />

<strong>SA2</strong><br />

<strong>SX2</strong> <strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong> <strong>SX2</strong> <strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong><br />

SE<br />

<strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong> <strong>SA2</strong><br />

SE<br />

<strong>SA2</strong><br />

SE<br />

<strong>SX2</strong><br />

Explanations:<br />

1. FOR and NEXT instructions are used when loops are needed. No contact to drive the<br />

instruction is required.<br />

2. “N” (number of times loop is repeated) may be within the range of K1 to K32767. If the range<br />

N≦K1, N is regarded as K1.<br />

3. An error will occur in the following conditions:<br />

• NEXT instruction is before FOR instruction.<br />

• FOR instruction exists but NEXT instruction does not exist..<br />

• There is a NEXT instruction after the FEND or END instruction.<br />

• Number of FOR instructions differs from that of NEXT instructinos.<br />

4. FOR~NEXT loops can be nested for maximum five levels. Be careful that if there are too<br />

many loops, the increased PLC scan time may cause timeout of watchdog timer and error.<br />

Users can use WDT instruction to modify this problem.<br />

3-57

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!