NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Passing TestStand Globals to LabView parameters

Hello All,
        We store our operator entered test info in TestStand Globals, and then pass them to LabView parameters.  Is there a way to default the Labview parameters to always have the TestStand Global name?  So we won't have to select those same globals for each test.  Thanks.
0 Kudos
Message 1 of 6
(3,825 Views)
Hey Bill,
 
Not sure what you mean.  So basically there are 3 types of variables in TestStand- Local, FileGlobals and StationGlobals.  I assume you are talking about StationGlobals?  Is this correct?  If I understand you correctly here would be the scenario:
 
1- Operator starts execution and is asked for test information that gets stored in StationGlobals?
2- These StationGlobals are then passed to a LabVIEW step as parameters?
 
If this is the case then the parameters are defined in the step module and should be the same StationGlobals every execution.  Granted the data will change because the operator will enter different info each execution.
 
Or are you talking about when you are developing a sequence you insert a LabVIEW step and you want it to default to have certain parameter information that uses the StationGlobals?
 
If you can clarify some of these I'd be able to help you out a lot more. 
 
Thanks,
jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 6
(3,817 Views)

Hi jigg,

Your right about all - Station Globals and Steps 1. & 2.  And I'm talking about your 2nd option -

 (Or are you talking about when you are developing a sequence you insert a LabVIEW step and you want it to default to have certain parameter information that uses the StationGlobals?).

But the first option sounds interesting, except I don't know what it means.  Thanks in advance for your advice.

0 Kudos
Message 3 of 6
(3,814 Views)

Hey Bill,

Thanks for clarifying.  The first option really isn't an option.  It's more of an explanation that the steps should always use the StationGlobals as parameters if when you Specify the Module you set the parameters as StationGlobals.WhateverVariable. 

It's important to note the 4 actions of creating a step-

1- Choose the Adapter (LabVIEW, CVI, C++ etc...)
2- Choose the StepType (PassFail, Action, Numeric Test, String Test etc...)
3- Specify the Module (point the step to the code you want to call)
4- Set the step properties (preconditions, post action, expressions, run options etc...)

In your case you would choose the LabVIEW adapter, Choose the StepType, Specify the Module to point to some LabVIEW code (I'm assuming these are prewritten), and then set some step properties.  Now the issue here is that you want TestStand to automatically assume that you want to pass StationGlobals as parameters to your step.  This is done in step 3 of the process.  However, TestStand cannot assume what to put as the parameters to a LabVIEW module because most LabVIEW modules have different inputs and outputs.  Do all your LabVIEW modules have the same inputs and outputs? 

Option1- If you have TestStand 4.0 or later then you can use Templates.  I really like this new feature of TestStand.  It's very handy because all you do is follow the process to creating a step and then drag that step to your templates window.  Then whenever you want to place a step with the same or very similar setup just drag it from your templates onto your sequence.  This way you don't have to go through the entire process every time.  And the parameters will remain the same.

Option 2- So for the 4 Test StepTypes (Pass/Fail, Numeric Limit, Multiple Numeric Limit and String Value) and the Action step there are something called Code Templates.  A code template is simply a skeleton piece of code that gets created when you click the create VI button in your specify module tab.  This is not new in TS 4.0 but an older feature as well.  These templates are stored here: C:\Program Files\National Instruments\TestStand 4.0\CodeTemplates\NI and are managed by the StepType properties.  I recommend copying them to your C:\Program Files\National Instruments\TestStand 4.0\CodeTemplates\User folder before editing them.  As this is the proper way to do it and you don't lose your default templates.  TS will always look in the User folder first.  If it's not there then it will go to the NI folder.  The names of the folder are pretty intuitive.  Basically you have DefaultLabVIEW.  Which is for the Action Step Type.  Or you have NumericLimitLabVIEW which is for the Numeric Limit Step Type.  Whichever type you want to change the template for then you open that folder and edit the LabVIEW skeleton code to resemble what you want with the correct inputs and outputs.  Then you save it and go into TS and go to your type palette.  No the problem I have here is that you cannot change the parameters for the default NI step types.  So you will have to copy the StepTypes and create your own.  Trust me though- you don't want to dink around with the NI defaults.  It's messier later.  So when you create your own step type you can then edit the properties by Right Click-> Edit Properties.  There should be a Code Template tab.  you can set up everything including the parameters for that code template.  So then the next time you insert a step and click the create VI button from the Specify Module tab it will automatically contain your own parameters.  In your case StationGlobals. 

Ok so it's obvious that Option 2 is not ideal.  But if you have TS 3.5 or older then it's the only way other than copying and pasting steps.  If you want more info on Code Templates go to the TS help and read about them.  Or let me know if you have specific questions.

Hopefully this info will help you out and please let me know if you are confused or need more info.

Best Regards,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 4 of 6
(3,808 Views)
Thanks for the detailed answer.  I'll give Option 1 a try. 
0 Kudos
Message 5 of 6
(3,805 Views)

Hi,

an other option would be to generate some custom step type, then you can pre define you arguments to your VI as part of your Step Type.

Regards

Ray Farmer

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