NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Local and global variables

Solved!
Go to solution

I have been searching on this TestStand discussion forum, online support, and TestStand helps but still cannot find the answers to the following 2 questions:

   1) Can a test step adapter (LabVIEW, or C# dll) write its outputs to the main sequence local variables?  For exercise, I have a LabVIEW VI read and write local variables of the same sequence that the VI is being called.  After the sequence finishes testing one DUT, I stop and inspect the local variables which suppose to have values written into them.  They are zeroes.

 2) I have a sequence file created based on the Batch model.  I modify the Prebatch call back to include a DLL to generate DUT serial numbers and then create a TestStand for loop statement to write them into a FileGlobals variable.  This variable is an array of string, named PCBSerial.  When stepping through the execution of the for loop, I can see this array of string is being filled with serial numbers generated by the DLL.  However, when the PreBatch finishes, the MainSequence is called, the array PCBSerial is cleared to empty strings.  Why?

0 Kudos
Message 1 of 2
(2,294 Views)
Solution
Accepted by topic author Nelson19

The reason they are empty or zero is because the variables are only valid while the sequence is executing. Once the execution has stopped all the variables revert back to the static state. The only variables that will retain their values is StationGlobals.

try storing you data in a file for viewing after your execution or add your data to the test report.

 

Regards
Ray Farmer
0 Kudos
Message 2 of 2
(2,274 Views)