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: 

Set FileGlobal Variable During SequenceFileLoad

Solved!
Go to solution

Hello Community,

 

Using Teststand 2014 32bit

 

I am doing a Batch Model Test and I want to edit the NumTestSockets in the ModelOptions Sequence when the sequence file is loaded. I created a fileglobals variable and set the default value to 1. I tried editing the fileglobals variable in the sequence SequenceFileLoad, but it does not show my fileglobals variable as updated and remains as 1 when I run my sequencefile.

 

How can I go about altering a fileglobal variable when I load my sequence file and have it stick, so when I run my sequence file the NumTestSockets is updated?

 

Download All
0 Kudos
Message 1 of 4
(3,803 Views)

Hi,

 

I'm just wondering, is the ModelOptions sequence a sequence file callback in the client sequence?

(If it's in the process model then the FileGlobal in the client sequence won't be visible...)

 

Charlie Rodway | Principal Software Engineer | Certified TestStand Architect (CTA)

Computer Controlled Solutions Ltd | NI Silver Alliance Partner | GDevCon#1 Sponsor

0 Kudos
Message 2 of 4
(3,792 Views)

Charlie,

 

The ModelOptions sequence is a sequence file callback and is a Model Callback Type.

Is there another way to go about changing the NumTestSockets parameter one time? I don't want the user to be prompted with a message everytime the sequence file runs asking how many controls in the batch are being tested. Was hoping for the user to specify it once at load time and not have to change it, unless the user reloads the sequence file again. I can probably do it from the GUI, but was hoping it could be done in the sequence file.

0 Kudos
Message 3 of 4
(3,787 Views)
Solution
Accepted by topic author MechUnit

FileGlobal variable values do not persist across executions. That is why your "NumberOfControls" variable is reset to its default value of 1 after the SequenceFileLoad callback is done executing. A Station Global Variable would persist since its saved to disk in StationGloabls.ini, but it would be available to the entire station rather than just your client sequence file.

 

Perhaps a better way would be to set the default value in your SequenceFileLoad callback:

 

RunState.SequenceFile.Data.FileGlobalDefaults.NumberOfControls = 3

 

Hope this helps,

Trent

https://www.linkedin.com/in/trentweaver
Message 4 of 4
(3,762 Views)