Mitsubishi counter
This example is not practical, but it is very useful for analyzing program execution. Only one button is needed at the input of the system, and there is no output. Referring to Figure 1, only X0 is connected. In the analysis of Fig. 3, in the three cases (a), (b), and (c), the current value of the counter is observed, and the program execution process is analyzed.

In the program, M8011 is a special auxiliary relay. As long as the PLC is in running state, it will send a 10ms pulse signal (5ms pass, 5ms off). T0 is 1s timing in the program, 1s after X0 is closed, and T0 is on. C0 is an up counter, and the number of pulses emitted by M8011 is recorded under the premise that X0 is closed and T0 is not closed. In theory, when T0 is on and the C0 counter stops counting, the current value of the counter should be 100 (1s/10ms = 100 pulses). In the three-stage program, only the position before and after execution is changed, but the result is different. The reason is analyzed in conjunction with the corresponding timing diagram.
