NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to get a edited string to be evaluated again

Solved!
Go to solution

hello, I'm very new to TS and don't know if I express the problem clearly. however the question below:

I try to edit a numeric variable before it's evaluate at runtime and what i did is:

 

Val(SearchAndReplace("FileGlobals.I_LB_bin[FileGlobals.loop_BINi]","LB",FileGlobals.Mode[Locals.modei]))/2

 

but after the replacement seems the val function can get value with new string.

how can i get a string to represent a value and be evaluated again after edit?

thanks a lot!

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

Hi,

 

I am assuming that you are trying to get  a variable expression evaluated at runtime. I would do the following

 

Locals.Num=Val(Evaluate(SearchAndReplace("Locals.Var_X","X",Locals.Control_Num)))

 

All the  variables are String and the output is a number on which you may perform further arithmetics. 

 

Capture1.JPG

 

You dodnt need the variable Locals.Var_X at all. I just created during my trials. 

 

Ranjith

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