NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Evaluation of entry point expression fails

Hello,

I'm trying to change the Teststand BatchModel of TS 3.5 (Win XP SP2). I want to take the test name from a local variable. So in the menu bar should appear e.g. "Start Functional test" instead of "Test UUTs". So i put in the Entry point name expression field: "Start " + Parameters.sequence.
But it doesn't work, the menu item contains the error message "Could not evaluate expression. Unknown property Parameters.sequence". Parameters.sequence is defined in the model sequence as well as in the client sequence.
Nothing but static values or StationGlobal values work.
Can anybody help?

Regards,
Thomas
0 Kudos
Message 1 of 5
(3,310 Views)
You can use RunState.InitialSelection properties to get information about what is currently selected. Here's an example that looks at the name of the first sequence that's selected:

PropertyExists("RunState.InitialSelection.SelectedSequences[0]") ? "Sequence: " + NameOf(RunState.InitialSelection.SelectedSequences[0]) : "No Sequence Selected"

There are many other properties under RunState.InitialSelection you can use as well.

Hope this helps,
-Doug
0 Kudos
Message 2 of 5
(3,297 Views)
Ah I see what you really want is to access variables in the entry point sequence itself. Not sure if there is any way to do that, but it's a good suggestion that maybe it should be using the data from the entry point sequence itself when evaluating these expressions.

-Doug
0 Kudos
Message 3 of 5
(3,295 Views)
Thanks so far Doug,

the InitialSelection works quite fine. But what in what context is Teststand running, when it evaluates the entry point name? Can i browse it?
How did you find out, that "InitialSelection" exists? The expression browser for the entry point name shows all "normal" properties, but then they don't work.

Regards,
Thomas
0 Kudos
Message 4 of 5
(3,269 Views)
Not everything shown at edit time is exactly how it will be when the expression is evaluated. There are placeholders at edit time for the RunState.InitialSelection items when you look for them in the expression browser dialog box, but what they are populated with at run time will depend on what's selected. For the name and enabled expression it's kind of tricky to see what's available when they are evaluated since they are evaluated outside of an execution. But if you want to see exactly what is available at runtime (which is similiar, but as you discovered, slightly different than what you get with the name expression), the easiest thing to do is set a break point at the begining of your execution entry point sequence, begin an execution using that entry point, and then look in the Variables tab of the execution document to browse the variables to see what actually exists.

As you expected it probably does make sense for the sequence locals and other data to be set when the name and enabled expressions are evaluated. I've recorded this suggestion as something to look at doing in the future.

Hope this helps,
-Doug


Message Edited by dug9000 on 04-09-2008 02:20 PM

Message Edited by dug9000 on 04-09-2008 02:21 PM

Message Edited by dug9000 on 04-09-2008 02:23 PM

Message Edited by dug9000 on 04-09-2008 02:25 PM
0 Kudos
Message 5 of 5
(3,252 Views)