LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Confusion between HID and VISA communication

Hi.

I gonna communicate between a Atmel AT90USB1287 microcontroller (in-built USB interface) and LabVIEW over USB to visualize interrupt datapackets.
I have been wondering if I should used the NI-VISA or HID.DLL to communicate with my HID device over USB. When I search this question on this forum I am getting more confused, because:

Some are talking about to use the NI-VISA for communication with HID USB devices, but they also say that you cannot use NI-VISA with a HID device, because
Window's uses a weighted system to determine what is the most appropriate driver for an instrument, and then a hid.dll will overdrive the NI-VISA. Ref: http://digital.ni.com/public.nsf/websearch/273BB58D3B52CE6886256F3B00714D03?Open

Can anybody explain this confusion to me? I think this is rather a contradiction.

I seems to me my Atmel has made a dll driver that supports a standard hid-firmware that we may write in the AT90USB1287. This DLL is kalled AtUsbHid.dll and Atmel has provided a list of DLL functions description for this file.

Am I right thinking that I should use this
AtUsbHid.dll file, to communicate over USB from my AT90USB1287 microcontroller and call that dll with the VI "Call Library Function Node"?
I have attacked a little pdf file with information about the Atmel AtUsbHid.dll file with functions description if that can help anybody answering me.

Also does anybody know where I can read more about the way to Call a Hardware Driver API, unless what is saying at the pages 2-22 to 2-24 in the reference manual "LabVIEW Using External Code in LabVIEW".

Any help would be much appreciated.

Bjørn Liene Gundersen, Engineering student from Høgskolen I Sør-Trøndelag, Norway.







0 Kudos
Message 1 of 6
(6,719 Views)


Some are talking about to use the NI-VISA for communication with HID USB devices, but they also say that you cannot use NI-VISA with a HID device, because Window's uses a weighted system to determine what is the most appropriate driver for an instrument, and then a hid.dll will overdrive the NI-VISA. Ref: http://digital.ni.com/public.nsf/websearch/273BB58D3B52CE6886256F3B00714D03?Open

Can anybody explain this confusion to me? I think this is rather a contradiction.

I seems to me my Atmel has made a dll driver that supports a standard hid-firmware that we may write in the AT90USB1287. This DLL is kalled AtUsbHid.dll and Atmel has provided a list of DLL functions description for this file.

Am I right thinking that I should use this
AtUsbHid.dll file, to communicate over USB from my AT90USB1287 microcontroller and call that dll with the VI "Call Library Function Node"?
I have attacked a little pdf file with information about the Atmel AtUsbHid.dll file with functions description if that can help anybody answering me.


Yes, VISA can only access USB hardware that has no other driver loaded already. And since HID devices are a standard feature of Windows that you probably do not want to remove from your system, that means VISA won't work with them.

Since Atmel has a user space DLL that gives you an API it is definitely the most simple solution to use that one with the Call Library Node. If you have LabVIEW 8.20 you can even try to use the DLL import Wizard to let it (hopefully) create the necessary VIs.

A good understanding of C datatypes and preferably C programming will help a long way in interfacing external DLLs. Another good read would be the Help->Search the LabVIEW Bookshelf->Using External Code in LabVIEW PDF file.

Rolf Kalbermatter
Rolf Kalbermatter
My Blog
Message 2 of 6
(6,710 Views)
To rolfk

Thanks a lot!

Bjørn L Gundersen
0 Kudos
Message 3 of 6
(6,685 Views)

Hi

I also need to communicate between pc and at90usb1287

can you send me your VI  ?

Nati

0 Kudos
Message 4 of 6
(5,768 Views)

>sharp intake of breath<

 

I don't agree with Rolfk.

 

>breathe out<

 

It's not a contradiction that a HID device (As seen by the OS) and VISA can't work together.  In order for VISA to be able to access the device, you need to install a different driver which basically registers it as a "NI-VISA device" with the system.  Of course the device is still a HID device, it's just not installed as one.  This is where the confusion comes from.

 

I have recently written a nugget on using interrupt-based transfers within LV here.

 

Whether you prefer to go the DLL route or the VISA route depends mainly on personal preferences.  Both are possible.  A possible advantage of VISA is that the same code should work on Windows, Mac and Linux should that ever be a requirement.

 

And sending a wrong parameter to a VISA function won't crash your system.

 

Shane.

Message Edited by Intaris on 09-03-2008 02:37 AM
0 Kudos
Message 5 of 6
(5,761 Views)

May be this file will help you. It uses ATUSBHID.DLL to communicate with AT90USB1287 as a Generic HID device.

Message 6 of 6
(4,140 Views)