LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

USB interface VISA RAW comunication with a HID device

Hello,
I am trying to communicate with a HID device (a uC). I attached the configuration that I read from device, now someone can halp me to proceed to develop the tasks to read from buffer of the device?
 
The device use interrupt transfer.
 
Thanks
0 Kudos
Message 1 of 13
(13,342 Views)

Hi Carolax,

the first step for comunicate with your usb device is get the operating system to recognize the interrupt pipe USB device and use the VISA Driver Development Wizard to attach VISA to the device as a driver. Take a look at this

http://digital.ni.com/public.nsf/allkb/E3A2C4FE42D7ED0D86256DB7005C65C9?OpenDocument

Once you have configured the device correctly, the USB RAW appears in NI Measurement & Automation Explorer (MAX).

Then you can look at  USB RAW- interrupt.vi example in LabView Example Finder. (You can find it under Hardware Input Output > VISA)

I hope this helps.

Clara

Message 2 of 13
(13,299 Views)
Can you give some details of the method you are using to communicate with HID, using hid.dll?
0 Kudos
Message 3 of 13
(13,217 Views)

Hi,

you can typically use the VISA Driver Development Wizard to create an INF file so that Windows can detect your USB RAW device and use the NI-VISA driver to communicate with it. If you want to access an HID Compliant device is by making calls directly to the hid.dll library provided in Windows this KnowledgeBase should provide a good starting point to solve your problem:

http://digital.ni.com/public.nsf/allkb/8FD4C1DC8E80637E862572EF00784338?OpenDocument

Please note the following: you should have hid.dll in Windows XP too. Mine is located in C:\WINDOWS\system32 (hid.dll is not supported by National Instruments you should ask Microsoft for issues specific to the use of this dll.)

If you are new to dll calls in labview you can find the proper manual here. It's a very good resource when dealing with external code in labview.

http://digital.ni.com/manuals.nsf/websearch/8D930295FFBF9F7686256D2C00624728

Clara

 

Message 4 of 13
(13,211 Views)
Claracarla,
               Thank you for your reply.
               In your reply, you said, "hid.dll is not supported by National Instruments you should ask Microsoft for issues specific to the use of this dll." Your mean is I will not use hid.dll with call library function node.vi directly? If so, I think I'd better to use another method.
               If I use VISA Driver Development Wizard to create INF, which USB Class the device will be?
              Thank you. Looking forward your reply.
  
 
 
 
Hugo
0 Kudos
Message 5 of 13
(13,192 Views)
When Clara said that hid.dll is not supported by NI, what that means is that since the hid.dll is a prodoct of microsoft and is not an NI product, you should support from microsoft on how to use it. You can (and should) be using the Call Library Function Node.
Message 6 of 13
(13,185 Views)
Thank you for your help.
But I have another question. I think all the HID devices are standard devices, so all the HID devices will not ask me to install driver? Am I right?
So if I want to design a device which can use the driver making by the VISA driver development wizard , which class the device will be?
I only need the device have two endpoints which can send and receive data with Labview.
Would you please give me some suggestion.
Thank you.
 
 
 
Hugo
0 Kudos
Message 7 of 13
(13,157 Views)

Hi all,

 

I get the error 0xBFFF003E using USB raw with a microcontroler from Freescale. In fact, I can ask for the USB descriptors fine, however if I press the command to read them constantly (say 10x very quickly), I receive this error.

And the error goes to the point of needing to deleting the driver and reinstalling the whole thing again (inf file), so that VISA can recognize it again (in fact, in the system folder it remains there with the exclamation sign).

 

Is it maybe a configuration from the firmware and somehow it freezes if I request it many times? I don't think there would be a problem in the pipe0 in terms of bandwidth... 🙂

 

Does anyone have any idea?

Thx!

0 Kudos
Message 8 of 13
(12,325 Views)

Hi echarry,

 

Have you already looked at these two threads

 

VISA viClear on USB-Device sometimes returns 0xBFFF003E

http://forums.ni.com/ni/board/message?board.id=140&message.id=20991&requireLogin=False 

 

VISA: (Hex 0xBFFF003E) Could not perform operation because of I/O error 

http://forums.ni.com/ni/board/message?board.id=140&message.id=19430&requireLogin=False 

 

  

Seems they already dealt with similar issues.

 

Have a good day

 

FiloP
It doesn't matter how beautiful your theory is, it doesn't matter how smart you are. If it doesn't agree with experiment, it's wrong.
Richard P. Feynman
Message 9 of 13
(12,279 Views)

HI Jon,

 

Thanks for the reply!

No I haven't, but it didn't seem to help me out here. I'll keep trying.

 

Btw, to I need to set a buffer size for a USB raw communication? Or even flush my buffer before reading? I thought this was only necessary for RS232 comms.

 

Question is: why I can read the descriptors from my device using pipe 0 and by reading my other pipe's status I get this error? Maybe the device is in another state. I don't know..

Any ideas?

 

Thanks!

 

0 Kudos
Message 10 of 13
(12,250 Views)