8. Rotation and Shift Design Examples X1 Enabling the neon lamps in the order: Y17~Y10, Y7~Y0. Each lamp for 200ms. T1 M11 T1 X2 Reset Program Description: z When Rotation Right is pressed, X0 = ON to execute ZRST and SET instructions. Y0~Y17 and M10~M11 will be reset first, then Y0 and M10 will be ON. TMR instruction will be executed. After 200ms, the contact T0 will be activated once to execute ROL instruction. The ON state of Y0 will be shifted to Y1, and T0 will then be reset. z In the next scan cycle, timer T0 starts counting again. After 200ms, ROL instruction will be executed one more time and the ON state of Y1 will be shifted to Y2.
By the same process, Y0~Y17 will be ON for 200ms in order. z The rotation left process is similar to the above process. However, the rotation right program uses ROR instruction to enable the lamps in the order: Y17~Y10, Y7~Y0 z When RESET is pressed, X2 = ON to reset Y0~Y17 and M10~M11. All neon lamps will be OFF. (Note: in this program, the purpose of placing ZRST instruction after the rising-edge contacts of X0 and X1 is to ensure that all the neon lamps start flashing from Y0 or Y17.) DVP-PLC Application Examples 8-2 ZRST Y0 Y17 ZRST M10 M11 SET Y17 SET M11 TMR T1 K2 ROR K4Y1 K1 RST T1 ZRST Y0 Y17 ZRST M10 M11