NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Sharing data across TestStand sequences

I'm trying to share data between my customized batch model and test sequences and I'd like some advise as to the best way of doing it. 

 

What I have is a customized prebatch sequence where I gather information about the test units and I want that available when I'm running the test sequence.  Out of the box, the only thing collected is the serial number so I've made modifications to collect information such as the part number and revision.  Some of that information is needed in my actual test sequences though, and I haven't found a good way to share it.

 

In the past I've used a StationGlobals array to do this, and that's worked fine, but is there an better way?  Is there a method to share a FileGlobal between the sequences?  I've tried creating a common one in both sequences and played with the flags (Shared, Propagate etc.) but that didn't work.  I saw Ray Farmer's link describing how to propagate data with a local variable, but I wasn't sure if that was still a recommended method.

 

I'm using TestStand 2010.

 

Any information would be appreciated.

John Morrissey

0 Kudos
Message 1 of 18
(8,674 Views)

Hi,

 

I wouldn't use the Propagate method when using the Batch model, especially from your ProcessModel to your test sequence.

 

I would use the FileGlobals and set the SequenceFile Properties to use a common FileGlobals.

 

Or stick with your StationGlobals but you probably would need to use a Lock if your Test Sequences write to the Station Globals.

 

Or You might look at using a Queue to pass data around.

 

 

Regards
Ray Farmer
Message 2 of 18
(8,668 Views)

We are using Locals Propagation to share common data between sequences. It works for subsequences called from top level sequence only. Subsequences do not have these locals defined at all and aquire them at runtime. This method has smaller scope then station globals, variables are isolated in execution. Ease of use is the same as for station global. Cons of the method is it's runtime nature. But you can always define these locals in subsequences and set them to "allow propagation from caller", in this case you'll have control of correctness of names.

Other method is to pass data to subsequences as parameters.

Message 3 of 18
(8,659 Views)

Hi Ray,

Thanks for the quick response. 

 

I think I will try your recommended option (B - FileGlobals) since it makes sense.  I thought that setting would only share the FileGlobals across the Batch executions.  Does it also share them from "above" (e.g. the process model)?  I will give that a shot to see how it works.

 

Also, I'm only reading from the variables in the test sequences, so I'm not too worried about conflicts below the process model level.

Thanks again,

John

0 Kudos
Message 4 of 18
(8,659 Views)

Hi Sergey,

Thanks for sharing your experiences here. 

 

I started down this path initially, but never got it to work.  I will give it another try since I probably had a setting wrong in the flags window.

John

0 Kudos
Message 5 of 18
(8,651 Views)

Ray,

Is there something else I need to do other than setting "Sequence File Globals:" to "All Executions Share the Same File Globals"?  I tried that and still don't see data propagated from the process model sequences.

John

0 Kudos
Message 6 of 18
(8,648 Views)

"All Executions Share the Same File Globals" means that all executions will share the same global VALUES for the globals in that file. It does not copy or propagate globals from one file to another.

 

When you run a sequence file with the batch model, the model creates an execution for each test socket. Each execution runs your file.

 

If this option is off, then your file will have separate global values for each socket. If the option is on, then your file global values are shared by all sockets and each socket can see changes to your file globals made from the execution of any other socket.

Message 7 of 18
(8,637 Views)

I'm (flailing away) using a subsequence call and parameters, kind of as Sergey suggested and it's mostly working as I expect.  It's been years since I architected at this level, so I wasn't sure if there was a another (better) way to do it.   Sounds like this is the right avenue to transfer the appropriate data to the correct socket.

0 Kudos
Message 8 of 18
(8,635 Views)

Hi,

 

I have given you some duff information with the FileGobals. I think you said you wanted to pass information from your Process Model to your Client Sequence File test sequence. If that is the case then sharing the FileGlobals only works for the Client Sequence Files running in a Batch or Parallel execution and that its only the Test SequenceFile that are sharing the FileGlobals.

 

When the Process Models launches the MainSequences with shared FileGlobals set in the SequenceFile, a common defaultFileGlobals is used for all executions of the Client SequenceFile but its not the FileGlobals of the Process Model Sequence File. This is still separate. So you will not beable to use the FileGlobals.

 

With Propagating the Locals, make sure you propagate from the correct Sequence that calls the MainSequence of the Client SequenceFile. So in the Batch Process Model it's the Test UUTs - Test Socket Entry Point sequence that calls the MainSequence of the Client SequenceFile not the Test UUTs sequence.

 

 

 

 

Regards
Ray Farmer
Message 9 of 18
(8,610 Views)

I am trying to implement this, but I am apparently missing something.  I have gone to the "Test UUTs - Test Socket Entry", turned on the flag: "Propagate to Subsequence" on the local container UUT.  I put a BreakPoint at the MainSequence Callback, and the flags are not set when run.  I can set them on the variable at this point, and it propogates to the MainSequence in my client file. 

 

What am I missing, to have it propogate?

0 Kudos
Message 10 of 18
(8,146 Views)