EasyManua.ls Logo

Siemens SIMATIC S7-1200 - Page 585

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
585
Table 10- 13 Data types for the parameters
Parameter
Declaration
Data type
Description
HSC
IN
HW_HSC
HSC identifier
DIR
1, 2
IN Bool 1 = Request new direction
CV
1
IN
Bool
1 = Request to set new counter value
RV
1
IN Bool 1= Request to set new reference value
PERIOD
1
IN Bool 1 = Request to set new period value
(only for frequency measurement mode)
NEW_DIR
IN
Int
New direction: 1= forward, -1= backward
NEW_CV
IN
DInt
New counter value
NEW_RV
IN
DInt
New reference value
NEW_PERIOD IN Int New period value is in milliseconds (only for frequency meas-
urement mode). The only allowed values are 10, 100, or 1000
milliseconds:
1000 = 1 second
100 = 0.1 second
10 = 0.01 second
BUSY
3
OUT
Bool
Function is busy
STATUS
OUT
Word
Execution condition code
1
If an update of a parameter value is not requested, then the corresponding input values are ignored.
2
The DIR parameter is only valid if the configured counting direction is set to "User program (internal direction control)".
You determine how to use this parameter in the HSC device configuration.
3
For an HSC on the CPU or on the SB, the BUSY parameter always has a value of 0.
You configure the parameters for each HSC in the device configuration for the CPU for
counting/frequency function, reset options, interrupt event configuration, hardware I/O, and
count value address.
Some of the parameters for the HSC can be modified by your user program to provide
program control of the counting process:
Set the counting direction to a NEW_DIR value
Set the current count value to a NEW_CV value
Set the reference value to a NEW_RV value
Set the period value (for frequency measurement mode) to a NEW_PERIOD value
If the following Boolean flag values are set to 1 when the CTRL_HSC instruction is executed,
the corresponding NEW_xxx value is loaded to the counter. Multiple requests (more than
one flag is set at the same time) are processed in a single execution of the CTRL_HSC
instruction.
DIR = 1 is a request to load a NEW_DIR value, 0 = no change
CV = 1 is a request to load a NEW_CV value, 0 = no change
RV = 1 is a request to load a NEW_RV value, 0 = no change
PERIOD = 1 is a request to load a NEW_PERIOD value, 0 = no change
If an error occurs, ENO is set to "0" and the STATUS output indicates a condition code:

Table of Contents

Other manuals for Siemens SIMATIC S7-1200

Related product manuals