From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Kadtronix USB HID

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

 

 

Download All
0 Kudos
Message 1 of 3
(2,653 Views)

@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).

Rolf Kalbermatter
My Blog
0 Kudos
Message 2 of 3
(2,633 Views)

Thanks for the reply rolfk! I will give that a try.

 

0 Kudos
Message 3 of 3
(2,611 Views)