NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to use LabView's created notifiers in Teststand ?

Solved!
Go to solution

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 :

 

http://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

0 Kudos
Message 1 of 17
(6,548 Views)
0 Kudos
Message 2 of 17
(6,547 Views)

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

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 3 of 17
(6,537 Views)

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 :

 

http://forums.ni.com/t5/NI-TestStand/Invalid-LV-Queue-Ref-in-TestStand/td-p/2780882

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

http://www.ni.com/example/30111/en/

http://www.ni.com/example/31138/en/

...

 

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

 

0 Kudos
Message 4 of 17
(6,532 Views)

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

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 5 of 17
(6,512 Views)

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

0 Kudos
Message 6 of 17
(6,510 Views)

David,

 

proposed approach:

  • Start your instrument interface in a parallel thread (e.g. by using "Sequence Call 'New Thread'" in the Setup step group)
  • Communicate in your Main step group with the instrument interface by using LV modules which pick up the queues/notifiers

 

Constraint:

  • You might require a wrapper to have that parallel thread running continuously essentially waiting for communication

 

Norbert

Norbert
----------------------------------------------------------------------------------------------------
CEO: What exactly is stopping us from doing this?
Expert: Geometry
Marketing Manager: Just ignore it.
0 Kudos
Message 7 of 17
(6,495 Views)

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

0 Kudos
Message 8 of 17
(6,491 Views)
0 Kudos
Message 9 of 17
(6,426 Views)

OK ,

 

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

0 Kudos
Message 10 of 17
(6,340 Views)