10-16-2014 10:38 AM - edited 10-16-2014 10:43 AM
Hello Everybody,
I am having some difficulty getting the Get List.vi to find the usb devices on my PC. It does not find any of my devices, and I suspect it may be with how I have the vi set up.
I think the problem lies with the struct data type:
typedef struct {
char *DeviceName; // Device name
char *Manufacturer; // Manufacturer
char *SerialNumber; // Serial number
unsigned int VendorID; // Vendor ID
unsigned int ProductID; // Product ID
int InputReportLen; // Length of HID input report (bytes)
int OutputReportLen; // Length of HID output report (bytes)
int Interface; // Interface
int Collection; // Collection
} mdeviceList2;
Any suggestions?
There are some demos at the bottom of the page located here, and where done in CVI and work fine:
http://www.kadtronix.com/usbhidapi.htm#Description
10-16-2014 02:21 PM - edited 10-16-2014 02:25 PM
@bry0n wrote:
Hello Everybody,
I am having some difficulty getting the Get List.vi to find the usb devices on my PC. It does not find any of my devices, and I suspect it may be with how I have the vi set up.
I think the problem lies with the struct data type:
typedef struct {
char *DeviceName; // Device name
char *Manufacturer; // Manufacturer
char *SerialNumber; // Serial number
unsigned int VendorID; // Vendor ID
unsigned int ProductID; // Product ID
int InputReportLen; // Length of HID input report (bytes)
int OutputReportLen; // Length of HID output report (bytes)
int Interface; // Interface
int Collection; // Collection
} mdeviceList2;
Any suggestions?
There are some demos at the bottom of the page located here, and where done in CVI and work fine:
http://www.kadtronix.com/usbhidapi.htm#Description
Well!! The mdeviceList parameter is an array of mdeviceList2 records. You only pass a single record to the function. This can work if you always pass 1 for nMaxDevice but if you pass anything else you will most likely receive an error (if you pass 0) or cause a memory corruption (if you pass more than 1 and the function has more than one device to report).
10-17-2014 08:20 AM
Thanks for the reply rolfk! I will give that a try.