NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Using an array name stored in a String in a Statement

In my sequence, I build an array in one section and store it in a variable called Locals.Test_Array.
I build the name of the permanent place I would like to store this array and store it in a string called Locals.SG_Test_Array_Name.
I would like to move the values from Locals.Test_Array to the Station Globals Array name stored in Locals.SG_Test_Array_Name.
 
For example:
the string stored in Locals.SG_Test_Array_Name is "StationGlobals.Coolant_Temperature_Test_Array" (already created in Station Globals)
 
What I am trying to do is this:
Statement                        StationGlobals.Coolant_Temperature_Test_Array=Locals.Test_Array  (this works)
The Station Global Array name needs to change as the sequence executes and the data in Locals.Test_Array changes.
 
What I need is something like this.
Statement                         Locals.SG_Test_Array_Name=Locals.Test_Array  (where SG_Test_Array_Name is a string that holds the name of the array)
 
Thanks, Big_Will
0 Kudos
Message 1 of 3
(3,062 Views)

Evaluate

(Locals.SG_Test_Array_Name + " = Locals.Test_Array " )

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

Thanks James!

This works great!  I thought about using Evaluate, but did not get the syntax correct in the parenthesis.

When I entered this into my program, it was RED with a line through it, said it would cause a run-time error, but it works!

Thanks again,

Big_Will

 

0 Kudos
Message 3 of 3
(3,041 Views)