The system input needs only one button and no output. Refer to figure 1, only X0. In Figure 3, (a), (b), (c), the current value of the counter is observed and the program execution process is analyzed.
The program M8011 is a special auxiliary relay. As long as the PLC is in operation state, it will send out 10 ms pulse signal (5 MS on, 5 ms off). In the program, T0 is 1s timing, 1s is closed after X0, and T0 is turned on. C0 is an increment counter, and the number of pulses emitted by M8011 is recorded on the premise that X0 is closed and T0 is not closed. Theoretically, when the T0 is turned on and the C0 counter stops counting, the current value of the counter should be 100 (1s/10ms = 100 pulses). In the three paragraph, it only changes the position before and after execution, but the result is different.