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.

<strong>DVP</strong>-<strong>ES2</strong>/<strong>SA2</strong>/<strong>SS2</strong>/<strong>SA2</strong>/<strong>SX2</strong>/SE <strong>Operation</strong> <strong>Manual</strong> - Programming<br />

API Mnemonic Operands Function<br />

01 CALL P Call Subroutine<br />

Controllers<br />

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

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

OP Valid Range Program Steps<br />

P0~P255<br />

CALL, CALLP: 3 steps<br />

PULSE 16-bit 32-bit<br />

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

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

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

<strong>ES2</strong>/<strong>EX2</strong> <strong>SS2</strong> <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 />

SE<br />

SE<br />

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

Operands:<br />

S: The destination pointer P of the call subroutine.<br />

Explanations:<br />

1. When the CALL instruction is active it forces the program to run the subroutine associated<br />

with the called pointer.<br />

2. A CALL instruction must be used in conjunction with FEND (API 06) and SRET (API 02)<br />

instructions.<br />

3. The program jumps to the subroutine pointer (located after an FEND instruction) and<br />

processes the contents until an SRET instruction is encountered. This forces the program<br />

flow back to the line of ladder immediately following the original CALL instruction.<br />

Points to note:<br />

1. Subroutines must be placed after FEND instruction.<br />

2. Subroutines must end with SRET instruction.<br />

3. CALL pointers and CJ instruction pointers are not allowed to coincide.<br />

4. CALL instructions can call the same CALL subroutine any number of times.<br />

5. Subroutines can be nested 5 levels including the initial CALL instruction. (If entering the six<br />

levels, the subroutine won’t be executed.)<br />

3-46

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

Saved successfully!

Ooh no, something went wrong!