NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems when running a LabVIEW VI in a new thread sub sequence from TestStand and executing the MainSequence in single step mode

Solved!
Go to solution

Hi,

 

we want to run a LabVIEW VI (LV2011) parallel to the execution of a test sequence from TestStand (TS2010). The VI should visualize the state of the hardware, while the test sequence is written in TestStand. This would be a nice feature for debugging the TestStand sequence while watching the hardware state on the LabVIEW panel, too.

 

This is where it comes to our problem. Imagine that you have a MainSequence calling a sub-sequence in a new thread, which runs the LabVIEW-VI. After the call, the MainSequence continues its progress as it is configured to do so. But if we want to execute the MainSequence in single step mode parallel to the VI runtime, we cannot do this. The controls for "Step Out" etc. are grayed out.

 

I've tried to build a very simple example to explain what I mean. It's just one sequence and one LabVIEW VI, no real functionality, just take it as an example for our problem.

 

Any hints? What are we doing wrong? Is there something that must be changed in the LabVIEW VI?

 

Best regards

Manuel

0 Kudos
Message 1 of 5
(4,590 Views)
Solution
Accepted by topic author HDRM

You should be using the Termination Monitor and ExternallySuspended APIs for the asynchronously running VIs. There are wrapper VIs around these APIs in the TestStand LabVIEW palette.

 

For more details see the API help for the following:

Thread.ExternallySuspended

Execution.InitTerminationMonitor

Execution.GetTerminationMonitorStatus

 

Unless I am misunderstanding what you are asking, if you use these APIs you should be able to make things work like you are wanting them to.

-Doug

Message 2 of 5
(4,553 Views)

Hi,

 

thank you. We use "Run VI Asynchronously" from the LabVIEW Utility Palette instead, now it works fine.

 

Best regards and thanks for the help!

Manuel

0 Kudos
Message 3 of 5
(4,538 Views)

dug9000 could you explain more how this wrapper to run VI asynchronously is made? How those API properties and methods are used to make VI run in new thread without blocking execution of main thread?



0 Kudos
Message 4 of 5
(4,352 Views)

First use a sequence call step set to run a sequence in a New Thread. Then, if you are going to have a long running VI in that thread, consider using the APIs I discussed in my previous post at the beginning and end of the code in the VI. The TestStand palette in LabVIEW has wrapper VIs around those APIs in order to make them easier to use.

 

-Doug

0 Kudos
Message 5 of 5
(4,343 Views)