S7-1200: Application Examples for High-Speed Counters (HSC)
This application example presents different possible applications for high-speed counters (HSC) of an S7-1200.
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.