I am working on batch process model, in my sequence I have declare two file path under StationGlobals. Now I am trying to assign parameter name value with expression and getting error.
Define Station global
StationGlobals.Settings.Communication_Protocols.pszIniFile_UUT1 = C:\X\Y\Z1
StationGlobals.Settings.Communication_Protocols.pszIniFile_UUT2 = C:\X\Y\Z2
Expression to call file on run time
Please correct me in this expression.
I believe that your expression should be:
However, I'm wondering if you want TestStand to evaluate the string, so maybe your expressiong should be:
I believe the syntax you are looking for is:
If you don't add quotes around the StationGlobals.Settings.Communication_Protocols.ps
As pulidotech mentioned, if you are trying to get the value associated with the variable, you can use the Evaluate() function.
Hi Pulido Tech
I tried with your solution but getting same error.
If I use "StationGlobals.Settings.Communication_Protocols.pszIniFile_UUT" like this teststand taking it as an string but in my case its variable and I need value inside this variable to call.
Actually I have two variables like Local1 and Local 2, both variable contain the file path. now i am trying to write expression based on my socket like if socket 0 is selected seq select path one and on other side if socket 1 is selcted seq select path 2.
I accidentally forgot some quotes, but use Jason's syntax.
For your follow up question, couldn't you just add an if statement to your sequence? Then, assign the path to the variable in the if and the else sections.
Same vi is runnig on two places at same time. No point to use if condition as i am working with batch process model.
One example attached here. In this I have one step with two path configuration on run time selection based on socket.
I don't understand your last comment. In a batch, the locals are instanced per socket, so you can define your locals however you like in every run.
Based on the sequence you posted, I assume you want something like:
((RunState.TestSockets.MyIndex==0) ? Locals.Local1 : Locals.Local2 ) +str(RunState.TestSockets.MyIndex+1)
In my example if it's socket 0, the result will be Locals.Local1 + str(RunState.TestSockets.MyIndex+1). Otherwise, Local2 is used.