NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How can I create a custom data type that is a 2D array of string by using TestStand API?

Hi all,

I'm new in TestStand:

I'm able to create a custom data type that is a 1D array of string but I cannot find the way to create a 2D array of string.

Can anyone help me?

Thank you in advance.

Federico

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

I made it!!

 

Indeed my 2D array is an item of a container:

 

/*  Create a new container */

RunState.Engine.NewPropertyObject(Locals.NewDataType,PropValType_Container,False,"",0)

 

/*  Create an array of strings as item of the container */

Locals.NewDataType.NewSubProperty("Array_2D",PropValType_String,True,"",0)

 

/*  Reshape the array as an empty 2D array */

Locals.NewDataType.GetPropertyObject("Array_2D",0).Type.ArrayDimensions.SetBoundsByStrings("[0][0]","[][]")

 

being:

NewDataType a local property (type Object)

0 Kudos
Message 2 of 4
(3,403 Views)

Hey 02Fede69,

 

Here the link you are looking for:

 

How Can I Programmatically Create a TestStand Array?

 

Let me know if you need more help.

Best wishes

Matteo
0 Kudos
Message 3 of 4
(3,391 Views)

Hi Matteo,

 

I had already read the paper you posted.

The problem was about array dimension setting.

Now everything is working.

 

Thank you again.

Federico

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