×
Skip to main content Link Search Menu Expand Document (external link) Right Arrow

Contents

Counter

Recalculate History is available for this tag.
Counter tag returns an integer that increases by 1 when the associated source tag changes its value. Unlike the similar Accumulator, a counter always increments by 1.

Parameters

Data type is not selectable since this tag can only return an integer. For other tag parameters not covered herein, see Tag Editor.

Manual

Check to prevent automatic tag incrementation. This will disable the Logic and Source tag settings below. The tag will always display a manually entered integer.

Logic

Specifies when to increment the tag:

  • Positive change
    Increments the tag value when the source tag becomes true, if Boolean, or its value increases, if an integer; otherwise, remains unaffected.
  • Any change
    Increments the tag value when the source tag changes its value, regardless of the nature of such change.

A Boolean source tag may contain values other than 0 or 1 in its Readable script field. For the purposes of the counter, any positive value is considered true and any non-positive value is considered false. Thus, this change: 01 will trigger counter incrementation, but 12 (both are true) or -1-3 (both are false) will not.

Source tag

Tag whose value is monitored by the counter, must have a scalar data type. Note that the interface will not show the selected tag’s output type.

Writable

Check to allow manual override of the tag’s value in HMI. Manual overrides will be recorded under Audit Log.

Examples

Figure below illustrates a counter whose output value (an integer) increases by 1 every time that its source tag, Test_Tag located in Test_Folder, becomes positive. This tag can be manually overridden in HMI:

Counter tag settings

Fig. 1. Example of a counter tag.

Table below illustrates the counter behavior under different parameter combinations.

Table 1. Counter configurations.

Source type Logic Source change Counter change
Boolean Positive change
Any change
01
-12
+1
Positive change 12
10
-2-1
No change
Any change 01
10
+1
12
-2-1
No change
Integer Positive change
Any change
23 +1
Positive change 32 No change
Any change 32 +1