NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How I can rename an array index with ActiveX commands

In the TestStand developer engine I can rename the index from an array from [1] to ["example"], thus I can point to an variable with the syntax Locals.Arrayname["example"].

Is there an ActiveX command, which allow me to do this programmatically.
0 Kudos
Message 1 of 4
(3,994 Views)
Hi Joe,

Yes you can do this. I have attached a demo sequence file. Now remember that when TestStand executes your sequence, a copy of all the local variables and such are created in memory. Therefore, for the locals to retain the value that you change them to, you must use the RunState.SequenceFile.Data.Seq["MainSequence"].Locals.MyTypeArray, which is actually a reference to the original sequence file in memory. Then all you need to do is call increment change count and save the file. You would need to loop through each element in your array and change the name. Let me know if this works for you.

Happy coding!

The Muppet Man
Message 2 of 4
(3,994 Views)
Thanks Bob, it works.
0 Kudos
Message 3 of 4
(3,994 Views)

I have quite the same question but for StationGlobals.

 

I read data from a database .mdb, i create a typed array, i update the data in the array, everything is OK but i want to name the element of the array.

 

I use the SetPropertyObject.Name, but i don't know how to update the name in the stationGlobals. I understand that i cannot create a new subproperty in a array directly with the named index, but i don't see the way to update the StationGlobals with the named property of the array element.

 

Thanks for help

 

Denis

0 Kudos
Message 4 of 4
(3,626 Views)