NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

StationGlobals across multiple clients

I have a StationGlobals variable that is being set from the Configuration entry point.  However, there are four instances of the client with this menu-based configuration point.  When I change the value in one of the clients, I get a prompt whether or not I want to change the StationGlobals.ini.  If I choose to overwrite the StationGlobals.ini, the  logic based on the change in the StationGlobals value gets executed in the client whose menu was used to set the StationGlobals value.  However, it does not get changed in the other 3 clients at run-time.  I understand that one of the options may be to re-load the StationGlobals, so that when the next DUT gets executed, all of changes are captured in the other 3 clients, too.  However, I do not want to use this option as it could affect other StationGlobal variables whose values may be needed after having been modified during the test of a previous unit.

Please advise.

0 Kudos
Message 1 of 15
(4,156 Views)

Don't use station globals.

 

I would recommend having your configuration entry point write data to PropertyObject files using the Write() command and then read the values back using the ReadEx() command. Look at the help for more info on those two functions.

CTA, CLA, MTFBWY
Message 2 of 15
(4,154 Views)

Thanks for the hint!  I looked at the help and the Reference manual, but it is very thin on examples.  If you have an example, can you please point me to it?

0 Kudos
Message 3 of 15
(4,145 Views)

Locals.EquipmentList.Write((RunState.SequenceFile.Path + "\\..\\EquipmentList.txt"), "Locals.EquipmentList", 0x0 | 0x4)

Locals.EquipmentList.ReadEx((RunState.SequenceFile.Path + "\\..\\EquipmentList.txt"), "Locals.EquipmentList", 1, ConflictHandler_Error)

CTA, CLA, MTFBWY
0 Kudos
Message 4 of 15
(4,144 Views)

What type should I declare this variable as? This solution will require extensive rewrite for my code and additional testing.  I am under pressure to release code.

 As I am under time constraint, I am wondering if there is any way to access the StationGlobals across mutliple clients without relaunching the program.  The 4 clients are running on 1 PC.

0 Kudos
Message 5 of 15
(4,141 Views)

You can call Write() and ReadEx() on ANY variable. If you don't want to rewrite a whole lot then just call those on your station globals. The point is that you can save any variable to a file and then recall that information whenever you want.

CTA, CLA, MTFBWY
0 Kudos
Message 6 of 15
(4,141 Views)

Thanks for your feedback.  I am assuming that this can be used to read from the StationGlobals.ini file. Please confirm.

I am assuming that in my case, the solution would look like this :

StationGlobals.CalTime. Write ( RunState.StationGlobals.Path + "StationGlobals.ini"), "StationGlobals.CalTime", "9:00")

StationGlobals.CalTime.ReadEx ( RunState.StationGlobals.Path + "StationGlobals.ini"), "StationGlobals.CalTime","9:00")

Please advise. 

0 Kudos
Message 7 of 15
(4,137 Views)

No, these are independent text files that you will read/write from. Do not use this to read/write from stationglobals.ini.

CTA, CLA, MTFBWY
0 Kudos
Message 8 of 15
(4,135 Views)

Thanks.  This creates the problem of having StationGlobal variables in StationGlobals.ini and temporary files.  When the Configuration entry point is executed, instead of committing the StationGlobals to disk, they would have to be written to this temporary file and then, for each client, before the next UUT is executed they would have to be read from the file.  Yes, this solution may work. It seems that Teststand does not provide a good way for StationGlobals to be shared across multiple clients. 

0 Kudos
Message 9 of 15
(4,132 Views)

I guess I could change the StationGlobals variable to a local variable to avoid this problem.

0 Kudos
Message 10 of 15
(4,129 Views)