LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Need information on how to comunicate with USB devices

I have an aquisition unit that connects to the computer trhough a USB port. Does anyone knows how to comunicate usb devices with labview using a Universal Serial Bus (USB)?
0 Kudos
Message 1 of 5
(3,340 Views)
Most off-the-shelf hardware comes with a USB driver (and hopefully some LabVIEW vi's!). However if you don't have a driver, or are building your own, and you know how the device communicates (endpoints, data structure, etc.), then you can use NI-VISA to communicate directly via USB much like 232 or GPIB.
Message 2 of 5
(3,339 Views)
Sorry for digging up old threads, but it seemed most relevent, and I always figure it's best to add onto old then start new. For ease of the next persons search.



So anywho, My first question is... I assume it is not necessary to open and close VISA sessions to USB ports, right?

I am having an issue where my device doesn't like to work unless a specific series of events take place... very unlike USB Devices in my experience. For instance, if you have the said device plugged in, and you turn it on, then open labview. It will spit out garbage. If you close labview, do nothing else, and open labview up... it will spit out the same garbage.  ( by garbage i mean a series of y's with dots over it, and odd looking p's ... you know the kind of letters you get by pressing alt+###... i think in hex it winds up spitting out something like FF EF FF FF FF EF EF ) .... now, if from this current state, I unplug the USB and plug it back into the device, it will finally start to communicate properly.

Im curious why either labview or the computer itself are not recognizing the device on the USB port properly unless it is unplugged and then plugged back in. Ive tried to do reading on USB, and got all sorts of interesting tid bits of somewhat useless information.  Im trying to determine if this is something I am not doing in labview, or if this device should have a driver to register with windows, or what exactly the issue is...  Just a little background, I do explicitly know all the individual commands to this device so it is not an issue to communicate with it directly through visa...

Thought some of you might have insight or some similar USB experiences....

Message Edited by MJBrehm on 10-02-2006 02:17 PM

Message Edited by MJBrehm on 10-02-2006 02:19 PM

0 Kudos
Message 3 of 5
(3,168 Views)
Hello,

You do not have to do an explicit VISA open on your device, as performing a write or read will open a session to the device implicitly. It is however, recommended that you close any open sessions because they stay open until you close them, or until you shut down LabVIEW.  If you explicitly close the session to the device, do you still see the behavior you mentioned? Thanks!

Regards,

Ebele O.
National Instruments
0 Kudos
Message 4 of 5
(3,142 Views)
I will try and test that theory out today... i didn't not have an explicit close in my code, as I thought it wasn't necessary. I'll see if closing the session helps...  thanks
0 Kudos
Message 5 of 5
(3,128 Views)