NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

I

have a text file that is an output of a windows application. I want to use data from this file to fill it in a step property that is 3 dimensions array of numbers. I mean if there is a way to do it during or before the running of the sequence by the user.
0 Kudos
Message 1 of 2
(2,634 Views)
have a text file that is an output of a windows application. I want to use data from this file to fill it in a step property that is 3 dimensions array of numbers. I mean if there is a way to do it during or before the running of the sequence by the user.Hello,

If you are not using LabVIEW or CVI, you'll need to create a DLL to read the text file and convert the data to a safe array type and later in a variant data type.

This is an example using VC++:

line 1 PropertyObject property;
line 2
line 3 property.AttachDispatch(seqContextDisp, FALSE);
line 4
line 5 if (property.Exists("Locals.Array3D", 0))
line 6 {
line 7 // Create a Safe Array from the VARIANT which contains a
line 8 // copy of the Locals.NumericArray.
line 9 COleSafeArray safeArray;
line 10 safeArray.Attach(property.GetValVariant("Locals.Array3D",0));
line 11
line 12 // Lock array for data access and get a pointer to the data.
line 13 safeArray.AccessData((void**)&numArray);
line 14
line 15 // Assign values to the 3D array
line 16 fo
r (i=0; iline 17 numArray[i] = VARIANT_TRUE;
line 18 }
line 19
line 20 // unlock array
line 21 safeArray.UnaccessData();
line 22
line 23 property.SetValVariant("Locals.Array3D", 0, safeArray);
line 24 }

**************************************************************************


Roberto.
0 Kudos
Message 2 of 2
(2,634 Views)