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.

2. Programming Concepts<br />

20<br />

X0<br />

CALL<br />

P**<br />

P2<br />

Call subroutine P**<br />

24<br />

X1<br />

Y1<br />

FEND<br />

P2<br />

Y0<br />

(subroutine<br />

P2) subroutine<br />

Y1<br />

SRET<br />

subroutine return<br />

Interrupt pointer I: used with application instruction API 04 EI, API 05 DI, API 03 IRET. There are<br />

four types of interruption pointers. To insert an interruption, users need to combine EI (enable<br />

interruption), DI (disable interruption) and IRET (interruption return) instructions<br />

1. External interrupt<br />

• When input signal of input terminal X0~X7 is triggered on rising-edge or falling-edge, it will<br />

interrupt current program execution and jump to the designated interrupt subroutine pointer<br />

I000/I001(X0), I100/I101(X1), I200/I201(X2), I300/I301(X3), I400/I401(X4), I500/I501(X5),<br />

I600/I601(X6), I700/I701(X7). When IRET instruction is executed, program execution returns<br />

to the address before interrupt occurs.<br />

• When X0 (C243) works with I100/I101 (X1), X0/X1 (C246, C248, C252) works with I400/I401,<br />

the value of C243, C246, C248, C252 will be stored in (D1240, D1241)<br />

• When X2 (C244) works with I300/I301 (X3), X2/X3 (C250, C254) works with I500/I501, the<br />

value of C244, C250, C254 will be stored in (D1242, D1243).<br />

2. Timer interrupt<br />

PLC automatically interrupts the currently executed program every a fixed period of time<br />

(2ms~99ms) and jumps to the execution of a designated interruption subroutine<br />

3. Counter interrupt<br />

The high-speed counter comparison instruction API 53 DHSCS can designate that when the<br />

comparison reaches the target, the currently executed program will be interrupted and jump to the<br />

designated interruption subrountine executing the interruption pointers I010, I020, I030, I040,<br />

I050 ,I060, I070, I080..<br />

4. Communication interrupt<br />

I140:<br />

Communication instruction RS (COM1 RS-232) can be designated to send interrupt request when<br />

specific charcters are received. Interrupt I140 and specific characters is set to low byte of D1167.<br />

This function can be adopted when the PLC receives data of different length during the<br />

2-53

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

Saved successfully!

Ooh no, something went wrong!