NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Run VI Asynchronously

Solved!
Go to solution

There is a great procedure for creating steps to Run VI Asynchronously.

 

https://decibel.ni.com/content/docs/DOC-21743

 

I tried calling this VI Asynchronously again later in my Sequence and it doesn't seem to be running.

What I do is call this vi that starts a sinewave @ x hertz, y volts.  Do some testings on other outputs in Teststand 4.1.  STOP the vi by passing a parameter into the vi that is running asynchronously ( as in the above example).  Now I want to chg the freq to z hertz and w volts.  I tried calling the vi asynchronously again w the new values but there isn't anything on my output.  What am I doing wrong??

 

Should I pass the values in as parameters like the STOP??  that would mean creating a dozen values...amp, freq,etc.  Why can't I call the same vi again using the Run VI Asynchronously?

 

Thanks

 

0 Kudos
Message 1 of 6
(5,051 Views)
Solution
Accepted by clint100

You probably need to reset the value of the variable that is setting the Stop condition so that the VI doesn't stop on the first iteration the second time you call it.

CTA, CLA, MTFBWY
0 Kudos
Message 2 of 6
(5,038 Views)

I tried passing different values into the running vi and nothing chgs.  The previous values are still in affect.  That part I think is because the vi is in a DO WHILE loop and is ignoring any outside stimulus.  Why can't I stop the vi and then later in the seq call the same one again??  If I run the vi asynchronously stop it then try to call it again later nothing happens ( I'm monitoring the output w a scope).

 

Thanks

 

0 Kudos
Message 3 of 6
(5,035 Views)

You kind of hit on the problem.  When I passed in the boolean to Stop the vi then I called it again later in my program, the STOP never reset or reinitialized.  So it was always TRUE (Stop) from the previous thread.  I had to pass in a FALSE and it worked!!  Thanks..

0 Kudos
Message 4 of 6
(5,015 Views)

Hello,

 

I have recreated this example originally posted on 8-6-2012; which is also found at https://decibel.ni.com/content/docs/DOC-21743.  

 

I am having difficulty "stopping" the VI that is running asyncrhonously in another Thread.  It often times will execute the VI in the background, and other times it will give me an error: 

"Unknown variable or property name 'Stop'. in Filename.vi-> Filename.vi.Proxy Caller"

Error Code: -17036; Unknown Variable or Property name.  

 

If it doesn't give me any error, and executes properly, it won't stop  with the f(x) statement of "Parameters.Stop = True"

 

 

 

Run VI Asynchronously Error.JPG

 

SERIAL_COMM_to_ATMEL_For_BTUd.png

 

 Labview 2014, TestStand 2014

 

0 Kudos
Message 5 of 6
(4,558 Views)

Hello again,

 

I have found a solution in the issue I was having.  There is a selectrion in the Run VI Asynchronously Step Settings window.  The Default Radio Button for "Context to Pass as ThisContext for VI Arguments" is "Use Context of New Thread....."

 

By Selecting the other Radio Button, "Use Context of Calling Thread....."  it seems to now work.  However, I will now have to look into the "Accessing the context of the calling thread requires additional synchonization for thread saftey.)

 

RUn VI asynchronously FIx.JPG

0 Kudos
Message 6 of 6
(4,539 Views)