NI TestStand

Showing results for 
Search instead for 
Did you mean: 

Running a VI parallel to TS sequence

I searched the web and found out there's more than one way to run a VI asynchronously in teststand such as using the Run VI Asynchronously utility,  as a subsequence in a new thread, use an action step to dynamically load and run using Start Asynchronous VI or invoke node with the run method.


My requirement is to launch a running VI (pop to foreground), visible to the user, at a specific part of the sequence, make it run independently during the course of the sequence and end it (FP closes) before the cleanup of the sequence. The launched VI will run an Event-based Queued Message Handler that will in turn pop a dialog to display properties of objects. 


Which Method would you recommend that I use?


And if I were to use the Run method in a step with auto dispose reference to true, how can I stop the launched VI later from TS?

Answers with examples will be very helpful


0 Kudos
Message 1 of 3

I recommend you to avoid a construct like you describe. The reason is that you have to take care about "Application Instances" in case you have other LV based modules which might generate data you want to display.

I recommend that you develop a custom User Interface which does what you need. Please note that you can use TS user management to alter the UI depending on available user rights for the logged in user. This way, you have a well-defined setup regarding tasks within your application which makes debugging simpler and usually benefits overall performance.


Edit: For instance, starting something in parallel to your sequence execution can be "triggered" in the PreUUT callback and stopped in the PostUUT callback by sending appropriate UI Messages to the custom UI.

Another option for parallel execution you didn't mention is generation of a custom process model plugin. This has the same challenges as the options you already mentioned.

CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 2 of 3

I do this all the time.  I launch a vi async and then communicate back and forth with the popup which shows a contemporaneous log and even has user buttons via named queues. I have a very simple LV vi that TS uses to send data to the queue or to poll the queue for response messages. When I want to shut it down, I send a queued command message to the vi which interprets it and then shuts itself down.  By using the queue method, you don't have to keep an instance handle, just the name of the queue.  

0 Kudos
Message 3 of 3