10-26-2009 12:34 PM
I'm using the USB-6215 on a machine with simultaneously with other un-related devices (GPS receiver, Fuel Sensor, etc.). In the C++ code I'm writing to interface with the devices, I need to identify which COM port (USB port) each device is using. For all the other devices, I call RegOpenKeyEx and RegEnumValue to get the list of COM ports in use. I can see the other devices, but not the 6215 (no difference when it is connected or not). Likewise, the Device Manger (XP or Vista) sees the other devices, but does not recognize the 6215 when connected. I know the NI-DAQmx driver and my code are working because I can read from and write to the device with expected results.
Is there any way to make a NI-DAQmx library call to determine which COM port is being used by the 6215 (COM1, COM2, etc.)? Failing that, is there any way to make an OS API, or any other call, that will help me determine which port is in use?
The reason for needing to do this so I can tell my software what USB port to "find" the other devices on at run time.
Thanks,
Bob
10-26-2009 12:44 PM
10-26-2009 12:51 PM
Dennis:
Thanks for the reply. Don't mean to mince terms, but I used COM port because that's what every other USB device driver I'm using calls its USB interface. All of them are found under the COM Port heading in my Device Manager. I checked my Device Manager again and there is no "Data Acquisition Devices" entry.
Do you know how I can identify which USB port the 6215 is using?
Thanks,
Bob
10-26-2009 01:07 PM
You can mince as many terms as you want but it really does not matter what other devices use. If they have USB-RS232 converters built in, then that is the driver they are using. NI does not emulate a serial port any more than a USB keyboard, mouse, camera, etc. USB instruments from such vendors as Tektronix and Agilent use a USBTMC driver and that's not a com port either.
I have no idea why your device manager does not show anything. Do you have MAX installed and is the DAQ device listed there? Does it really matter what USB hub it's connected to or do you want the device number? There's not much you could do with the hub. If you do change which hub it's connected to, the device # will probably change and your code will have to adapt to that.
10-26-2009 01:29 PM
When I connect my 6215, it physically connects through a USB (Universal Serial Bus Type B) port on my machine. When I look at the Device Manager, and when I query the registry via my software, I see a heading called "Ports (COM&LPT)" and COM3 and COM4 are listed there when no devices are connected. Yes, the drivers for the other devices use COM to work through the USB ports. They show up as COM5 for an RS485/USB converter (fuel sensor), and COM8 for a GPS device. As I stated before, there is no entry called "Data Acquisition" (or anything like it) that I can find in the Device Manager (or in the registry).
Yes, MAX is installed, does recognize the device as "Dev1", and will communicate with it.
All I want to know is if there is a way through a call to NI-DAQmx or other means that designates a port OR other resource (such as a data acquisition device) so I can identify the 6215 as the OS does - in whatever terms that might be - (helps with deconflicting resources on a busy machine and also provides user and debug information). If it's a "Data Acquisition" device instead of a USB or COM port, then so be it.
10-26-2009 01:48 PM
I don't have example code unfortunately. The C reference lists properties that you can use to get the information. There is a system property called DAQmxGetSysDevNames. This will return an array (i.e. Dev1, Dev2, etc.). You can use this information with the Device properties.