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 Function<br />

02 SRET Subroutine Return<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<br />

No contact to drive the instruction is required<br />

Automatically returns program execution to the address<br />

after CALL instruction in O100.<br />

SRET: 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 />

SRET indicates the end of subroutine program. The subroutine will return to main program and<br />

begin execution with the instruction after the CALL instruction.<br />

Program example 1:<br />

When X0 = ON, the CALL instruction will jump to P2 and run the subroutine. With the execution of<br />

the SRET instruction, it will jump back to address 24 and continue the execution.<br />

20<br />

X0<br />

CALL<br />

P2<br />

Call subroutine P2<br />

24<br />

X1<br />

Y0<br />

FEND<br />

P2<br />

M1<br />

Y1<br />

M2<br />

Y2<br />

Subroutine<br />

SRET<br />

Subroutine return<br />

3-47

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

Saved successfully!

Ooh no, something went wrong!