01-15-2008 11:12 AM
01-16-2008 07:40 AM
01-16-2008 10:04 AM
01-16-2008 10:23 AM
Also how do I Byte swap the data programatically?
Scott Schindler
01-16-2008 10:24 AM
01-16-2008 10:40 AM
01-16-2008 10:41 AM
schindler wrote:
How do I Word and Byte swap programmatically?
07-31-2008 04:02 PM
08-13-2008 01:48 PM
What about array of numbers? say it was something like:
typedef mystruct{
char MyChar[4];
char MyOtherChar[4];
}
And I need to pass a pointer to the DLL function. The DLL function then passes the data to my cluster in memory... If I initialize four elements in my structure arrays, will that work?
08-13-2008 02:04 PM - edited 08-13-2008 02:05 PM
Hi all,
a good point to get information is the following PDF by NI: www.ni.com/pdf/manuals/370109a.pdf
To pass arbitrary data to a DLL (for example if you have a really complex data structure with many different types), you can write a wrapper DLL yourself in C++ that accepts LabVIEW data and converts it into a useable format for the DLL you want to communicate with. For example, to pass a struct of two arrays, you can pass the arrays alone and create the struct in the wrapper. To get an idea of how LabVIEW passes data, you can configure a Call-Library-Function-Node with an "Adapt to type"-input, wire your data, then right-click your node an choose "Create C-File". In this file, you see how your struct has to look. For example, if you take your example of a cluster of two arrays, create the following LabVIEW-Code:
You get this C-File:
typedef struct {
int32_t dimSize;
double element[1];
} TD2;
typedef TD2 **TD2Hdl;
typedef struct {
TD2Hdl elt1;
TD2Hdl elt2;
} TD1;
void funcName(TD1 *test1);
void funcName(TD1 *test1)
{
/* Insert code here */
}
This means this isn't compatible to your struct.
Hope this helps
Greetings,
Christian