09-28-2011 09:47 PM
This isn't really a DAQ problem, it is a problem with the Measurement & Automation Explorer (MAX), but there isn't a discussion group with that header and I figure that experts with DAQ cards will know how to handle this problem.
I have a USB-6341 assigned as Dev1. When it is not attached to the system and I start the application which talks to it, MAX assigns a virtual device named Dev1. When I re-connect the DAQ card, it gets assigned as Dev2 (or anything other than Dev1 if Dev1 already exists, even as a virtual device).
I can only fix it manually. How can I have my application search for the actual hardware device and make sure it is assigned as Dev1?
Thanks in advance,
Jeff
09-29-2011 06:51 AM
There are various ways to query what is connected to the controller through DAQmx driver calls. It depends on the language you are programming in but basically you find out what hardware in connected and then look for the serial number of the instrument you are trying to find. The serial number will be a unique identifier and will not change. Once you find it, you then set a variable to the name and use it. You want to also try naming the peripheral something other then the default /dev1 and see if that helps it keep its name once re-connected.
09-29-2011 01:51 PM
I am using LabVIEW 2010 and the software is written to reference 'Dev1'. I know I could rename Dev1 and the references to it would change, but when the software is started without the hardware being connected, LabVIEW or MAX will create a simulated device of the same name, right?
What I need to do is find the hardware (by its serial number will be fine, but the ability to differentiate between real and simulated would be better) and, if necessary, delete the simulated device reference and rename the hardware device reference.
Jeff
09-30-2011 06:41 AM - edited 09-30-2011 06:42 AM
I don't remember MAX creating simulated devices on its own but I could be wrong (or I just never noticed). If these simulated devices are being created automatically and they are being created with the default name of /dev1, I would definitely rename the actual device to something more descriptive (DAQ1, USB6008, etc). That would make it easier to find the correct hardware. Also, the simulated devices have a serial number of 0x00 so you can use that to determine real from imaginary. Can your software run without the hardware being connected (i.e.. You can run it do do some tasks and only need the hardware to do the complete task) or is it non-functional without the hardware? In either case, it would be good system design to add some intelligence to the hardware discovery section of your code to find the real hardware and ignore the simulated.
09-30-2011 12:47 PM
@Tom Sedlack wrote:
In either case, it would be good system design to add some intelligence to the hardware discovery section of your code to find the real hardware and ignore the simulated.
That is precisely what I want to do, and why I asked for help doing it in this forum. I can't find anything in my two text books that addresses the issue and LV's Help section leaves a lot to be desired.
Jeff
09-30-2011 03:29 PM
Jeff,
MAX does not automatically simulate devices on its own.
Also, LV can tell if a device is simulated. There is a knowledge base article on it here.
Katie
09-30-2011 04:52 PM
Katie:
The link you posted is bad.
-AK2DM
10-03-2011 06:40 AM
Check here on how to read the serial numbers of DAQ devices. This should give you a good start. I haven't tested this as I don't use NI hardware much anymore.
10-03-2011 10:55 AM
The information in that link does not work in LV 2010. Attempting to load the supplied VI fails as the Get DAQ Device Information VI cannot be found.
10-03-2011 03:41 PM