High-Speed Counter Instructions - Siemens Simatic S7-200 System Manual

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

Advertisement

High-Speed Counter Instructions

High-Speed Counter Definition
The High-Speed Counter Definition instruction (HDEF) selects the
operating mode of a specific high-speed counter (HSCx). The mode
selection defines the clock, direction, start, and reset functions of the
high-speed counter.
You use one High-Speed Counter Definition instruction for each
high-speed counter.
Error conditions that set ENO = 0
H 0003 (input point conflict)
H 0004 (illegal instruction in interrupt)
H 000A (HSC redefinition)
High-Speed Counter
The High-Speed Counter (HSC) instruction configures and controls
the high-speed counter, based on the state of the HSC special
memory bits. The parameter N specifies the high-speed counter
number.
The high-speed counters can be configured for up to twelve different modes of operation. See Table
6-25.
Each counter has dedicated inputs for clocks, direction control, reset, and start, where these functions
are supported. For the two-phase counters, both clocks can run at their maximum rates. In quadrature
modes, you can select one times (1x) or four times (4x) the maximum counting rates. All counters run at
maximum rates without interfering with one another.
Error conditions that set ENO = 0
H 0001 (HSC before HDEF)
H 0005 (simultaneous HSC/PLS)
Table 6-24
Valid Operands for the High-Speed Counter Instructions
Inputs/Outputs
HSC, MODE
N
Refer to the Tips and Tricks on the documentation CD for programs that use high-speed counters. See
Tip 4 and Tip 29.
Tips and Tricks
High-speed counters count high-speed events that cannot be controlled at S7-200 scan rates. The
maximum counting frequency of a high-speed counter depends upon your S7-200 CPU model. Refer to
Appendix A for more information.
Tip
CPU 221 and CPU 222 support four high-speed counters: HSC0, HSC3, HSC4, and HSC5. These
CPUs do not support HSC1 and HSC2.
CPU 224, CPU 226, and CPU 226XM support six high-speed counters: HSC0 to HSC5.
Data Types
Operands
BYTE
Constant
WORD
Constant
S7-200 Instruction Set
Chapter 6
6
111

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents