NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

TS Variables - read/write

I setup some variables in the StationGlobals.ini, which I could then see in my sequence file under Variables::StationGlobals, etc.  What I ran into at runtime, however, was that the StationGlobals.ini file had to be read/write.  I'm not sure that's a good idea, since I have so many read-only things being read from there, and if it were messed up during a write, I'm not sure how the operators in the field would recover . 
 
If I want a variable to have scope throughout the life of the sequence file, such that (1) Setup/Main/Cleanup can see it (2) I can read/write from/to it (3) I don't have to leave my .seq file unprotected (remove the read-only attribute), what do you recommend? 
0 Kudos
Message 1 of 6
(3,540 Views)

Hi MrBean.

To avoid lot of file access I would try overwriting the Pre- and PostUutLoop Callbacks. In the Pre.. copy your stuff from StationGlobals to SequnceFileGlobals, now you have read and write access without using a file on drive. In the Post.. do it reverse to save your variables on drive. In your SequnceModel these steps are only called once when starting a uut-test.

Just try it

Hope that helps

greetings

juergen  

 

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 2 of 6
(3,538 Views)

Juergen,

I think you must mean ProcessSetup and ProcessCleanup callback sequences.

The Pre and PostUUTLoop callbacks get called for each UUT when you execute Test UUT's and never if you use Single Pass.

Regards

Ray

Regards
Ray Farmer
0 Kudos
Message 3 of 6
(3,534 Views)

Hi Ray,

Your are absolutly right. My stuff is only working in Uut mode. So it is better to Process.. Callbacks

Thanks

juergen   

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 4 of 6
(3,532 Views)
The ProcessSetup/Cleanup idea is good.  I think most of my confusion is in knowing when/if I can write to StationGlobals or SequnceFileGlobals.  I thought that (to perform a write) both of these require the file to have the read-only permission turned off.
0 Kudos
Message 5 of 6
(3,522 Views)

Hi,

If you are writing to the StationGlobals, you will need the file attributes as read/write. The StationGlobals file only gets updated when TestStand shuts down or when if you force a Save Station Globals using the API function.

With the FileGlobals, usually you are changing the Runtime version and therefore you are not changing your Sequence Files. If you are changing the static version of the FileGlobals (DefaultSequenceFileGlobals), then obviously, you will have to have the sequence file with file attribute of read/write.

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 6 of 6
(3,516 Views)