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

Program example 2:<br />

1. When the rising-edge of X20 is triggered, CALL P10 instruction will transfer execution to<br />

subroutine P10.<br />

2. When X21 is ON, execute CALL P11, jump to and run subroutine P11.<br />

3. When X22 is ON, execute CALL P12, jump to and run subroutine P12.<br />

4. When X23 is ON, execute CALL P13, jump to and run subroutine P13.<br />

5. When X24 is ON, execute CALL P14, jump to and run subroutine P14. When the SRET<br />

instruction is reached, jump back to the last P subroutine to finish the remaining instructions.<br />

6. The execution of subroutines will go backwards to the subroutine of upper level until SRET<br />

instruction in P10 subroutine is executed. After this program execution will return to the main<br />

program.<br />

X0<br />

INC<br />

D0<br />

X2<br />

P12 INC D30<br />

Y0<br />

Y20<br />

X20<br />

X0<br />

CALL<br />

INC<br />

P10<br />

D1<br />

Main<br />

Program<br />

X23<br />

X2<br />

CALL<br />

INC<br />

P13<br />

D31<br />

Subroutine<br />

Y1<br />

Y21<br />

FEND<br />

SRET<br />

P10<br />

X2<br />

INC<br />

D10<br />

P13<br />

X2<br />

INC<br />

D40<br />

X21<br />

X2<br />

Y2<br />

CALL<br />

INC<br />

P11<br />

D11<br />

Subroutine<br />

X24<br />

X2<br />

Y22<br />

CALL<br />

INC<br />

P14<br />

D41<br />

Subroutine<br />

Y3<br />

Y23<br />

P11<br />

X2<br />

SRET<br />

INC<br />

D20<br />

P14<br />

X2<br />

SRET<br />

INC<br />

D50<br />

X22<br />

X2<br />

Y4<br />

CALL<br />

INC<br />

P12<br />

D21<br />

Subroutine<br />

Y24<br />

SRET<br />

END<br />

Subroutine<br />

Y5<br />

SRET<br />

3-48

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

Saved successfully!

Ooh no, something went wrong!