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: 0 → 1 will trigger counter incrementation, but 1 → 2 (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:
Fig. 1. Example of a counter tag.
Table below illustrates the counter behavior under different parameter combinations.