Siemens Simatic S7 Series System Manual page 235

Hide thumbs Also See for Simatic S7 Series:
Table of Contents

Advertisement

HSC Control bytes
HSC0
SM37.3
SM37.4
SM37.5
SM37.6
SM37.7
Read the HSC current value with your program
The current value of each high-speed counter can only be read using the data type HC
(High-Speed-Counter Current) followed by the counter identifier number (0, 1, 2, or 3) as
shown in the following table. Use the HC data type whenever you wish to read the current
count, either in a status chart or in the user program. The HC data type is read-only double
word value; you cannot write a new current count to the high speed counter using the HC
data type.
Current values of HSC0, HSC1, HSC2, and HSC3
Value to be read
CV (counter current value)
Example: Reading and saving the current count value
LAD
MAIN
S7-200 SMART
System Manual, 09/2015, A5E03822230-AC
HSC1
HSC2
HSC3
SM47.3
SM57.3
SM137.3
SM47.4
SM57.4
SM137.4
SM47.5
SM57.5
SM137.5
SM47.6
SM57.6
SM137.6
SM47.7
SM57.7
SM137.7
HSC0 ad-
dress
HC0
Save the value of HSC0 into
VD200 when I3.0 transitions
from OFF to ON.
Description
Counting direction control bit:
0 = Count down
1 =Count up
Write the counting direction to the HSC:
0 = No update
1 =Update direction
Write the new preset value to the HSC:
0 = No update
1 = Update preset
Write the new current value to the HSC:
0 = No update
1 =Update current value
Enable the HSC:
0 = Disable the HSC
1 =Enable the HSC
HSC1 ad-
HSC2 ad-
dress
dress
HC1
HC2
STL
Network 1
LD I3.0
EU
MOVD HC0, VD200
Program instructions
7.6 Counters
HSC3 ad-
dress
HC3
235

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

Simatic s7-200 smart series

Table of Contents