NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing parameters to VI in new thread

Solved!
Go to solution

I have a vi constantly running in the main thread of SeqCont.seq. In this vi is a stop button to stop execution of the vi. How can a pass a reference to this stop button, so I can stop this vi from the main.seq?

 

I tried to pass the sequencecontext, but a value change of the context is not constantly being evaluated by this vi.

Download All
0 Kudos
Message 1 of 8
(5,452 Views)

Here's a little demo.  Let me know if you have any questions.

 

Regards,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
Message 2 of 8
(5,423 Views)

I found this example on the web http://zone.ni.com/devzone/cda/epd/p/id/5838.

 

Why u need to set the fileglobal? 

0 Kudos
Message 3 of 8
(5,412 Views)

Same reason the other example uses Parameter.Stop_Thread, that is to stop the VI running.

 

 

Regards
Ray Farmer
0 Kudos
Message 4 of 8
(5,407 Views)

When I delete the Fileglobal in the last example, the vi doesn't exit anymore.

0 Kudos
Message 5 of 8
(5,404 Views)
Solution
Accepted by topic author JoVMo

Why did you delete it!! You need a teststand variable so as to communicate between Teststand and the LabVIEW VI to tell the Loop to close and hence complete the VI execution.

Regards
Ray Farmer
0 Kudos
Message 6 of 8
(5,401 Views)

I deleted it to test if it affects the GetProperty vi. The Fileglobals is the connection between LV and TST?

0 Kudos
Message 7 of 8
(5,396 Views)

Ok,

 

The Get Property VI should return a error because the Teststand variable doesn't exist if you have deleted it. Unfortunately the VI will not close the loop because the error condition is not connected to the loop terminal.

 

You could include a PropertyObject.Exists and therefore you could do something different and not generate an error.

 

(also Jigg provided the example therefore you should credit him if you think the solution is concluded successfully)

 

 

 

 

Regards
Ray Farmer
0 Kudos
Message 8 of 8
(5,392 Views)