NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How can TestStand shutdown a VI running continuously in a VI while loop in its own thread?

I am using TestStand 3.5 and Labview 8.2:
 

I have a teststand Launched activex server application written in VB.

I then launch a VI in its own sequence thread which runs forever in a VI while loop so it stays alive and never returns. This is because the vi is a monitoring for events coming from the Launched VB activex server.  This VI converts the events from the VB active x server into Notifications. These notifications are then sent back the main teststand sequence whom monitors for the Notifications. 

At some point I want the Teststand main sequence to shutdown the one running VI.

How can I get testand to stop and shutdown the VI from TestStand ????

 

I do not want an event to come from the activex server to signal the shutdown, I want it to come from the main teststand sequence. I also donot want a frontpanel of the VI to stop the VI. I do not want the user to see the VI.

0 Kudos
Message 1 of 4
(4,199 Views)

I'm trying to understand your application.  So is the VI launched from the VB activex server?  Or is it launched from TS?  You could do UI messaging but that would be quite messy.  The other options is to get the sequence context from TS to the VI through parameters.  Then in the VI you will have access to all TS variables.  Then you can have the while loop condition trigger on a certain variable.

Regards,



Message Edited by ~jiggawax~ on 05-02-2008 03:32 PM
jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 4
(4,191 Views)

TestStand launches the VI in its own thread. TestStand also launches the VB activex server from the main thread. I think I will try your suggestion of having the while loop pole a TS variable.  I do not like poling so I will also try to put a timer on the while loop.  I was also thinking to add a method to the VB activex server to call an event that the VI could detect. This would put a dependency on the health of the VB Activex server which I do like doing. Thanks for your suggestion.

Best Regards,

0 Kudos
Message 3 of 4
(4,164 Views)
I just want to add that for any step that runs for a non-finite amount of time like this you should also be using the termination status monitor and the externally suspended settings in TestStand. See the TestStand API help for Thread.ExternallySuspended, Execution.InitTerminationMonitor, and Execution.GetTerminationMonitorStatus. Using these APIs will allow the TestStand "break", "terminate", and "abort" commands to work even while your vi is running.

Hope this helps.
-Doug
0 Kudos
Message 4 of 4
(4,154 Views)