Jump to content

vituning

Members
  • Posts

    2
  • Joined

  • Last visited

vituning's Achievements

Newbie

Newbie (1/14)

0

Reputation

  1. QUOTE(TobyD @ Jan 4 2008, 11:36 AM) Thanks for the input! The byte array you see me using for that char * input was a futile attempt to get this to work. I also tried it with conventional strings there. I'm almost positive the problem lies with the cluster -> struct conversion. I wired 51, 51 and 21 to the array size for those strings in the struct to allow for the null character in the return string. Again, I'm shooting in the dark here, and think that this is basically impossible to do using the call library function node straight up like this. That said, I don't need to make this work anymore since the customer has moved on to using a NI product rather than a third-party board. There's a solution for everything .
  2. I've searched on this topic and read the excellent document detailing how to construct a LV cluster to match a complex C struct type. However, I can't figure out how to construct the data to pass to a dll function that expects a pointer to an array of structs as an input. I am using LV 8.5. The C struct looks like this: typedef struct { char *DeviceName; char *Manufacturer; char *SerialNumber; unsigned int VendorID; unsigned int ProductID; int InputReportLen; int OutputReportLen; int Interface; int Collection; } mdeviceList2; DeviceName and Manufacturer have a max size of 50, while SerialNumber has a max size of 20. And the function prototype looks like this: extern "C" int _stdcall GetList( unsigned int VendorID, unsigned int ProductID, char *Manufacturer, char *SerialNum, char *DeviceName, mdeviceList2 *pList, int nMaxDevices); The problem I am having is how to create the *plist argument in LabVIEW. The attached image shows how I'm calling it now. I am using standard WinAPI convention, because I get an error 1517 with C calling convention. I am using "Adapt to Type" for *plist with "Pointers to Handles" as the data format. I'd appreciate any input, even if it's "you can't do that without writing a wrapper." Thanks!
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.