Scenario 4: Analyze cycle time for your process
- Last UpdatedMar 18, 2021
- 2 minute read
You can use the Roundtrip retrieval feature to analyze cycle time. For example, you could answer questions like:
-
How long does it take between starting to fill one bag and starting to fill the next one?
-
How long is the period between downtimes (or, the Mean Time Between Failures, MTBF)?
-
How long between when a pump starts and the next time it starts?
What is RoundTrip Retrieval?
With RoundTrip retrieval, you can determine how long it take for the total cycle of a process to complete, through each "state" in the process. For example, a switch or a valve has two states -- on and off -- and therefore can be tracked using a discrete tag.
Here's an illustration of RoundTrip retrieval for a discrete tag that cycles through on and off states.
RoundTrip calculates the time a state begins until the time the same state begins again. For a discrete tag that simply tracks on and off, RoundTrip mode returns two rows per cycle. For example, when querying a discrete tag, RoundTrip can calculate the time between when a motor starts until the next time it starts, and when the motor stops until the next time it stops.
Example: Analyzing Cycle Time with RoundTrip Retrieval
To use the RoundTrip retrieval mode, set the following parameter in your query:
wwRetrievalMode = ‘RoundTrip’
This query uses RoundTrip retrieval:
SELECT DateTime, TagName, vValue, StateTime
FROM History
WHERE TagName like 'Motor1.State'
AND DateTime >= '2015-09-17 0:00'
AND DateTime < '2015-09-17 2:00'
AND wwResolution=3600000
AND wwRetrievalMode='RoundTrip'
AND wwStateCalc='MinContained'
AND wwTimeStampRule='start'
The results are:
|
DateTime |
TagName |
vValue |
StateTime |
|
2015-09-17 00:00:00.0000000 |
Motor1.State |
1 |
22001 |
|
2015-09-17 00:00:00.0000000 |
Motor1.State |
0 |
21981 |
|
2015-09-17 01:00:00.0000000 |
Motor1.State |
1 |
22001 |
|
2015-09-17 01:00:00.0000000 |
Motor1.State |
0 |
24000 |
In these results, the value "0" shows when the valve was off and "1" when it was on.
The resulting rows show the average amount of time for each state and have a timestamp of the query end time (the default).