beautypg.com

2 functions of devices in dvp-plc – Delta Electronics Programmable Logic Controller DVP-PLC User Manual

Page 60

background image

2 Functions of Devices in DVP-PLC

DVP-PLC Application Manual

2-32

CALL Call Subroutine, SRET Subroutine Return:

Y0

X1

P2

CALL

X0

Y1

P***

20

P2

FEND

Y0

SRET

24

Subroutine P2

Call subroutine P***

Subroutine return

END

When X0 = On, CALL instruction will be

executed and the program will jump to P2 and

executed the designated subroutine. When

SRET instruction is executed, the program will

return to address 24 and keep on the execution.

Interruption Pointer I:

Used with API 04 EI, API 05 DI, API 03 IRET. See Chapter 5.5 for more details. There are 6

types of interruption pointer. To insert an interruption, you have to combine the action with EI (enable interruption), DI

(disable interruption), IRET (interruption return) instructions.

1. External

interruption: Due to the special hardware design inside the MPU, the input signals coming in at input

terminals X0 ~ X5 when rising-edge or falling-edge triggers will not be affected by the scan cycle. The currently

executed program will be interrupted immediately and the execution will jump to the designated interruption

subroutine pointer I00□(X0), I10□(X1), I20□(X2), I30□(X3), I40□(X4), I50□(X5). Till the execution reaches

IRET instruction, the program will return to the original position and keep on its execution.

In SA/SX series MPU, X0 (pulse input point) works with X4 (external interruption point), corresponding to C235,

C251 and C253 work with I401, which will be able to interrupt and intercept the present value in the high-speed

counter. D1181 is the device to store the 32-bit value. X1 (pulse input point) works with X5 (external interruption

point), corresponding to C236 works with I501, which will be able to interrupt and intercept the present value in

the high-speed counter. D1198 and D1199 are the devices to store the 32-bit value.

In SC series MPU, X10 (pulse input point) works with X4 (external interruption point), corresponding to C243 and

C255 work with I401, which will be able to interrupt and intercept the present value in the high-speed counter.

D1180 and D1181 are the devices to store the 32-bit value. X11 works with X5, corresponding to C245 works with

I501, which will be able to interrupt and intercept the present value in the high-speed counter. D1198 and D1199

are the devices to store the 32-bit value.

2. Timed

interruption: PLC automatically interrupts the currently executed program every a fixed period of time and

jumps to the execution of a designated interruption subroutine.

3. Interruption when the counting reaches the target: The high-speed counter comparison instruction API 53

DHSCS can designates that when the comparison reaches the target, the currently executed program will be

interrupted and jump to the designated interruption subrountine executing the interruption pointers I010, I020,

I030, I040, I050 and I060.

4. Pulse

interruption: The pulse output instruction API 57 PLSY can be set up that the interruption signal is sent out

synchronously when the first pulse is sent out by enabling flags M1342 and M1343. The corresponding