Mitsubishi — 3.8 Counters

AH500 Motion Control Module Manual Example: LD X1.0 OUT SM255 X1.0 SM255 LD X1.1 X1.1 RST C255 X1.2 DCNT C255 K-5 LD X1.2 LD C255 C255 OUT Y0.0 1. SM255 is driven by X1.0. The state of SM255 determines whether C255 counts up or counts down. 2. If X1.1 is turned form OFF to ON, the instruction RST will be executed, the present value of C255 will become 0, and the contact will be OFF. 3. If X1.2 is turned form OFF to ON, the present value of the counter will increase by one or decrease by one. 4. If the present value of the counter C255 increases from K-6 to K-5, the contact C255 will be turned form OFF to ON.

If the present value of the counter C255 decreases from K-5 to K-6, the contact C255 will be turned from ON to OFF. 5. If a value greater than the setting value of C255 is moved to C255 by means of the instruction MOV, the contact C255 will be ON, and the present value of the counter will become the setting value next time X1.1 is turned from OFF to ON. Y0.0 X1.0 Increasing Increasing Decreasing X1.1 0 1 2 3 4 5 4 3 2 1 0 -1 -2 -3 -4 -5 -6 -7 -8 C255 counts. Present value 0 -7 -6 -5 -4 -3 The output contact is ON. Y0.0,C255 Contact 3-10 RST C255 DCNT C255 K-5 X1.2