Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

Controlling USB6009 with VISA

Hi, can anyone help how can I communicate with a USB DAQ 6009 with VISA??Or even if I can do this?, I already can comunicate with the DAQmx but I have no idea how to do it with VISA.
Thanx for you're time and patience.
0 Kudos
Message 1 of 8
(4,218 Views)

Hi jaiba-

Communicating with the USB-6009 (and most "newer" USB DAQ devices) directly via VISA is fairly complicated.  This is due to the fact that those devices only communicate using an NI proprietary protocol.  In other words, they do not respond to standard IVI, IEEE 488.2, or other commands.  There is no programmer's manual available to help with VISA programming for the USB-6009.

Is there a reason why you need to use VISA rather than NI-DAQmx?  If you really want to tinker around with VISA communication, you can install NI-DAQmx Base and LabVIEW and poke around in that code.  Most of the device-level communication is exposed via the red-colored USB I/O nodes in NI-DAQmx Base (you'll have to dig a few levels into the NI-DAQmx Base VIs to find them).  Those nodes use NI VISA under the hood, and they represent the lowest-level form of "documentation" that is externally available for the USB communication.

Regardless, I would strongly suggest that you use NI-DAQmx on your Windows machine rather than attempting to communicate over NI VISA.

Hopefully this helps-

Tom W
National Instruments
0 Kudos
Message 2 of 8
(4,203 Views)
Hi Tom W:
                   First fo all thanks for youre comment, you help me a lot to understand the VISA functions. So if the 6009 is too complicated to be controled with the VISA Instructions, would you give me an example of a device I can control with VISA?
Thanx for all youre help.
0 Kudos
Message 3 of 8
(4,187 Views)
So your interest in VISA is what? Do you have a specific task in mind or just want to play around with the functions? If you just want to do a basic experiment, connect a cross-over cable between 2 serial ports. To do a bit more, look to see if you can find an inexpensive instrument with a serial interface. For a very small list of the devices that can be controlled with VISA, look at http://www.ni.com/devzone/idnet/. As it says, there are drivers for over 5000 instruments. Pick one of these or find a different one. Picking an instrument that is not listed, creating a driver for it, and then submitting the driver for everyone else to use would be great.
0 Kudos
Message 4 of 8
(4,184 Views)
I just want to know what kind of USB devices can control. I dont have any interest in control any other device. I created a driver for the 6009 in the VISA wizard, but I only can see my device, I cant control it (now I know why). My main idea was to control a USB Mouse or maybe a USB Fan, i thought there will be some kind of function to cut off the power or something but I havent found it yet. Is there any function like the one I want?
0 Kudos
Message 5 of 8
(4,182 Views)
Cutting off power to the USB hub is a bad idea and can't be done with VISA anyway. If it could be done, you would kill power to all of your USB devices (i.e. your mouse, keyboard, etc.). A USB mouse uses the built-in microsoft driver and you would have to get the os to ignore that driver and replace it with a VISA driver. I'm sitill not sure what the point of all of this is. Even if you managed to get a VISA driver installed for a mouse, there are much simpler ways to interface to a mouse and even if you got the VISA communication to work with the mouse, it would not help that much if you then wanted to communicate to a different USB device. A much more realistic excercise might be to get a USB development kit where you could really learn a bit about USB.
0 Kudos
Message 6 of 8
(4,171 Views)
Ok Dennis, I understand you, but can you tell me how can I control USB devices in LabVIEW?? I mean, not USB DAQ's of any kind, I mean things like a USB Mouse? Ia there a USB development Kit in LabVIEW or I have to do it on another software? And If its like this, how can I later use it in LabVIEW? Is there any manual or something.
Thanx for all.
0 Kudos
Message 7 of 8
(4,152 Views)

For USB, you can do a bulk transfer with VISA Read and Write, and the Instrument I/O>VISA>VISA Advanced>Bus Interface Specific>VISA USB palettes has functions for control and interupt pipes. There is a tutorial at http://zone.ni.com/devzone/cda/tut/p/id/4478 that explains some of this and you can do a search of the developer zone for generic examples of the control and interupt functions. The difficultly with USB is that outside some predefined classes (ie HID, TMC), the developer of USB hardward has a lot of freedom in deciding how to implement an interface and the commands and pipes used. That is why I am finding it difficlut to answer your question. Each and every USB device would require a different set of VISA functions and the data being passed by each function.

When you get a USB development kit, it includes the ability to create the firmware for your device and then you will know exactly how to implement a VISA driver for it. It is this low level information that is often so hard to get. Just like NI does not publish the low level information for it's USB DAQ devices. Just like NI does with DAQmx, most vendors will provide a dll that you can use for their USB device. LabVIEW is not a development environment for device drivers.

You keep mentioning a USB mouse. As far as LabVIEW is concerned, it is no different than a mouse plugged into the dedicated mouse port. To read a mouse, you can use the Connectivity>Input Device Control functions. These functions can also be used for keyboards and joysticks (USB or not).

To get a good understanding of USB, I would recomend starting at www.usb.org.



Message Edited by Dennis Knutson on 05-21-2008 09:01 PM
0 Kudos
Message 8 of 8
(4,146 Views)