NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Using queues with Teststand

Hi,
I'm new to  using Teststand,I have created some sequences for my application and since my application involves data transfer from one sequence to another,I'm thinking of handling it through Queues (presently i'm using StationGlobals for it).Is there any guide or sample programs for  using Queuesin Teststand so that i can handle my data transfer efficiently and one more question is since my application requires execution of Multiple sequences parallely,i'm using  a "SetThread Priority(15)" and running both the sequences by calling Wait function.Is there any alternate way of handling this efficiently.A suggestion for this also will be helpful....

Cheers
Murali
0 Kudos
Message 1 of 4
(3,311 Views)

Hi Murali,

There are many synchronization examples here:

<TestStand>\Examples\Synchronization\

For example, one is called QueueDemo.

As for your question about Thread Priorities- you should use the thread priority set to 15 to indicate a time critical application.  I'm not really sure what your use case is.  If you simply want to run two sequences in parallel, you can call them using the Sequence Call Step Type, and choosing to run them in a new thread.

 

Allen P.

NI

0 Kudos
Message 2 of 4
(3,290 Views)
Hi,
Thanx for reply....The "Queuedemo" example proved a goodstartpoint but one clarification which i require is, if i have multiple Sequences running simultaneously under different threads(i had selected "Run sequence in New Thread" for each sequence)how do i handle the datahandshake between sequences....say for example in my application I'm using LV with TestStand and for updating certain variables between 2 different sequences i'm presently using stationglobals.My doubt is, if use queues i may start by creating a queue in one sequence and carry on by enqueueing the element required in the same sequence,but how can i dequeue it another sequence (the same way as what i do with StationGlobals).A suggestion for this will be really helpful as i can avoid the use of Stationglobals)

Cheers
Murali
0 Kudos
Message 3 of 4
(3,277 Views)
The queues are accessed by name.  So if you have two threads, simply create a queue in each thread.  It will obtain a queue reference based on the name.  If you wish to share a queue between several processes (for example if you have several instances of the sequence editor open, or several operator interfaces), you can prefix each queue name with "*".  An example is naming a queue "*myqueue".  It is also possible to share a queue between multiple computers.  You will have to enable permissions through DCOM to allow this, but if you name a queue with the computer name, it will be shared between machines.  An example of this is "\\mycomputer\myqueue".
 
There is no problem with creating the same queue in multiple sequences.  If it has already been created, the step will just obtain a reference to the queue that has already been created.
 
Allen P.
NI
0 Kudos
Message 4 of 4
(3,268 Views)