03-22-2017 07:44 AM
For the below variable setup i wish to create an expression to dynamically get the values of the subcontainers.
- I tried something like : value 1 = Evaluate("FileGlobals.MainContainer." + locals.currentSubContainer + ".value1")
How do i use evaluate to dynamically change which container is read ?
locals.currentSubContainer = "subContainer1"
... get value 1
... get value 2
locals.currentSubContainer = "subContainer2"
... get value 1
... get value 2
FileGlobals
"MainContainer"
"SubContainer1"
"Value1"
"Value2"
"SubContainer2"
"Value1"
"Value2"
Solved! Go to Solution.
03-22-2017 08:29 AM
Sounds like the property loader would be the best answer.....
03-22-2017 09:37 AM
I don't need to control it externally.
I just need to use same subsequence to do same thing multiple times using different settings.
The "setting" should be dynamically changed based on a parameter "A", "B", "C". ect.
Something like:
http://digital.ni.com/public.nsf/allkb/42099F16F8DDEA4286256CBB005D1C96
i just can't make it work.
03-22-2017 09:57 AM
Locals.currentFrequencies.F1 = Evaluate("fileglobals.CalibrationSettings." + parameters.currentFrequencySet + ".F1")
Gives me an error:
"A range is only valid inside an array subscript"
what does it mean, and why ?
03-22-2017 10:00 AM
Can you attach a small example of what you exactly tried?
03-22-2017 10:19 AM
Solved it.
TS apparently checks if the dynamic value "exists" in the Variable list.
The parameter was "empty" in my list hence it didn't work. If I gives the subsequence parameter a "dummy" value that actually exists but overwrite this before real use, it works.