05-12-2015 09:45 AM
As a first step to run a program in background of my Teststand sequence, I am trying to accomplish the very well detailed procedure that follows to run a VI asynchronously (my future intention is to call my program from a VI that runs in parallel during the Teststand sequence).
https://decibel.ni.com/content/docs/DOC-21743
I think I followed every single step, however my implementation has a signifcative failure : the "asynchronous VI" does not want to close eventhough the concerned boolean parameter is set to "true" and should be read by this VI ...
I assume I am missing something obvious ... But the fact is that I really miss it ! Can anyone show me my mistake please ?
Thank you in advance !
Attached, you can find my sequence and VI.
Solved! Go to Solution.
05-13-2015 08:40 AM
i have not tried that approach
what i have been doing in case i want a VI to be polling data on the background of teststand. For example: query something for gathering data
i will run a test stand sequence on a new thread.
My vi (onthe new thread) will query the device and report the status or cluster of data to file global . then i set this VI for an infinite loop. And i could terminate the loop at anything by writting to a File global
check the example...it could work for some applications.
05-14-2015 05:04 AM
Hi
I tried running your test sequence\vi.
Found that the change in variable value is not reflected in the VI and hence it keeps looping (debugged the VI).
However by using stationg globals instead of parameters or local and using commit globals API it worked fine.
You can use this workaround
Ravi
05-18-2015 04:58 AM
Both your solutions work fine, thank you. For my application, SunRS's solution is more adapted because I would like to perform a last action when quitting the vi (closing the refnum of the program I call in it), which is not possible when I suddenly close the vi from a loop ended in Teststand.
Thanks to both of you !
However, I noticed it is still impossible to read outputs of the vi running asynchronously in the main sequence : Even when I write the output in a StationGlobals variable, it does'nt change all along the sequence ... I have read in some forums that it is not "thread-safe" to access data from a vo running in parrallel, is there a way to bypass that issue ?
05-18-2015 06:37 AM
Hi
1) For your use case you are updating the station globals (stationglobals.ini) in TestStand and only reading in VI which should be fine.
When both tries to update/write to -- it will be an issue.
2) ----I noticed it is still impossible to read outputs of the vi running asynchronously in the main sequence : Even when I write the output in a StationGlobals variable, it does'nt change all along the sequence
The station globals is a physical file (stationglobals.ini) which needs to be commited(saved) after updating the variable file in the VI.
Also TestStand has to reload the stationglobals.
Check this :
https://forums.ni.com/t5/NI-TestStand/Writing-to-TestStand-Station-Globals-from-LabVIEW/td-p/3064530
Hope this helps.
Ravi
05-18-2015 08:24 AM
Thanks a lot ! Indeed I hadn't noticed the StationGlobals had to be reactualized at every launch of the sequence. Assigning them from LabVIEW works very fine !
I am ready to go further with my application now, thank you ! ^^