Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

DAQ selection

Hi,
 
I have a USB6211 connected to the computer, but if I connect another DAQ board to the computer how does my LabWindow program differentiate which DAQ to run?
 
At the moment in my program, I have a function that reads the device name (i.e. dev1, dev2, etc) and then stores the last device that was plugged into the computer (assuming that MAX will assign higher device# to the last DAQ connection).
 
But again, this method would not work if I had to plug another DAQ device on top of the USB6211 connection... I could always read the Serial Number of the DAQ but prefer if there is another way around this. Thanks.
 
COncordian
 
0 Kudos
Message 1 of 6
(3,674 Views)

Hello Concordian,

 

I'm not exactly sure what you're trying to do so I have a few suggestions.  In general the user would be expected to choose the device before the application runs--I'm assuming you're trying to make this easier, or eliminate the need to choose the device all together.

 

1.  If you want to make it easier for users to select the device you can rename the device in the Measurement and Automation Explorer (MAX) to be more descriptive.  I.e. rename "Dev1" to "PCI-6251" then the user can select the device by another name.

2.  If you're trying to programmatically determine the model of "DevX" then you can use a DAQmxGetDevProductType function call to programmatically get the model rather than serial number.

3.  When you plug in a new device (defining a "new device" as a device that isn't already configured in MAX, it will be assigned the name "DevX" where "X" is the lowest integer (1,2,3,...) that doesn't duplicate another device name.  If you unplug this device, but don't delete it from MAX, it will show up with the same name the next time you plug it in.  Your LabWindows program will run on the device with the corresponding name in MAX, you just need to choose that name appropriately.

 

I don't think that I've exactly answered your question, so it would be helpful if you can describe exactly what it is you want to do.  A specific instance of program behavior would be good if possible.  I hope this helps give you some ideas, and have a great night!

 

Cheers,

Brooks
0 Kudos
Message 2 of 6
(3,632 Views)

Hello Concordian,

 

I'm not exactly sure what you're trying to do so I have a few suggestions.  In general the user would be expected to choose the device before the application runs--I'm assuming you're trying to make this easier, or eliminate the need to choose the device all together.

 

1.  If you want to make it easier for users to select the device you can rename the device in the Measurement and Automation Explorer (MAX) to be more descriptive.  I.e. rename "Dev1" to "PCI-6251" then the user can select the device by another name.

2.  If you're trying to programmatically determine the model of "DevX" then you can use a DAQmxGetDevProductType function call to programmatically get the model rather than serial number.

3.  When you plug in a new device (defining a "new device" as a device that isn't already configured in MAX, it will be assigned the name "DevX" where "X" is the lowest integer (1,2,3,...) that doesn't duplicate another device name.  If you unplug this device, but don't delete it from MAX, it will show up with the same name the next time you plug it in.  Your LabWindows program will run on the device with the corresponding name in MAX, you just need to choose that name appropriately.

 

I don't think that I've exactly answered your question, so it would be helpful if you can describe exactly what it is you want to do.  A specific instance of program behavior would be good if possible.  I hope this helps give you some ideas, and have a great night!

 

Cheers,


 

Brooks
National Instruments
Applications Engineer

 

 

Hi Brooks,

Thanks for digging deep well into my thoughts... Actually, the issue is say if there're multiple USB6211 DAQ boards installed onto my computer, how do I know which one to run using the LabWindows/CVI application I wrote (without going to MAX and change the name of device)?

BR,

Concordian

0 Kudos
Message 3 of 6
(3,616 Views)

Hello Concordian,

 

Which USB-6211 do you want to run the program on?  I'm not sure what your dilemma is.  If you have multiple devices they will all have a unique device name and serial number that you can use to identify a device programmatically.  As the user you should know which device you want to run the program on--let’s say you have your program and 2 USB-6211's plugged into the computer.  Can you as the user point to which device you want to run the program on and the issue is providing an identifier the user can associate with the physical device to make the user interface of the program easier?  If this is the case, your suggestion of using the serial number is a good one since the user can read the serial number off the physical device and you can programmatically query the serial number and corresponding device name.  If you wanted you could even write your program to allow the user to select the device by the serial number.  If you did this then you could always select a unique device regardless of its name in MAX.

 

To do this use the DAQmxGetSysDevNames function to return all of the devices currently detected by MAX and then use the DAQmxGetDevSerialNum function to query the corresponding serial number of each device.

 

If your goal is not to avoid MAX assigning different names to the same (by same I mean a USB-6211 with the same serial number) device, then you're going to be a bit more specific about what determines the "correct" device to select.

 

Cheers,

Brooks
0 Kudos
Message 4 of 6
(3,589 Views)

I accidentally made a duplicate post by clicking "submit post" twice.  Please disregard this post.

 

Cheers,



Message Edited by Brooks_C on 05-23-2008 03:43 PM
Brooks
0 Kudos
Message 5 of 6
(3,588 Views)
Hi Brooks,
 
thanks for your clarification, I'll go try that!
 
Concordian
0 Kudos
Message 6 of 6
(3,538 Views)