Example 1: Measuring the speed in case of only one pulse or a few pulses per rotation
In the first example, the instruction "CTRL_HSC_EXT" is used to determine the speed of a rotary motion in case of only one pulse or a few pulses per rotation.
Example 2: Determining the length by means of an HW gate
The second example explains the use of an HW gate. In this case, the pulses of an incremental encoder are counted as long as a light barrier detects an object. The number of pulses is used to calculate the size of an object given a known length of travel per pulse.
Example 3: Determining the velocity by means of an HW gate
In the third example, the pulses of an incremental encoder (PWM) of the S7-1200 are counted by means of the HW gate as long as a light barrier detects an object. The number of pulses and the cycle time of the PWM signal are used to determine the duration of the High signal at the HW gate. The velocity will be calculated from the duration and the defined known size of an object.
109742346_HSC_S7_1200_DOKU_V10_en.pdf - Manual
109742346_HSC_S7_1200_DOKU_V10_en.zip - TIA V14 project