Delta DVP — 2.3 Products Amount Calculation (32-bit Counting Up/Down Counter)

2. Counter Design Examples 2.3 Products Amount Calculation (32-bit Counting Up/Down Counter) Entry Exit Control Purpose: z This program is used for monitoring the product amount in the warehouse by photoelectric sensors at both entry and exit. When the amount reaches 40,000, the alarm will be enabled. Devices: Control Program: X0 X1 X0 X1 C216 Y0 Program Description: z The key of this example is using the 32-bit addition/subtraction flag M1216 to control the counting up/ down of C216. When X0 goes from OFF to ON, M1216 = OFF, and C216 will count up; when X1 goes from OFF to ON, M1216 = ON, C216 will count down.

z When the present value of C216 reaches 40,000, C216 = ON, and the alarm Y0 will be enabled. DVP-PLC Application Examples 2-4 Device Function X0 Photoelectric sensors for monitoring incoming goods. X0 = ON when incoming detected. X1 Photoelectric sensors for monitoring outgoing goods. X1 = ON when outgoing detected. M1216 Counting mode of C216(ON: counting down) C216 32-bit counting up/down counter Y0 Alarm RST M1216 SET M1216 DCNT C 216 K40000