2. Counter Designing Example Control Program: The output speed of Y0 is 10000 pulses per second with a frequency of 100K M1013 M1000 M1029 Y5 Program Description: z In this example, M1013 is used to control PLC for sending pulses. D1220 = K0 activates Y0 to output pulses and transfer the encoded feedback signal of servo motor from the encoder to the high-speed inputs (X0, X1). X0 and X1 are corresponded to high-speed counter C251, whose max counting frequency is 200 kHz. z When pulse sending is completed, M1029 = ON. The Load Compare instruction DLD executed. If the difference between the value of C251 and the number of pulses is above 10(C251 value ≦ K9990), the alarm Y5 will be enabled.
z When M1029 = ON, [RST C251] will be executed. The value of C251 will be cleared to ensure that C251 will start counting from 0 next time. z Since the output signal of servo encoder is differential signal, the example requires DVP32EH00M model which supports differential signal input with its input terminal X0, X1, X4, and X5. DVP-PLC Application Examples 2-7 DPLSY K100000 K10000 Y0 MOV K0 D1220 DCNT C251 K20000 DLD C251 K9990 RST C251