01-26-2009 03:30 PM
Is there a way to set/change the device number for a PCI DAQ board without using NI MAX?
Specifically, I have a DAQmx 8.71 Runtime 5 installed, which does not include MAX.
Thank you!
01-26-2009 04:28 PM
Hello Zador,
What programming environment are you in? I believe this property is read-only from LabVIEW, but you can run this simple VI to obtain the device number.
NI-DAQmx: Find DAQ Device Resource Programmatically
For CVI, you would use the DAQmxGetDeviceAttribute function.
Is there a particular reason you need to programatically set the device number? Usually, you will install the DAQmx runtime on a deployment machine. On your development machine, you should use MAX to configure the device and write your code. Again, I don't believe we have a way to set the device number with the DAQmx API other than through MAX. But if you could shed some more light on your specific needs, there may be a suitable workaround.
01-27-2009 07:02 AM
Thank you for a speedy response! My programming system is LabVIEW 8.5.
You are right, I don't think device number (resource name) can be changed programmatically. I was thinking, rather, of means to change it through Windows or some lower level NI utility or just by editing some configuration file. I think it's a problem if there is no way to do it under DAQ Runtime. Here are two scenarios in which I had to change device numbers previously:
1. Replacing DAQ card. The first card inserted is always Dev1. If I remove it and put in another one, it becomes Dev2. Dev1 remains reserved for the original card. The find_daq.vi that you sent a link to (thank you!) can be used to resolve this situation. I would still prefer to reassign the device number in order to stay consistent system-to-system.
2. Multiple identical DAQ cards. I would like the device numbers to match the order of the PCI slots, left-to-right. I haven't yet figured out how the default numbers are assigned. Currently, I have to connect an input to each card in order to identify which one is which. Then I would set the device numbers accordingly. I guess I should be able to sort them out programmatically if I could quiery PCI slot number for each card. Something to look into.
Thanks again! Zador.
01-27-2009 09:28 AM
Hey Zador,
At the lowest lowest level, these device names are stored in a database in the MAX/data directory. I suppose you could write a program that edits the INI file, but this would not be supported. You might also be interested in taking a look at this thread.
Have a great day!