NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

stationglobals

I'm trying to us the StationGlobals.ini within the C:\Program Files\National Instruments\TestStand 3.5\Cfg directory.   I want to place additional information in there such as the path and file name of where the application will look for the user's most recent calibration information, the ID of this particular test station (not the UUT id), etc.  Anyway, my two questions are (1) Is there a LabVIEW VI that provides a way to read what is currently in the StationGlobals.ini (i.e. the defaults).  (2) I'm not sure of the exact syntax/protocol mandated by the StationGlobals.ini file, but I want to add some of the information mentioned above - how do I go about doing that.  (3) I guess if I figure out 1 & 2, I'll know how to read the new data I place in there.  Thanks.
0 Kudos
Message 1 of 21
(4,954 Views)

You should not modify the   StationGlobals.ini   with e.g. a text editor.

The recommended methods of reading, writing and creating properties are available in the TestStand API. Look e.g. at the NI example code  "Modify Sequence Files". (This example code requires some modification to match your need. But it demonstrates the usage of the API.)

BR, Guenter

0 Kudos
Message 2 of 21
(4,956 Views)
Have you noticed the TestStand palette that you have in LabVIEW? The very first one (in my version anyway) is TestStand - Get Property Value. Provide the name of the station global (i.e. StationGlobals.CurrentUser.LoginName) and the value of that is returned. Use Set Property Value to write. This is the correct way to use the TestStand API in LabVIEW. Look at the example called AccessingPropertiesAndVariables.seq. One of the steps sets a local variable and setting a station global is exactly the same process.
0 Kudos
Message 3 of 21
(4,957 Views)

I'm not having very good luck here.  I added a Global to my StationGlobals using TestStand.  It's a string entitled WorkCenter.  Within LabVIEW (ver 8).  I dropped down a Get Property Value VI from the TestStand Pallete.  What I want to do is read the WorkCenter value from the StationGlobals.ini and populate my WorkCenter string control.  What I'm having trouble with is setting the proper parameters for Get  Property Value (GPV for short).  I created a Property Node for the WorkCenter string control (with Text.Text selected) and changed it to a write and connected the Value output of GPV to it.  What I just can't figure out is how to set the GPV's Sequence Context In and Lookup String.  For the Lookup String I right-clicked and created a constant and entered "StationGlobals.WorkCenter" as a guess.  For the Sequence Context In, I tried Create::Property::StationGlobals.  This creates a SequenceContext, but I don't know what to do with it.  StationGlobals property.  I've attached the VI for reference.

0 Kudos
Message 4 of 21
(4,933 Views)

I think you are making this much harder than it should be. I can't open your Vi because I don't have 8.0 so I've included a sequence and VI that I wrote. If you set a breakpoint and step into the VI and then run it, the indicator on the front panel will show the contents of the station global. It took me about 5 minutes to write the whole thing.

You might want to read the chapter on using LabVIEW with TestStand again. Your sequence context control should be wired to the VI's connector pane and when you specify the module in TestStand, the sequence context should be pointed to TestStand's "ThisContext". If you use TestStand to create your VIs, a lot of the work will be done for you. I hope you're not trying to run the VI outside of TestStand. That wouldn't make any sense. Look at the shipping example I mentioned.

Download All
Message 5 of 21
(4,931 Views)
Hi,
 
I have attached a VI (LV8)  which will read subproperties of the container WorkCenter.
 
Hope this helps
 
Regards
Ray Farmer
 
Regards
Ray Farmer
0 Kudos
Message 6 of 21
(4,923 Views)
That works great.  I have a couple of questions.  I'm not sure how the sequence context knows where my StationGlobals.ini file is located.  There must be a default directory where it looks.  I'm assuming that my distribution kit will have to place the StationGlobals.ini on the target in the default location.  The Sequence Context is a control, correct?  Why can't I open its front panel like I can with the Test Data control?  Speaking of the Test Data you placed on the block diagram, what purpose does it serve in this VI, and in general, how would I use it (do you have any example?).
0 Kudos
Message 7 of 21
(4,911 Views)
hi,
 
The control is a strict type and you can open the front panel by right clicking on the control and selecting Open Type Def. I would not advice changing this control, as it would affect every VI that uses this control.
 
The StationGlobals.ini is usually in the folder TestStand\cfg\. But what you are accessing is the memory version loaded when you start the TestStand engine. When you close the engine the contains of the StationGlobals is saved out to the ini file. You can call a method to save out to the file during runtime,

Engine.CommitGlobalsToDisk ( promptOnSaveConflicts = True)

 
I think if you have  variables already setup in the StationGlobals.ini file, you will need to include the file as part of the deployment kit in the deployment tool. Otherwise if it doesn't exist when you start the teststand engine, a new file will be created with default variables. Or you could run a SequenceFile to setup your StationGlobals after you have done your installation on the target system.
 
The Test Data control is a legacy control and only needed for TestStand 2.0.x. You dont need it for TestStand 3.x.
 
If you want examples, just look at the examples in the TestStand examples folder eg C:\TestStand\Examples\Demo\LabVIEW\Computer Motherboard Test
 
Regards
Ray Farmer
Regards
Ray Farmer
0 Kudos
Message 8 of 21
(4,910 Views)

Just wondering a couple of things. I found the Sequence Context in the TestStand::Legacy pallette.  When I see 'Legacy' I think "soon to be deprecated".  Am I supposed to get it from the Application Control (AC) palette instead.  Also, when I get the one from the TestStand palette, it looks different than the one from AC palette - this one has a 'property' at the bottom that can be changed from 'Select Class'.  Finally, why/when would I use the StationGlobals property vs just using the TestStand::Get Property Value VI and using its Lookup string input and specifying "StationGlobals.WorkCenter".

0 Kudos
Message 9 of 21
(4,887 Views)

Hi,

While there is TestStand 2.0.x about, you will have the legacy. But the SequenceContext is still one of the inputs that you would want to pass to your code.

The different between the TestStand palette and the application control palette, the reference controls have been pre selected for TestStand, where as the AC palette are generic, so you would have to select class. You would still have to do this if its anything other than the SequenceContext as this is the only one supplied in the TestStand palette.

For the Get Property, One has the reference of the SequenceContext and therefore you would have to use the lookup string of "StationGlobal.<someproperty>". The only has the reference of the StationGlobals, therefore only the name of the property is required.

Basicaly this applies to any property, the lookup string you use will be based on want you are referenced to.

Hope this helps

Regards

Ray Farmer

Regards
Ray Farmer
0 Kudos
Message 10 of 21
(4,884 Views)