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: 

Threaded VI, Threaded Sequence inter process communication best practice

I'm curious if others have any advice on best practice for the following.

 

We have VIs that run continuously during our test execution sampling 4 different Analog Input boards in continous mode.  For quite awhile these VIs were passed the SequenceContext from the TS side along with the name of FileGlobals.  When the while loops had new samples from the boards it would use the SequenceContext to set them from the VI.  It would also use the SequenceContext to get "signals" from test stand.  That is, I'd set a variable on the TestStand side that would be read in the VI to make it behave differently (filtering, moving average, etc).  I used TS notifiers from the LV side to let TS know new data was available and there are TS rendezvous's used to partially synchronize the 4 seperate boards with each other.

 

We never really had any trouble with this and even though the code wasn't terribly complicated for me, others on the team have had a little trouble comprehending it.

 

Recently, we ran into some issues not related to this code but ultimately in an attempt to solve them I ended up re-writing this code to use functional globals.  Now, the VI uses the FGs to set the data and on the TestStand side the same FGs are used for reading.  Locking of data is handled by the non-rentrant VIs.  The FGs are also structured state machine-like for signaling the VI to do something and letting TS know something has happened.

 

This code seems to work well also and I think my team (and anyone that follows) will be able to follow this code a little bit easier.

 

I'm not classically trained so I suspect there may be standard patterns that work here, I just haven't sought them out.  

 

Is there a better way to do this that I'm not thinking of?  

0 Kudos
Message 1 of 2
(3,129 Views)

Hi SmokeMonster,

 

If things are looking more legible and everything functioning as desired it sounds like the improvements are going to be some of the best for your company. Without more specific information about seeing how information is being passed and handled, and a greater knowledge of the system and desired results, specific recommendations are going to be more difficult.

 

From a higher level overview, the best resources you will find on development practices will be the NI TestStand Materials. A few that may be worth a look specific to your inquiry would be the following:

Using LabVIEW with TestStand

http://digital.ni.com/manuals.nsf/websearch/828A615BAB7CCECA86257A150065C12E

 

TestStand System and Architecture Overview

http://digital.ni.com/manuals.nsf/websearch/49D1BDF3B02279A8862579FB0063EC04

 

TestStand Advanced Architecture Series

http://www.ni.com/white-paper/7022/en

 

Hopefully that gets you some good starting points to refer from.

 

Regards,

 

James W.
Applications Engineer
National Instruments
Message 2 of 2
(3,098 Views)