NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

How to pass csv data from file into DLL using TestStand

Hi,

We have data files which are of CSV format. Each row contains
about 9 items of data, and have about 5 rows of this data (ie, 5
test points) :
eg

TErrAdd1,UUT,UUT,STM1E,AU4/FR,PRBS23,BIT,10,60
TErrAdd2,UUT,UUT,STM4O,AU3/UNFR,PRBS15,B1,20,60
TErrAdd3,UUT,UUT,STM16O,AU4_16C/UNFR,PRBS9,BIT,7,60
TErrAdd4,UUT,UUT,STM0E,AU3/UNFR,PRBS20,B2,5,60
TErrAdd5,UUT,UUT,STM64O,AU4_4C/FR,PRBS11,B1,6,60


What we want to do is to be able to directly pass each
row of data to a C/C++ DLL. The DLL fn accepts this
data as a vector of strings.

eg.

void DLLTestFn( vector const & configData )

However, we can write a wrapper for the DLL as I don't
think TestStand will know about vectors.

We don't really want to have to hardcode individial references
to each item of data in TestStand. Is this possible?
Just read in a row from a data file, and sent it direct
to the DLL?
0 Kudos
Message 1 of 2
(3,519 Views)
Hi Richardi,
the principle is quite simple, however, you still need to use a programming language to make the initial file read.
Once you've done this, you could have it as an array of strings, and pass this directly to a wrapper DLL, which would then pass the data into a string vector.
Look up the examples\AccessingArrays\PassingArrayParametersToDll\AccessingArrays.seq
to see how to do this without passing the sequence context.
If you've read in the details into a container type structure already, then I've made an example which demonstrates this principle and what you'll need to pass it to a vector. (Similar principle can be used to fill in the container when you read the file in the first place.
You cannot go directly to a vector, since TestStand doesn't understand them.
Vector classes are difficult to export polymorphically from a DLL since the template class doesn't export, and needs specifically defining. This is what I'm assuming you're ultimately trying to do. (see ref :
How to Export STL components inside and outside of a class
I've used VIsual C++ 6 and TestStand 3.0
Please let me know if this helps to answer your query.

Thanks
Sacha Emery
National Instruments (UK)
// it takes almost no time to rate an answer Smiley Wink
0 Kudos
Message 2 of 2
(3,484 Views)