Cycle count (X values over equal time intervals) (wwCycleCount)
- Last UpdatedFeb 07, 2025
- 2 minute read
In retrieval modes that use cycles, the cycle count determines the number of cycles for which data is retrieved. The number of actual return values is not always identical with this cycle count. In "truly cyclic" modes (Cyclic, Interpolated, Average, and Integral), a single data point is returned for every cycle boundary. However, in other cycle-based modes (Best Fit, Minimum, Maximum, Counter, ValueState, and RoundTrip), multiple or no data points may be returned for a cycle, depending on the nature of the data.
The length of each cycle (the "resolution" of the returned values) is calculated as follows:
DC = DQ / (n – 1)
Where DC is the length of the cycle, DQ is the duration of the query, and n is the cycle count.
Instead of specifying a cycle count, you can specify the resolution. In that case, the cycle count is calculated based on the resolution and the query duration. For more information, see Resolution (values spaced every X ms) (wwResolution).
This option is relevant in the following retrieval modes:
The application of the cycle count also depends on whether you are querying a wide table. If you are querying the History table, the cycle count determines the number of rows returned per tag. For example, a query that applies a cycle count of 20 to two tags will return 40 rows of data (20 rows for each tag). If you are querying a WideHistory table, the cycle count specifies the total number of rows to be returned, regardless of how many tags were queried. For example, a query that applies a cycle count of 20 to two tags returns 20 rows of data.
Values chosen:
-
If wwResolution and wwCycleCount are not specified, then a default of 100 cycles are chosen.
-
If wwResolution and wwCycleCount are set to 0, then a default of 100000 cycles are chosen.
-
If wwResolution and wwCycleCount are both set, then wwCycleCount is ignored.
-
If wwCycleCount is specified and is less than 0, then a default of 100 cycles are chosen.
-
For ValueState retrieval, if the start time of the cycle is excluded, no states are returned for the first cycle.
-
For ValueState retrieval, if the end time of the cycle is excluded, no states are returned for the last cycle.