08-24-2009 11:46 PM
I've got a client who would like to read weigts from a Pelouze USB scale into LabVIEW. The scale comes with a driver that is based on the HID interface. There are several threads on the forums about talking to USB devices using USB RAW through VISA and on talking to HID devices, but I couldn't find any thread that claimed that the HID idea had been done successfully from LabVIEW.
Although it appears that one can disassociate the device from the HID driver and access it through USB RAW, we have decided not to go that route. (There are too many steps required to set up the scale in this manner. It wouldn't be appropriate for the eventual customer.) So calling HID.dll seems to be the only option. However, my reading of the threads seems to indicate that this is pretty complicated. Even if we understood the hid.dll interface, we still don't have any specs on how the scale uses the hid interface.
Has anyone succeeded in talking to a Pelouze scale from LabVIEW? Or any of the other numerous USB scales that use an HID interface?
Thanks,
DaveT
08-25-2009 01:47 AM - edited 08-25-2009 01:48 AM
Dave Thomson wrote:I've got a client who would like to read weigts from a Pelouze USB scale into LabVIEW. The scale comes with a driver that is based on the HID interface. There are several threads on the forums about talking to USB devices using USB RAW through VISA and on talking to HID devices, but I couldn't find any thread that claimed that the HID idea had been done successfully from LabVIEW.
Although it appears that one can disassociate the device from the HID driver and access it through USB RAW, we have decided not to go that route. (There are too many steps required to set up the scale in this manner. It wouldn't be appropriate for the eventual customer.) So calling HID.dll seems to be the only option. However, my reading of the threads seems to indicate that this is pretty complicated. Even if we understood the hid.dll interface, we still don't have any specs on how the scale uses the hid interface.
Has anyone succeeded in talking to a Pelouze scale from LabVIEW? Or any of the other numerous USB scales that use an HID interface?
Thanks,DaveT
What do you mean when you say the scale comes with a driver that is based on the HID interface. Is that a DLL? Why would you then want to access HID.DLL instead of this specific driver DLL?
HID.DLL is the generic HID Windows API to all HID devices (that are not captured by the Windows kernel for user events, such as the mice and keyboards). So your scale implements a HID USB class and Windows recognizes that and makes it available as such through HID.DLL. However accessing a HID device through HID.DLL is still pretty low level as you simply get a data stream and need to decode and encode the device specific information from and to that stream. Not to speak of the various hoops you have to jump through to localize and open the device through setupAPI.dll and HID.dll, before you can talk to it. Another problem is that the data stream protocol of proprietary HID devices is seldom documented.
So if your scale comes with a DLL driver to access it, go with that driver. Of course you will need some documentation of the API of that driver and then using the Call Library Node to call into it. Going the direct HID path is really not a good solution unless you know the HID data stream protocol of the device AND you have no other way to do it (for instance if you need to interface to your own HID device design).
Rolf Kalbermatter
08-25-2009 10:37 AM
Rolf,
Thanks for the input. This pretty much verifies the conclusions we were coming to. Digging into the hid.dll may be a theoretically possible approach, but is likely to be a huge time sink.
As for why we were trying the hid.dll rather than the driver dll: So far, we have gotten no info from the manufacturer. We have no .h file for the driver dll and no description of how the driver dll or their use of the hid.dll has been done. Our thought was that the hid.dll is at least a semi-known quantity. We can probably find a hid.h file online, so we at least have half a chance of getting LabVIEW to make calls into it. But without more info from the manufacturer, it looks like this would likely be a black hole.
Cheers,
Dave