NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

SetValStringByOffset

How do I write 2D array of information to the TestStand TemporaryGlobals.  I am able to "set" and "get" a single string but can't figure out how to work with arrays.
0 Kudos
Message 1 of 4
(3,403 Views)

Hi,

  the usual way when working with arays is to do it through a variant instead.

You don't say whether you're using the API in LabVIEW, LabWindows/CVI, c#, vb c++ etc etc or directly in the sequence itself, so the actual calls will depend on the source of the new values and where you're interacting with TestStand from.

Have a look in the examples folder for the passing arrays examples. Hopefully that will give you a good starting point.

Thanks

Sacha Emery
ATE Systems Engineer
National Instrument UK and Ireland

// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 2 of 4
(3,383 Views)

Hi Ed,

I don't know if this will help or not but consider the following expression:

RunState.Engine.TemporaryGlobals.NewSubProperty("MyArray", PropValType_NamedType, 0, "Array2DofNum", 0)

This will insert a new sub property into your temp globals. 

MyArray is the new name of the new 2D array.
PropValType_NamedType means that I want to use a specified type in my type pallette. 
The 3rd parameter = 0 which means I don't want an array of my named type.
Array2DofNum is a data type I created in my type pallette that is a 2D array of numbers. 
The last parameter is the default behavior.

You can read about this API call in the help under PropertyObjects.  Because Engine.TemporaryGlobals is simply a Property Object. 

Let me know if this helps.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 3 of 4
(3,371 Views)

One more thing,

To set values in this array call this expression:

RunState.Engine.TemporaryGlobals.MyArray[5][1] = 3

This sets the index at row 5 column 1 equal to 3.

🙂

It worked for me this way.

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 4 of 4
(3,362 Views)