Solution
This behavior usually occurs when a Timed Loop operates for longer than its specified period but isn't constructed to throw an error or otherwise stop iterating. Timed Loop periods are supposed to be the absolute maximum duration that the Timed Loop's code could run for without necessitating an error, so having a situation where a Timed Loop could run without error for longer than its period could generate strange, erroneous behavior on the Timed Loop's backend. One way this can manifest is as
integer overflow for the loop's Iteration Duration, which can produce inaccurate, often high numerical values near the 32-bit unsigned integer limit of 4.29x10^9.
There are two ways to address this behavior:
- If you are able to, raise the period of your Timed Loop to ensure it matches up with the longest iteration you can feasibly expect from your code's operation. This will minimize the chance of issues with the Iteration Duration output value.
- If you're unable to increase your Timed Loop's period, or your code typically takes a small amount of time to operate but occasionally takes a long time, you should look into substituting a While Loop for the Timed Loop in your code. While Loops allow for greater flexibility in code operation duration, and can still enforce a minimum period by using the Wait (ms) or Wait Until Next ms Multiple LabVIEW functions .