×
Siemens Industry Online Support
Siemens AG
Entry type: Application example Entry ID: 109742346, Entry date: 12/27/2016
(15)
Rate

S7-1200: Application Examples for High-Speed Counters (HSC)

  • Entry
  • Associated product(s)
In automation technology, there are many fast events that cannot be detected in the program cycle of the main OB. The high-speed counters (HSC) of the S7-1200 help you to process even those events.

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.




Documentation and example project
  Documentation (813,5 KB)
Registration required Project for STEP 7 V14 (606.6 KB)


Last Changes
First version

Security information
In order to protect technical infrastructures, systems, machines and networks against cyber threats, it is necessary to implement – and continuously maintain – a holistic, state-of-the-art IT security concept. Siemens’ products and solutions constitute one element of such a concept. For more information about cyber security, please visit
https://www.siemens.com/cybersecurity#Ouraspiration.