NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting Value of variable when given name of variable

Solved!
Go to solution

Hello all,

 

I have some fairly complex logic with ternary operators and I have ran into a snag.  I am using Step.TS.SData.ViCall.Parms.ArgVal to return the input values for my VIs.  However, when I use a variable as an input for my VI, Step.TS.SData.ViCall.Parms.ArgVal will return the variable's name.
An example would be:
Step.TS.SData.ViCall.Parms["RemoteIP"].ArgVal returns Locals.IP

Rather than
Step.TS.SData.ViCall.Parms["RemoteIP"].ArgVal Returns 192.168.0.1

Is there a way to return the value of a variable rather than its name, or evaluate its value given the name?

Thanks,

Brady James

0 Kudos
Message 1 of 3
(2,816 Views)
Solution
Accepted by topic author BradyJames

Hi James,

 

You should take a llok to the TS function 'Evaluate'.

You can easily use it within an expression to get the value contained in a variable only know by its name (as a string).

To find it, click on f(x) within an expression edit box and take a look to the 'Operatros/Functions' tab, section 'Functions', line Other.

CLA, CTA, LV Champion
View Cyril Gambini's profile on LinkedIn
This post is made under CC BY 4.0 DEED licensing
Message 2 of 3
(2,806 Views)

Thank you very much! This worked great!

0 Kudos
Message 3 of 3
(2,778 Views)