EasyManua.ls Logo

Siemens SIMATIC S7-1200 - Page 563

Siemens SIMATIC S7-1200
1614 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Technology instructions
10.1 Counting (High-speed counters)
S7-1200 Programmable controller
System Manual, V4.2, 09/2016, A5E02486680-AK
563
SDT: HSC_Period
The "HSC_Period" data type corresponds to an HSC configured for "Period" mode. The
CTRL_HSC_EXT instruction provides program access to the number of input pulses over a
specified measurement interval. This instruction allows for the time period between input
pulses to be calculated with a fine nanosecond resolution.
Table 10- 5 HSC_Period structure
Structure element
Declaration
Data type
Description
ElapsedTime
OUT
UDInt
See description below.
EdgeCount OUT UDInt See description below.
EnHSC IN Bool Enables the HSC for Period measurement when true; disables
Period measurement when false.
EnPeriod IN Bool Enables NewPeriod value to take effect.
NewPeriod IN Int Specifies the measurement interval time in milliseconds. The
only allowed values are 10, 100 or 1000 ms.
ElapsedTime returns the time, in nanoseconds, between the last counting events of
sequential measurement intervals. If no counting events occurred during a measurement
interval, ElapsedTime returns the cumulative time since the last counting event.
ElapsedTime has a range from "0" to 4,294,967,280 nanoseconds (0x0000 0000 to 0xFFFF
FFF0). The return value 4,294,967,295 (0xFFFF FFFF) indicates that period overflow has
occurred. Overflow indicates that the time between pulse edges is greater than 4.295
seconds and the period cannot be calculated using this instruction. The values from 0xFFFF
FFF1 to 0xFFFF FFFE are reserved.
EdgeCount returns the number of counting events received during the measurement interval.
The period can only be calculated when the value of EdgeCount is greater than zero. If
ElapsedTime is either "0" (no input pulses received) or 0xFFFF FFFF (Period overflow), then
EdgeCount is not valid.
When EdgeCount is valid, use the following formula to calculate the period in nanoseconds:
Period = ElapsedTime/EdgeCount
The calculated time period value is an average of the time periods of all of the pulses that
occur during the measurement interval. If the period of an incoming pulse is greater than the
measurement interval (10, 100, or 1000 ms), then the period calculation requires multiple
measurement intervals.

Table of Contents

Other manuals for Siemens SIMATIC S7-1200

Related product manuals