NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Switch-Parameters with Pre-Expressions in Teststand

Hello,
I´m using Teststand 3.1, Labview, 7.1 & NISE
i tried something like this:

1.) In Teststand I created global Variables in the StationGlobals (these are: SwitchEnabled, Multiconnect, OperationOrder, ConnectionLifetime, Switchoperation, WaitForDebounce, RoutesToConnect, RoutesToDisconnect)

2.) Then i created a Labview-VI with those Variables as an Input-Parameter. When executing the teststep in Teststand then i can set the Variables in the StaionGlobals to a new value. (The Vi uses the "Teststand_SetPropertyValue.vi")

3.) Then in Teststand in the main-action which should be switched i opened the Pre-Expression and entered there for all variables i have in the StationGlobals:
Step.TS.SwitchEnabled = StationGlobals.GlobSwitchParms.SwitchEnabled
Step.TS.VirtualDeviceName = StationGlobals.GlobSwitchParms.VirtualDeviceName
Step.TS.SwitchOperation = StationGlobals.GlobSwitchParms.SwitchOperation
.
.

==> I thought that the action now switches the settings which i entered in the action before. But it seems like the Switching woul happen BEFORE the pre-Expressions are executed.

Is there a way to do it like i thought or is this all bu..sh..?

Thanks for your help.

--
This MSG is postet to the Teststand & NISE Forum.
0 Kudos
Message 1 of 5
(4,121 Views)
Panastra -
Your results are correct, TestStand performs the switching first for a step and then executes the step, which includes the pre-expression. You mention that you have a "step" that sets the Station Global variables using a LabVIEW VI and then a "step" uses these in its preexpression. Are these the same step or two different steps?

You may not know this but the TestStand expression language in 3.1 has some new switching functions, such as, SwitchConnect, SwitchDisconnect and SwitchFindRoute. These could be used in any expression that TestStand evaluates. Also, if you passed a sequence context to LabVIEW VI, you could evaluate an literal expression in LabVIEW against the context and the expression can have switching function in it. The switching functions would operate within TestStand.
Scott Richardson
Message 2 of 5
(4,109 Views)
These are two different teststeps.
The idea was, that i set ONCE the pre-expressions of the step_2 and then i never have to get in this step_2 again. Step_2 could be for example "SetPowerSupply". I could use this ready-configured powersupply-step_2 everywhere and all i have to do is to set the switch-action in the other step_1 which writes them to the globals.

I wanted to to it this way over the pre-expressions because you can´t set all switch-parameters from variables. Only 3 parameters can be set by a variable. (for example you cant set "WaitForDebounce" only for example RouteToConnect.)

If i use the new switching functions (SwitchConnect) in an expression or in Labview (there a new Switch-VIs), is this then the SAME like setting the switching-action in the property of the teststep?

Thanks for your help
0 Kudos
Message 3 of 5
(4,105 Views)
Panastra -
Once a process uses a virtual device, that device cannot be used by another process. So, if you perform switching using the LabVIEW VIs, all switching operations occur in the LabVIEW process and TestStand would not be able to use the virtual device until it is released.

The switching expressions are identical to the functions on each step except that you call them exactly when you want. The connect has the same lifetime options and the wait for debounce is a parameter so it can be passed the value of a variable.

I would use the expression functions if you must use a variable for debounce.
Scott Richardson
0 Kudos
Message 4 of 5
(4,091 Views)
Hello Scott ,
thanks for your answer.
The problem when using the switching-vis in labview with parameters from teststand is, that i dont have the predefined list of possible "Groups". When i switch in Teststand then i can see this list which ic have defined in SwitchExecutive.
0 Kudos
Message 5 of 5
(4,084 Views)