05-10-2017 01:30 PM - edited 05-10-2017 01:30 PM
I am trying to read a 2d string array from a file and pass it back to TestStand
I have made a shortened version of my code that uses nested for loops to generate data instead of reading from a file.
if I define the 2d string array in the beginning I can pass it back with the following code:
errChk( CA_VariantSet2DArray (&tmpVariant, CAVT_CSTRING, ROW_SIZE,COLUMN_SIZE, My2DstrArray));
tsErrChk( TS_PropertySetValVariant(seqContextCVI, &errorInfo, "FileGlobals.TestData", 0, tmpVariant));
If I use dynamic allocation I get an error that says the array is too small (on the first line I wrote above) even thought the data looks the same in the watch window
the attached file has 2 functions (FillArrayFromFile1 and FillArrayFromFile2) the first one works, the second one gives me the error
I can't figure out why any help would be appreciated
05-11-2017 02:30 PM
Hi,
I found another forum post that seems to be responding to a similar issue. In this case, the solution was to make an array variable in TestStand and make a check to an empty array. You should then be able to pass any size of array from the CVI array output to the TestStand array variable.
Is this what you were already doing, or were you taking a different approach?
For more information, here is the link to that forum post:
Array out(dynamic size) from Labview module adapter
http://forums.ni.com/ni/board/crawl_message?board.id=330&message.id=41322
Alex C.
National Instruments
Applications Engineer