NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Capturing pause time

Hi,

 

I have a customer requirement which I could do with a bit of "inspiration" with.

 

The customer wants to be able to pause the execution of a sequence. So far not a big problem ... I simply gave him a break/resume button.

 

Another requirement however states that the pause time has to be logged. Looking through the results of some tests it seems that the execution time of any paused step does not include the pause ... the upper level sequence however does reflect the increased run-time.

 

As it probably changes a lot: In these tests I induced the pause by calling the TS API in a LabVIEW step, rather than pressing the pause button.

 

I wondered if anyone had an idea of how I could go on about this best?

 

Best Regards

 

Mathis

0 Kudos
Message 1 of 4
(3,560 Views)

Mathis,

 

If you're doing the pause in a code module, one option would be to use the Engine.SecondsSinceStart property to save the current time when you pause, and then read the property again when you resume to get the time difference. However, you wouldn't be able to do that if the user is pausing or resuming with the built-in pause/resume functions in the Sequence Editor.

Message 2 of 4
(3,556 Views)

Hi Daniel,

 

that's a very good idea. I probably wouldn't be able to do it on a pause press when running in the sequence editor. In the custom OI I can handle the UI events to handle the pauses:

 

http://zone.ni.com/reference/en-XX/help/370052P-01/tsapiref/reftopics/uimessagecodes/

 

UIMsg_BreakOnUserRequest–(Value: 1) TestStand sends this message to the user interface to notify it that the execution suspended in response to a user request. The user interface must update the display accordingly.

UIMsg_ResumeFromBreak–(Value: 17) TestStand sends this message when an execution resumes after being suspended at a breakpoint. The execution resumes when the user interface message is released.

 

I'll let you know how that works.

 

Thank you very much

 

Best Regards

 

Mathis

0 Kudos
Message 3 of 4
(3,537 Views)

To give a quick update. I have found the error with my previous implementation:

 

- I was sending a User message event which displayed some instruction in a panel of the OI

- subsequently I paused (Sequence Context --> execution --> break)

 

the problem was that pausing the sequence was the last part of that code module. That means that the module finished before the pause came into action and the pause was not registered as part of this step. Instead the pause came into action during the "tracing" which was left on for debugging reasons. The pause therefore never meade it onto the "score sheet" of any individual step. Adding a small delay at the end of the code module after the pause has been issued means that the pause comes into effect while the code module is still executing and the time gets properly added onto the module execution time.

 

Best Regards

 

Mathis

0 Kudos
Message 4 of 4
(3,473 Views)