From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to catch user break from OI ?

 

I'm using slightly modified standard CVI OI shipped with TS.

 

I have a sequence in TS which counts time how long time it takes for a DUT to clarify the test. If the DUT doesn't clarify the test at all, the sequence timeouts and indicates test time failed.

 

Sometimes it happens that operator wants to break the test by clicking the break button on OI, do some things with DUT and continue testing. In my current implementation time which operator do things is counted, so normally when operator continues testing timeout condition is met and sequence indicates test time is failed.  

 

I would like to improve the sequence by catching the operator break OI button click, save the time stamp, catch the operator resume OI button click and substract time it took for operator in order to get real time it took for DUT to clarify the test. 

 

Any hint ?

 

I attach start point for a sequence file.

 

Best regards,

Petri

 

 

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

The RunStateChanged event of the executionManager object will fire when the user breaks and resumes the execution.  You can check the ExecutionRunStates event argument to determine whether the execution is paused or resumed:

 

  • ExecRunState_Paused–(Value: 2) The execution is suspended.
  • ExecRunState_Running–(Value: 1) The execution is running.
  • ExecRunState_Stopped–(Value: 3) The execution has finished executing. 

The CVI code to register the event would be:

 

TSUI__ExecutionViewMgrEventsRegOnRunStateChanged(execMgr, ExecMgr_RunstateChangedCallback, NULL, 1, NULL);

 

Al B.
Staff Software Engineer - TestStand
CTA/CLD
0 Kudos
Message 2 of 4
(3,515 Views)

thanks for response.

 

It was some years ago since I last time was dealing with this so I'm still somewhat lost in the jungle.

 

I have couple of questions:

* I succesfully registered the event in the CVI OI and defined the callback function to the event. Do I need to implement any code in callback function that sequence file can catch the event ?

* I can't find runstatechanged property in the TS API automatic server when defining the ActiveX/COM adapter settings. Could you help me point out in which automation server and in which object I can read the runstate ? My idea is to read this information in sequence.

 

best regards,

petri

 

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

Hi Petri,

 

The method i suggested would allow you to implement this in the user interface, not the sequence itself; sorry for the confusion on that. Unfortunately there isn't a good way to do this in the sequence itself because the sequence will not be executing at a breakpoint, so no callback sequences will run until you resume the execution.  

 

I think the best approach here would be to use the method I described previously to implement a counter variable in the UI which tracks how much time an execution has been suspended, then query this value at the end of your sequence using a custom UI message (as in this example; unfortunately no CVI equivalent example exists).  Refer to this article for information on creating a UI message callback in your user interface.

Al B.
Staff Software Engineer - TestStand
CTA/CLD
0 Kudos
Message 4 of 4
(3,487 Views)