Measuring time between events

To measure time between two events, you need to create a section in your project that will begin counting time at the start of the first event and continue counting until the second event stops the counter.

 

According to the above example, when a box is sensed by a sensor connected to Input 0 (I 0), the value 0 (zero) is written into MI 10 (counter) and MB 1 is latched at logic 1 and enables the counter.

Using a one second pulse (SB 3), the counter increments by one every pulse.

When a box is sensed by the second sensor connected to Input 1 (I 1), MB 1 is reset (unlatched) and the counting stops.

The integer value of MI 10 is the time value that passed between the two events. That is, the amount of time that the box was on the conveyor belt.