CtrNextValue

When using a counter, the usual case is to query and update the counter. This command retrieves the counter's current value, increments it, updates the file, and returns the original value.

For example:

Input: CtrNextValue CTR
Output: 1
Input: CtrNextValue CTR
Output: 2

When updating a counter causes it to exceed its configured maximum value, it rolls over to its reset value.

For example:

Input: CtrNextValue CTR
Output: 3
Input: CtrNextValue CTR
Output: 1

To retrieve the counter’s current value, increment the counter’s value, and change to its reset value. If required, then use:

CtrNextValue tag ?mode?
  • tag is the counter file path.
  • mode is the file.