Counting Range - Siemens SIMATIC S7-300 FM 350-1 Manual

Counter
Table of Contents

Advertisement

7.3.6

Counting range

Introduction
There is a 32-bit wide count register on the module. With the Count range, you select
whether the module is to count only in the positive range or whether the 32nd bit is
interpreted as a sign bit thus allowing negative numbers to be represented. You can only
select a count range if no main counting direction is set.
Counting range
The FM 350-1 counts in different count ranges at the two count range limits 0 to +32 bits and
-31 to +31 bits. An overflow or an underflow is detected at the respective count limits.
In the -31 to +31 bits count mode, the counter status is represented in 2's complement.
Table 7- 14
Counting Ranges and Overflow/Underflow
Counting range
0 to +32 bits*
0 to 4 294 967 295
0 to FFFF FFFFH
-31 to +31 bit
–2 147 483 648 to 2 147
483 647
8000 0000H to 7FFF
FFFFH
*In this count range, you can only specify and evaluate hexadecimal values.
Overflow, Underflow and Zero Pass
At both count limits, a bit is set in the DB of the FC CNT_CTRL1 in the event of overflow and
underflow (see chapter DB Assignment (Page 169)).
At the "-31 to +31-bit" count range, a bit is similarly set in the DB with a zero pass.
At the "0 to +32-bit" count range, an overflow or underflow, depending on the direction of
counting, is additionally indicated upon zero pass.
Table 7- 15
Event
Overflow
Underflow
Zero pass
Initiating Hardware Interrupts
You can also signal the overflow, underflow and zero pass events via hardware interrupts.
FM 350-1 Counter module
Manual, 05/2011, A5E03648639-01
Overflow
When the counter status changes
from 4 294 967 295 to 0
When the counter status changes
from +2 147 483 647 to
–2 147 483 648
Status Bit in DB at Overflow/Underflow and Zero Pass
Operating Modes, parameters and commands
Underflow
When the counter status changes
from 0 to 4 294 967 295
When the counter status changes
from –2 147 483 648 to 2 147 483
647
Status bit in DB
STS_OFLW is set
STS_UFLW is set
STS_ZERO is set
7.3 Count modes
103

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents