Hi eveybody,
I am trying to develop a simple function where I can pause and resume elapsed time. The main idea is to pause and resume a Fluke 2638A Hydra scan and simultaneously pause and resume the elapsed time. The elapsed time allows the main VI to timeout (return an error) if no scans appear after 16.67minutes. This is done with button presses therefore an event structure is used.
The Timeout of the event structure is to check if the scan has been completed and to read the time elapsed. I took the approach of creating this function seperate from the Fluke VI in order to optimize it. The while loop is a producer in the main VI, and the event strcutures are vital to the VI.
This Timing VI works, but has a huge drawback. Everytime I press button Resume (after pausing it) the while loop iterates twice (or more depending on the time of pause and resume) before continuing the timing. Therefore, I am lagging behind the actual time. In other words, as soon as I press resume I want the time elapsed to start and not have a delay.
The actual VI has a timeout of 200ms not 2s. The 2second timeout was enter for troubleshooting purposes.
My main idea was to create a function that can pause and resume elapsed time within an Event structure. I don't know how I can initiate a Tick count with the time it had when the button Pause was pressed. This would simplify the VI down below. Instead, I had to calculate the time difference between the moment the Pause button was pressed and the current Tick count value after Resume was pressed (Case Structure "1").
Is there a way to simplify this function while keeping the Event Strcuture inside the Producer Loop?
Here is a snippet of the Producer Loop from the Fluke DAQ VI I am developing. The Timing function (Elapsed time) has not been implemented. It has a elapsed time function where the Pause and Resume functions are not taken into account.
Thank you.