NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Running TS execution from LabVIEW results in debug error

Hi everyone

I'm attempting to launch TS 4.0.1 , I then load and execute a sequence. I'm doing all of this from a very very simple LabVIEW interface (8.2) using ActiveX

 

The code runs as epxected and my execution runs without error. Once complete my LabVIEW vi coompletes with no errors. However when I attempt to close the LabVIEW  environment I get a "Just in time" debug erorr stating that LabVIEW.exe encountered a problem (see attatched screen capture)

 

I am closing all of my object references in the correct order (same as in TS simple OI) but I always get this error.

 

Can anyone suggest what could be wrong with my code ?

 

Regards

Chris

 

Download All
0 Kudos
Message 1 of 2
(2,803 Views)

Chris,

 

sadly, you made two mistakes.

1) Once you use ApplicationMgr.OpenSequenceFile, you should use ApplicationMgr.CloseSequenceFile to unload it. Just closing the reference could create leaking references which can lead to the observed crash

2)  WaitForEndEx is one of the most misused functions of the API ever. Please read the remark to this command:

This method is not meant to be used by a user interface or sequence editor, as it does not process UIMessages. Instead, use this method from a step to synchronize with another execution.

 You have to use UIMessages in order to get informed if the execution is finished or not. So you should implement a messagehandler to get this message and quit the ui afterwords....

 

hope this helps,

Norbert 

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
Message 2 of 2
(2,773 Views)