Class Count
|
| Version |
1.0 |
|
| Modified |
08-MAR-2026 11:05:32.00 |
|
| Code |
rt_plc_io.c |
|
Pulse counter.

The counter can be increased, decreased, cleared or set
equal to a present value.
The counter is triggered on leading edges.
Hints
The object can be used as a 'pulse counter card' in the
software at maximum one pulse every second (edge
detecting) loop , i.e. a maximum of 25 Hz, if the base
period T0 is equal to ScanTime of the fastest possible
running PLC program ( = 20 milliseconds) of the node.
|
RtBody attributes pwr_sClass_count |
| Boolean |
CountUp |
up |
A leading edge yields a counting-up and Accum is
increased by one. |
| Boolean |
CountDown |
do |
A leading edge yields a counting-down and Accum is
decreased by one. |
| Boolean |
Clear |
c |
A leading edge clears Accum. |
| Boolean |
Init |
i |
A leading edge sets Accum = Preset. |
| Int32 |
Accum |
PI |
Accumulated counter value. This value may be used as
RawValue of the PiPos object on page 3-265.
The range is -2 147 483 648 to 2 147 483 647. So it
will be possible to accumulate pulses continuously
during 994 days at 25 Hz without overflow, if Accum = 0
at the beginning. |
| Boolean |
Pos |
pos |
Indicates if Accum > 0, or not. FALSE means that Accum
>= 0 and TRUE means that Accum > 0. |
| Boolean |
Zero |
z |
Indicates if Accum = 0, or not. FALSE means that Accum
!= 0 and TRUE means that Accum = 0. |
| Boolean |
Neg |
neg |
Indicates if Accum < 0, or not. FALSE means that Accum
>= 0 and TRUE means that Accum < 0. |
| Boolean |
Equal |
eq |
Indicates if Accum = Preset, or not. FALSE means that
Accum != Preset and TRUE means that Accum = Preset. |
| Int32 |
Preset |
Preset |
Specifies a preset integer value. |
| Int32 |
AccPre |
AccPre |
|
| Int32 |
AccAccum |
AccAccum |
The operator's authorities to change the Preset
respectively Accum attribute.
0 -- Changes not allowed.
!=0 -- Changes allowed. |
| GraphPlcNode |
| object_type |
101 |
| parameters[0] |
4 |
| parameters[1] |
0 |
| parameters[2] |
5 |
| parameters[3] |
0 |
| subwindows |
0 |
| graphmethod |
0 (standard, individual attributes) |
| graphindex |
0 |
| default_mask[0] |
11 |
| default_mask[1] |
5 |
| segname_annotation |
1 |
| compmethod |
4 |
| compindex |
0 |
| tracemethod |
0 |
| traceindex |
0 |
| executeordermethod |
2 |
| objname |
Count |
| graphname |
Count |
| debugpar |
|
Attributes detail
A leading edge yields a counting-up and Accum is
increased by one.
A leading edge yields a counting-down and Accum is
decreased by one.
A leading edge clears Accum.
A leading edge sets Accum = Preset.
Accumulated counter value. This value may be used as
RawValue of the PiPos object on page 3-265.
The range is -2 147 483 648 to 2 147 483 647. So it
will be possible to accumulate pulses continuously
during 994 days at 25 Hz without overflow, if Accum = 0
at the beginning.
Indicates if Accum > 0, or not. FALSE means that Accum
>= 0 and TRUE means that Accum > 0.
Indicates if Accum = 0, or not. FALSE means that Accum
!= 0 and TRUE means that Accum = 0.
Indicates if Accum < 0, or not. FALSE means that Accum
>= 0 and TRUE means that Accum < 0.
Indicates if Accum = Preset, or not. FALSE means that
Accum != Preset and TRUE means that Accum = Preset.
Specifies a preset integer value.
The operator's authorities to change the Preset
respectively Accum attribute.
0 -- Changes not allowed.
!=0 -- Changes allowed.