04-28-2011 12:54 PM
Hello,
I'm hoping there is a set of best practices out there surrounding this question, but I've searched around a bit and can't seem to find it 😞
I want to build an executable and an installer from a LV application that references DAQmx devices. On my development machine I can easily match up "Dev1" or "Dev2" or whatever alias ("6229" or "6050") I want with the corresponding device in MAX.
I would like to build this application, put it on a new, clean machine, install the LV Runtime Engine and the DAQmx runtime engine and still have users be able to select the device they would like through the executable without installing MAX and having to ensure the names are the same. I'm thinking they should be able to drop down a selector on the executable, see the NI device model number (e.g. PCI-6229) and select that without ever going to MAX. The obvious question would be how to ensure that device enumeration and alias matching on the new machine matches that on my dev machine without having the user import a MAX config file, manually edit MAX, or even install MAX.
Am I thinking through this correctly? Is there something I'm overlooking? Any suggestions?
Thank you!
04-28-2011 02:05 PM - edited 04-28-2011 02:05 PM
I don't know about 'best practices' for this sort of thing, but here are a couple things that might help you out:
It is possible to list all DAQmx devices through programmatic APIs. For instance, to get all the device types in the system and their names, you could use the DAQmx System: DevNames property to get all devices, and then use the DAQmx Device properties to get information about them. For example:
You could do something like this at startup to figure out what device name corresponds with the device type (like 'PCI-6229' in your example) you want.
If you didn't want to keep track of device names, you could also rename them programmatically so that you can make sure your PCI-6229 is always named '6229' or similar. It's a little more complicated, but you can do so with the System Configuration API. Here's a simple example:
You might want to look at the Hardware Input and Output/System Configuration folder in the LabVIEW Example Finder to see what else is possible (for instance, programmatic import of MAX configurations).
04-29-2011 06:25 PM
Hi bstreiff,
Thanks for your reply! I haven't had a chance to try it out but it looks promising. I'll try it this weekend and let you know how it goes!