04-17-2013 03:30 PM - edited 04-17-2013 03:31 PM
I don't know why but I thought that was bold when I looked at that input...
"I generate a task based on a xml file stored on the PC. That can be change by any program, and the program can be moved to different PC's with different configuration files. I have build-in configurator to the program that can create or change these xml files."
Nice! That's what I'm going for but I'd like to go even farther and have it implement that task on a specific device that it has never seen before.
In the SW I'm workring on I use an ini file to provide parameters (like IP, port, etc) for the non-usb networked hardware my software talks to. With the network based (TCPIP) hardware I use, all I would have to do to swap one out is just replace it, and slip the new IP into the INI file... I'd like to get the same functionality with an NI USB device (only with USB I'd put the serial in the ini file).
It's not so much that I'm changing devices often, but it would make the operation of replacing a device simpler, and it wouldn't require knowledge of MAX, that's all.
also I'm mostly just reffering to the USB 65XX series devices with this particular application.
Thanks
-Pat
04-17-2013 03:50 PM
Or you could still but the name of the USB device in the ini, like Dev1, Dev2 or Dev3...
And if you don't like the MAX to get the right names, the make your own vi that shows every USB connected to the PC.
Try to make use the nodes under DAQmx->Advanced->System Setup.
That will be my best guess.
Some way or the other something has to be changed in the ini file when you add or replaces a device.
04-17-2013 03:53 PM - edited 04-17-2013 03:55 PM
I do something pretty similar but with a configuraiton utility so users don't have to manually edit the .ini file. It does the following:
Uses the System Configuraiton API to detect the DAQ devices in the system that would be compatible with the main application (I use some of the various DAQmx properties to determine compatibility based on the featuers I am using).
If zero devices found, reports this to the user--if one device, asks user to confirm this is the device he wants to use--if more, gives a list of devices and prompts user to pick the desired device.
Writes the NI device name to the .ini file so I know the device I expect to use. NI software actually does some clever things with default device names sometimes (e.g. replacing a C Series module with a new one will re-use the old device name) so I wanted to leverage this when possible. I don't overwrite the device name (or expose it to the user at all outside the .ini file itself). The other reason for this is if somebody does have MAX installed and wants to name their devices a particular way, I don't want to override them (I guess you could probably determine programmatically if MAX is installed somehow, but I didn't see much of a point in renaming devices anyway).
The main app calls into the configuration utility if the device in the existing .ini file is not available when I need to build a task. I only mention this because it sounds like you might be looking to implement something like this.
Best Regards,