NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

TestStand StationGlobals not updated (randomly)

I have recently added some statements to assign some values into a StationGlobal variable so that other TestStand sequences in the same computer can share the values. However i noticed that the variables are not updated after the seq has run for a while & I am not sure what is going on behind the scene in TestStand because we are using an Operator Interface most of the time.

 

Example:

Sequence A complete test for 1 unit and will store the timestamp of that unit into StationGlobals.Time

Sequence B will verify the current time against the StationGlobals.Time, to see if the difference in value is too large.

Test will fail in sequence B if the value is above certain threshold, eg more than 8 hours later.

 

However the problem i face is that after running Seq B for a few hours, the value in StationGlobals.Time will stop updating & the comparison is not valid anymore. 

 

I have deployed this method of comparison to several machines & the occurrence of the StationGlobals not updating happens randomly to most of my machines. 

 

0 Kudos
Message 1 of 4
(2,283 Views)

Is SeqA the only thing that is writing the StationGlobal?  If so is there a chance it could skip the step that writes it (e.g. a failure, termination or some other condition)?  Do you have something that is resetting the StationGlobal?  Could that be getting called inadvertently?

 

In general StationGlobals should be treated like a write-once-read-many variable.  Personally, I try to avoid them where possible because of race conditions like this.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 4
(2,228 Views)

Hi JIGG, 

Both seq A and B will read and write to the Station Globals. So far, there is nothing that is skipped or overwriting the values. It is just not being updated at random occasions & once it happens, it will be like this until i restart the program. 

 

Can you help explain the issue on the race issue that you mention?

 

Thank you 

Jonathan 

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

Hi Jonathan,

 

do you still have this issue? I found out for the sequences I write it helps to put the statement Runstate.Engine.CommitGlobalsToDisk(False) after assigning the new values to the StationGlobals variable to ensure that the sequence does really update the value of the variable. I saw the same issue you mentioned, that somewhat randomly StationGlobals were not updated for no apparent reason.

Not sure if you were already aware of the function to save the StationGlobals.

 

Best regards,

Alex

0 Kudos
Message 4 of 4
(1,590 Views)