12-02-2014
09:29 AM
- last edited on
10-20-2024
12:02 PM
by
Content Cleaner
Hello,
I have created a pretty large sequencer engine with LabView and I start by creating a bunch of notifiers, clusters and message queues.
You can see this in the first screenshot. See the topic to see how I've done this :
https://forums.ni.com/t5/LabVIEW/Unmatching-notifier-vs-type-declaration/m-p/3058887
I then tried to re-use these component with Teststand in a separate thread to be able to control the background running thread using notifications and messages.
But where LabView created Refnum's, Teststand expect strings or object references.
See the 5 other screenshots.
Any clue how to make the two match without having to rewrite everything using Teststand's APIes ?
David Koch
Solved! Go to Solution.
12-02-2014 09:31 AM
Next screenshots...
12-02-2014 10:17 AM
Well, that is really a difficult situation.
The most obvious solution is to use LV VIs called by TS to interact with the notifiers. Make sure that these VIs run in the same application instance as your other code, otherwise it won't work.
There is no way that i know of to pick up references from programming languages directly and call functions (e.g. wait on notifier) on that reference. You always require some code modules to do that work.
There could be a very labor intensive way by calling into VI Server using the ActiveX interface, but i doubt that this works gracefully and performant.
I think the fastest solution for such a synchronization (if you really require it) is to rewrite the LV code to call into the TS SyncManager.
Norbert
12-02-2014
10:47 AM
- last edited on
10-20-2024
12:04 PM
by
Content Cleaner
Well, seems to be my fate 😕 See the next screenshot from Teststand's documentation.
I just wanted to control the LabView created engine using messages and notifiers.
It works that way in the LabView sequencer, having clusters to send and receive data.
I found some topics on the issue but that requires to write TS specific LV code :
https://forums.ni.com/t5/NI-TestStand/Invalid-LV-Queue-Ref-in-TestStand/td-p/2780882
https://forums.ni.com/t5/Archive-TKB/LabVIEW-Code-to-Wait-for-a-TestStand-Notifier/ta-p/3502951
...
But I don't want tu use the "Teststand - Get Property.vi" and "Teststand - Set Property.vi"
methodology to achieve my goal, because like I said this is TS specific code to mess
with TS properties.
My view of the problem, at least the way I architectured it, is to have a LabView VI
running in background (own thread) and the only way to interact with it is through
asynchronous messages passing and notifications (à-la Erlang) when the data is
ready.
As the LabView sequencer works but I am commanded to use Teststand, I'd like to
reuse the current components like a blackbox that I control from TS, the steps
being sequenced by the nofiers once the data are read back and compared to
the expected results.
Nothing fancy on the paper.
David Koch
12-03-2014 02:07 AM
David,
i understand correctly if i state: You have an application written in LV which is a test sequencer. As you "are now forced to used TestStand", you are looking into ways how TestStand could "remote control" your existing LV sequencer.
Is that correct?
If so, i have to tell you that this is not the recommended way.
If it is incorrect, please elaborate on the reason why your code modules seem to run extended periods of time and passing parameters to/from TS is not possible in a direct manner.
thanks,
Norbert
12-03-2014 02:17 AM - edited 12-03-2014 02:29 AM
Hello Norbert_B and thanks for your patience.
History : a LV sequencer was once written, I had to unmess the thing and rewrite it (almost) from scratch yet in a modular way
Architecture : new LV sequencer call a new instrument interface using message queue and notifiers, both are now pretty distinct
Requested : replace the newly rewritten yet 'limited' LV sequencer with TS, keeping only the new instrument interface as legacy
Question : how to run the LV instrument interface in the background and use TS to send/receive messages/notifications from it ?
Philosophy : now that the LV sequencer is better architectured, I would be able to (more or less) enhance it with TS features
Problem : I've spent so much time ensuring the new sequencer to be almost perfect and maintenable, I not played enough with TS
David Koch
12-03-2014 02:46 AM
David,
proposed approach:
Constraint:
Norbert
12-03-2014 03:29 AM - edited 12-03-2014 03:55 AM
OK, that's the approach I had in mind this morning, create a 'thin' wrapper
around TS and LV message queues/notifiers, using the same initialisation
from the new LV sequencer, but just doing process communication.
Thanks for your confirmation, that would limit the pain, since TS cannot
communicate with LV's messages/notifiers directly/natively 😕
David Koch
12-09-2014 07:05 AM
I've found that I'm not alone to encounter the same issue :
2004 : http://forums.ni.com/t5/NI-TestStand/how-to-use-property-object-with-dequeue/m-p/16321
2008 : http://lavag.org/topic/3436-queuesdata-exchange-between-teststand-and-labview/
David Koch
12-12-2014 09:28 AM
OK Norbert_B,
I created a little wrapper, but I cannot get in to run and work with TestStand.
Here's the files :
1- TCS_main_2.0.1.seq : the Teststand 2013 sequence
2- TCS_teststand_2.0.0.vi : the wrapper
3- TCS_instruments_2.0.0.vi : the IO interface
So I'd like to enqueue/dequeue and send/receive notifications from withing
Teststand transparently, dialing the wrapper that should perform all the
protocol/frame conversion stuff in the background (separated thread)
Actually the wrapper seems no even to start because the debug dialog
boxes doesn't show up when needed.
Any advices ?
David Koch