From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

StationGlobals for cumunicate threads

Solved!
Go to solution

Hello,


Is this the best way??


When I have to catch the control of many instruments to do a test.

I create a NEW thread for instrument (This sequence is a state machine.... StationGlobal.Enable for activate the instruction).


In the mainsequence when i have to use an instrument -->StationGlobal.Enable = True ,.... and now i have to wait to the end of the instruction.

 

To do this, I use in my mainsequence a WHILE StationGlobal.Enable = True ....  Wait........... Is this the best way to syncronize my sequences ????

 

Thxs !

0 Kudos
Message 1 of 8
(3,746 Views)

I would recommend taking a look at the Synchronization examples in TestStand.

 

C:\Documents and Settings\All Users\Documents\National Instruments\TestStand 2010\Examples\Synchronization

CTA, CLA, MTFBWY
Message 2 of 8
(3,736 Views)

The TestStand queue and/or notification steps types would probably be a better way to do this.

 

-Doug

Message 3 of 8
(3,734 Views)

Many thxs for the answers !

 

I used the same system with labview. Only one aplication (Exe) with one event machine, and 1 state machine for each instrument.. The control of state machines is by queues.

In teststand i think that is the best way,.... But now i have the control of instruments in diferents threads... And i need know when 1 instrument ended his instruction to continue with the main aplication.

Which is the way to say at mainsequence that can continue with next step !

0 Kudos
Message 4 of 8
(3,729 Views)
Solution
Accepted by topic author Oriol.Bofill

Hi,

 

StationGlobals are not the best way to do this.

 

You may use a FIFO, just send from your instrument thread a message in a queue/notifier that the required action has been completed!

 

Regards,

Rodéric L
Certified LabVIEW Architect
Message 5 of 8
(3,711 Views)

Hey ,

 

Result with Queue /Notification is a good way.

 

Now I have a new problem using this !!    The control of threads are a state machines... 1 while with a Dequeue expresion... The value of the queue is the instruction to do in the state machine.... At the end of the while there are a StationGlobal.Stop... If the variable is True now the thread stops.

 

The StationGlobal.Stop changes the value when a user push the stop button in the user interface (LabVIEW) !

 

How can I say at the state machin /Dequeue Thread that exist a stop event???

 

Thxs !

0 Kudos
Message 6 of 8
(3,680 Views)

To do this in dequeue expresion, I've activate the Timeout. Is this the correct way?

0 Kudos
Message 7 of 8
(3,678 Views)

The best way would be to enqueue a stop message (you can use the timeout to check if a variable is set to a particular value too but it's not the best practice (since it works you can use this))

Rodéric L
Certified LabVIEW Architect
0 Kudos
Message 8 of 8
(3,676 Views)