Skip to main content

Counter

A counter used on labels, read and optionally written as a number.

PropertyValue
Data typesUINT16, INT16, UINT32, INT32
AccessR, or RW if the mapping is writable

Reading returns the counter's current value. Writing sets the counter's current value.

Use a 32-bit type unless the counter is known to stay below 65536. A value that does not fit the type is saturated.

If the counter does not exist, it reads as 0, and a write returns exception 04.

Example​

The counter Serial at 0–1 (UINT32) in the example mapping list:

RequestResult
Read 0–10x0000 0x03E8, the value 1000.
Write 0–1 = 0x0001 0xE240 (function 16)Sets Serial to 123456.

See also Reading and presetting a counter.