Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

USB Device Detection

I have a Visual C++ application which uses the traditional Init_DA_Brds function to detect which and how many boards I have installed. My app will then add an element to a CObArray for every device found. The app would then map inputs and/or outputs based on the type of NI card it detected. The types of cards we detect using this method are the following (the deviceNumberCode is in parentheses):
  1. PC-DIO-96 (12)
  2. PC-LPM-16 (13)
  3. PC-DIO-96/PnP (66)
  4. PCI-DIO-96 (200)

I am now trying to expand this device list to include the NI USB-6009 but am having trouble finding a way to detect this device. Init_DA_Brds does not recognize this device.

How do I detect the USB-6009? There must be some way to do this since the Measurement & Automation Explorer seems to do it just fine.

Thanks for any help.

Paball

0 Kudos
Message 1 of 3
(5,702 Views)
Hello,

You can use the DAQmx function called DAQmxGetSysDevNames.  If you look inside the DAQmx C Reference Help file you will see the function prototype (int32 __CFUNC DAQmxGetSysDevNames(char *data, uInt32 bufferSize); ).  You can find the DAQmx C Reference Help file under Start >> Programs >> National Instruments >> NI-DAQ.

I tested this function with DAQmx 8.3 with my USB-6009.  When I had the device plugged in, it would be in the returned data.  If the device was not plugged in, the returned data did not contain the device.

The DAQmxGetSysDevNames returns the DAQmx device names for each device in your list.  If you want to identify each device you can then use the property called DAQmxGetDevProductType (int32 __CFUNC DAQmxGetDevProductType(const char device[], char *data, uInt32 bufferSize); )

I hope this helps,

Regards,

Jesse O.
Applications Engineering
National Instruments.

Message Edited by Jesse O on 10-16-2006 11:04 AM

Jesse O. | National Instruments R&D
0 Kudos
Message 2 of 3
(5,687 Views)
Thanks, Jesse. That did the trick.
0 Kudos
Message 3 of 3
(5,675 Views)