NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

array allocation in testStand and labView

I periodically get page fault errors and craches with my testStand sequences and I am worried it is related to my dynamic array allocation in TestStand.

I predomniantly use LabView in my test stand sequences and I occasionally pass LabView an empty TestStand array. LabView then allocates memory for the array and passes it back to TestStand. When it gets back to TestStand, the array is reallocated with the correct size.

Is this a legitamate way to dynamically allocate arrays in TestStand, or am I leaking memory and screwing up the rest of my system.

Thanks for any help!

Tim
0 Kudos
Message 1 of 3
(3,500 Views)
It is not clear how you are allocating the array.

I am assuming your are using TestStand 2.0. Take a look at the example C:\TestStand201 backup\Examples\AccessingArrays\UsingLabVIEW. In this example you will find that the Locals.StringArray in a array variable that is initially set to empty. The Set String Array step in the MainSequence calls a VI that populates Locals.StringArray. TestStand dynamically resizes the array to accept the array that is sent back.

You could alternatively use "TestStand - Get Property Value (Object).vi" from the TS funtion palette to get a reference to the array. Then, using a LV invoke node, you could call SetNumElements or SetDimensions on the array reference before writing your array back to your sequence. To prevent a leak, ma
ke sure that you use an Automation Close function to close the ActiveX reference to the array if you choose to get one.

Let me know if you have questions.
0 Kudos
Message 2 of 3
(3,500 Views)
Thanks! I guess I am doing things correctly. I'm using the equivalent of the method described in your first paragraph with the "set string array" vi.

I was concerned that I had to follow your steps described in the second paragraph and call the SetNumElements function from TestStand to prevent a memory leak. I see that I do not as long as I use the "set string array" vi.

Thanks for the answer!
0 Kudos
Message 3 of 3
(3,500 Views)