Counter
A counter used on labels, read and optionally written as a number.
| Property | Value |
|---|---|
| Data types | UINT16, INT16, UINT32, INT32 |
| Access | R, 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:
| Request | Result |
|---|---|
| Read 0–1 | 0x0000 0x03E8, the value 1000. |
Write 0–1 = 0x0001 0xE240 (function 16) | Sets Serial to 123456. |
See also Reading and presetting a counter.