NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

how to use setarraybounds for resize 1 dimension of a 2D array?

Solved!
Go to solution

Hello:

    I use Teststand2013,

SetArrayBounds( FileGlobals.Drt_Step_Data_Filt, "[0][1]" , "[3][3340]") to set bounds of the 2D array "FileGlobals.Drt_Step_Data_Filt".

when I check in the "Watch View" the bounds is in what i want [0..3][1..3340],

but after check the dimension 0-->FileGlobals.Drt_Step_Data_Filt[0], the bound is [0..3339] not [1..3340]

and SetArrayBounds( FileGlobals.Drt_Step_Data_Filt[0], "[1]" , "[3340]") is not work.

what can i do to change 1 dimension size of a multi dimension array?

thanks a lot!

0 Kudos
Message 1 of 4
(3,567 Views)

The run time data in Watch view as below:

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

Hi johnnnywang,

 

When you look at an array subset in TestStand, it will always be 0 indexed. If you want to be able to set the bounds on the array subset, you will need to assign it as the value of a new variable. For example:

 

Step 1:

SetArrayBounds( FileGlobals.Drt_Step_Data_Filt, "[0][1]" , "[3][3340]")

 

Step 2:

FileGlobals.Drt_Step_Data_Filt_Subset = FileGlobals.Drt_Step_Data_Filt[0], SetArrayBounds(FileGlobals.Drt_Step_Data_Filt_Subset, "[1]","[3340]")

 

This way the resulting FileGlobals.Drt_Step_Data_Filt_Subset will be 1 indexed.

 

 I hope that helps!

Steven Gloor
Staff Customer Engineer - CTA, CLD
Message 3 of 4
(3,531 Views)

Got it, thank you very much!

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