NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to reset an array to a default value?

Solved!
Go to solution

Hello,

i have a 2D array type text that should be set to a special value.

Dimension is [5][50] where the 5 is the MyIndex parameter of the socket in the BatchModel.

Currently i am doing this in a for loop that loops 50 times for each socket and in the loop i set the array to the value.

StationGlobals[MyIndex][Counter] = "value".

 

Is there any faster way to do this?

 

Thx

 

0 Kudos
Message 1 of 2
(4,046 Views)
Solution
Accepted by topic author OnlyOne

Sure, you can use the following:

 

SetElements(Locals.MyArray,5)

 

That expression will assign every element of Locals.MyArray to the number 5. If you want, you can specify an optional parameter to assign the value to only part of the array.

Message 2 of 2
(4,038 Views)