Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

autodetect daq

I'd like to have a  VI that will detect which DAQ devices are available on the system, perhaps test and verify them, and then assign them for use, automatically. The reason for this is that I'd like to write standalone applications for use on multiple machines, and I've notice that my DAQ device, USB-6259, may be assigned Dev1, Dev0, Dev3 etc depending on in which order it was added to a PC. Ideally the code could accomodate these variations automatically so the user would have as few configuration requirements as possible.
 
Perhaps a routine to do this could involve error handling, simply attempting communication while iterating through a list, Dev0, Dev1 etc. until no error came back. If this is true I'd appreciate any tips on how to process a missing DAQ error without announcing it to the user or stopping the program
 
Thanks
0 Kudos
Message 1 of 6
(3,817 Views)
There doesn't seem to be a way to rename DAQmx devices, but perhaps the following approach could help you:

The attached VI uses property nodes to search for a given product type and returns the first device name of the first matching product type found on the system.
0 Kudos
Message 2 of 6
(3,809 Views)
I forgot to attach the VI, hopefully it is correctly posted on this reply.
0 Kudos
Message 3 of 6
(3,799 Views)

Hi All-

To expand on Jason's suggestion, you may just want to compile a list of all the devices on the system to be archived and indexed as needed by various functions in the program.  The DAQmx Device Property node has many useful functions for identifying a device's type and capabilities.  Here's an example:

Message Edited by Tom W [DE] on 12-19-2006 03:39 PM

Tom W
National Instruments
Download All
0 Kudos
Message 4 of 6
(3,797 Views)
Thanks, these are very helpful examples and I'll use them.
 
I made an example (attached) from the first one myself adding a self-populating drop down menu to make it easier to select the product.
 
I wonder if there is a way to do something similar with non-NI devices. For example, I have a project which uses 3 Belkin usb-serial interfaces for RS-232. The COM ports are similarly dependent on the order in which they were added to the computer. I also use a Measurement computing 16 output USB-3105, but the DAQmx system VI doesn't report these. Any suggestions on accessing that type of information?
0 Kudos
Message 5 of 6
(3,784 Views)
Hello Bill Nye. 
 
Thank you for contacting National Instruments.
 
You talk about trying to find out what devices are connected to your serial ports via LabVIEW.  For most 488.2 compliant serial devices, you can simply query the device with a '*IDN?' command to find out what type of device is connected on the serial port.  There is a great example program that does just this located at:
 
Serial Communication - Basic Serial Write and Read
 
If you are interested in obtaining more information about this, I would recommend posting in the Instrument Control section of the discussion forums so more GPIB/serial guru's can take a look at your inquiries. 
 
As far as detecting non-National Instruments DAQ hardware, your best bet is probably in the Windows Device Manager.  I believe there are some commands that can be executed on the command line to get a description of all devices currently detected by Windows.  You could use this capability coupled with 'System Exec.vi' (which will can feed input strings into the command line and return whatever the command line returns) to detect these other devices.
 
Good luck with your application and if you have any other questions, we will be happy to answer them.   
 
Brian F
Applications Engineer
National Instruments
0 Kudos
Message 6 of 6
(3,756 Views)