01-31-2012 11:11 AM
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.
01-31-2012 11:27 AM
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.
01-31-2012 01:43 PM
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?
01-31-2012 01:53 PM - edited 01-31-2012 01:54 PM
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)
01-31-2012 01:58 PM
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.
01-31-2012 02:00 PM
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.
01-31-2012 03:00 PM
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.
01-31-2012 03:03 PM
No, these are independent text files that you will read/write from. Do not use this to read/write from stationglobals.ini.
01-31-2012 03:10 PM
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.
01-31-2012 03:11 PM
I guess I could change the StationGlobals variable to a local variable to avoid this problem.