07-11-2006 04:31 PM
I'm trying to call the following function with the Call library function node:
XLstatus
xlLinSetChannelParams (XLportHandle portHandle,
XLaccess accessMask,
XLlinStatPar statPar)
The statPar parameter is a stucture which is define as follow
typedef struct {
unsigned int LINMode
int baud rate;
unsigned int LINVersion;
unsigned int reserved;
}
XLlinStatPar; I used a cluster to pass the data to the function but labview is crashing everytime. The C output of the CLFN is :typedef struct {
unsigned long LinMode;
long baudrate;
unsigned long Linversion;
unsigned long reserved;
} TD1;
long _xlLinSetChannelParams28(long portHandle, uInt64 accessMask,
TD1 *statPar);
Why is labview sending a pointer to the struct instead of the structure itself? Is this the cause of my problem? Any Solution?
07-12-2006 02:36 AM
If I'm understanding this correctly (and note, I'm not a C programmer and I don't have that much experience with CLFNs), then the pointer is to the area LV allocates in memory for the CLFN to place the data into.
I'm not sure what the type conversion should be, but if it doesn't match and you use a pointer, then I see how this could be a problem.
I suggest that you start by checking if the parameter is set to handle by value or by pointer and make sure it's by value.
After that, I would look at the example which shows how to call various C types and which is referenced in the help for the CLFN and maybe also read the other paper that's referenced there.
If those didn't help, then I suggest posting the VI and the DLL (and maybe the code for the DLL as well), so that we can play with it.
07-17-2006 10:27 AM
07-17-2006 01:20 PM
07-17-2006 02:26 PM