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.

DevBody attributes 
PlcNode PlcNode  


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


CountUp Input
Class Input
Type Boolean
Flags STATE | NOEDIT | NOINVERT | REDUTRANSFER
GraphName up
Body RtBody
 A leading edge yields a counting-up and Accum is
 increased by one.

CountDown Input
Class Input
Type Boolean
Flags STATE | NOEDIT | NOINVERT | REDUTRANSFER
GraphName do
Body RtBody
 A leading edge yields a counting-down and Accum is
 decreased by one.

Clear Input
Class Input
Type Boolean
Flags STATE | NOEDIT | NOINVERT | REDUTRANSFER
GraphName c
Body RtBody
 A leading edge clears Accum.

Init Input
Class Input
Type Boolean
Flags STATE | NOEDIT | NOINVERT | REDUTRANSFER
GraphName i
Body RtBody
 A leading edge sets Accum = Preset.

Accum Output
Class Output
Type Int32
Flags STATE | NOEDIT | REDUTRANSFER
GraphName PI
Body RtBody
 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.

Pos Output
Class Output
Type Boolean
Flags STATE | NOEDIT | REDUTRANSFER
GraphName pos
Body RtBody
 Indicates if Accum > 0, or not. FALSE means that Accum
 >= 0 and TRUE means that Accum > 0.

Zero Output
Class Output
Type Boolean
Flags STATE | NOEDIT | REDUTRANSFER
GraphName z
Body RtBody
 Indicates if Accum = 0, or not. FALSE means that Accum
 != 0 and TRUE means that Accum = 0.

Neg Output
Class Output
Type Boolean
Flags STATE | NOEDIT | REDUTRANSFER
GraphName neg
Body RtBody
 Indicates if Accum < 0, or not. FALSE means that Accum
 >= 0 and TRUE means that Accum < 0.

Equal Output
Class Output
Type Boolean
Flags STATE | NOEDIT | REDUTRANSFER
GraphName eq
Body RtBody
 Indicates if Accum = Preset, or not. FALSE means that
 Accum != Preset and TRUE means that Accum = Preset.

Preset Intern
Class Intern
Type Int32
Flags
GraphName Preset
Body RtBody
 Specifies a preset integer value.

AccPre Intern
Class Intern
Type Int32
Flags REDUTRANSFER
GraphName AccPre
Body RtBody

AccAccum Intern
Class Intern
Type Int32
Flags
GraphName AccAccum
Body RtBody
 The operator's authorities to change the Preset
 respectively Accum attribute.

  0   -- Changes not allowed.
  !=0 -- Changes allowed.

PlcNode Buffer
Class Buffer
Type PlcNode
Flags INVISIBLE
Body DevBody