From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

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,564 Views)

The run time data in Watch view as below:

0 Kudos
Message 2 of 4
(3,557 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,528 Views)

Got it, thank you very much!

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