Control Bits For Hsc0, Hsc1, And Hsc2; Setting Current Values And Preset Values; Current And Preset Values Of Hsc0, Hsc1, Hsc2, Hsc3, Hsc4, And Hsc5 - Siemens SIMATIC S7-200 System Manual

Hide thumbs Also See for SIMATIC S7-200:
Table of Contents

Advertisement

SIMATIC Instructions
Control Byte
Once you have defined the counter and the counter mode, you can program the
dynamic parameters of the counter. Each high-speed counter has a control byte
that allows the counter to be enabled or disabled; the direction to be controlled
(modes 0, 1, and 2 only), or the initial counting direction for all other modes; the
current value to be loaded; and the preset value to be loaded. Examination of the
control byte and associated current and preset values is invoked by the execution
of the HSC instruction. Table 9-12 describes each of these control bits.
Table 9-12 Control Bits for HSC0, HSC1, and HSC2
HSC0
HSC1
HSC2
SM37.3 SM47.3 SM57.3 SM137.3 SM147.3 SM157.3 Counting direction control bit:
SM37.4 SM47.4 SM57.4 SM137.4 SM147.4 SM157.4 Write the counting direction to the HSC:
SM37.5 SM47.5 SM57.5 SM137.5 SM147.5 SM157.5 Write the new preset value to the HSC:
SM37.6 SM47.6 SM57.6 SM137.6 SM147.6 SM157.6 Write the new current value to the HSC:
SM37.7 SM47.7 SM57.7 SM137.7 SM147.7 SM157.7 Enable the HSC: 0 = disable the HSC;

Setting Current Values and Preset Values

Each high-speed counter has a 32-bit current value and a 32-bit preset value. Both
the current and the preset values are signed integer values. To load a new current
or preset value into the high-speed counter, you must set up the control byte and
the special memory bytes that hold the current and/or preset values. You must
then execute the HSC instruction to cause the new values to be transferred to the
high-speed counter. Table 9-13 describes the special memory bytes used to hold
the new current and preset values.
In addition to the control bytes and the new preset and current holding bytes, the
current value of each high-speed counter can be read using the data type HC
(High-Speed Counter Current) followed by the number (0, 1, 2, 3, 4, or 5) of the
counter. Thus, the current value is directly accessible for read operations, but can
only be written with the HSC instruction described above.
Table 9-13 Current and Preset Values of HSC0, HSC1, HSC2, HSC3, HSC4, and HSC5
Value to be Loaded
New current
New preset
9-38
HSC3
HSC4
HSC5
HSC0
HSC1
SMD38
SMD48
SMD58
SMD42
SMD52
SMD62
Description
0 = count down; 1 = count up
0 = no update; 1 = update direction
0 = no update; 1 = update preset
0 = no update; 1 = update current value
1 = enable the HSC
HSC2
HSC3
HSC4
SMD138
SMD148
SMD142
SMD152
S7-200 Programmable Controller System Manual
HSC5
SMD158
SMD162
A5E00066097-02

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents