From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatic MAX Config Import Errors

I am trying to programmatically import a MAX configuration file using the MAX Copy Configuration.vi as shown here:

 

MAXCopyConfig.png

 

The above code works fine as long as the configuration that I am importing uses the same names for the devices being configured. I have a USB-4432 device that I have named "USB-DSA" within MAX; if I run the above snippet, it will update the configuration of the channels on that device (that's the only device I included in the configuration export that originally generated the *.nce file). However, if I change the name of the device (i.e. if I delete it and reinstall it and let MAX auto-generate a generic name), the import function fails. The error message I get is as follows:

 

ImportError.PNG

 

Which I assume is because user input is required to select which device to use. If I were to manually import the file in MAX, I would be met with the following dialog:

 

MAXdialog.PNG

 

So, it would seem that the programmatic import will not work because it requires user input. But, since the VI is password-protected, I can't even dig in to add dialogs or address the problem in any way.

 

Has anyone else run into this problem and come up with a workaround? I would like to be able to programmatically import a configuration without knowing a priori what the devices are named, particularly for new systems that have just installed the USB DAQ device (since I can't guarantee that the generic name given by MAX will be the same for each one).

0 Kudos
Message 1 of 3
(3,162 Views)
0 Kudos
Message 2 of 3
(3,151 Views)

Thanks for the reply. I figured that was the problem; it's a shame that there isn't a better way around the problem, without forcing the operator to open up MAX and go through the steps manually.

 

I really want to be able to have a system configure itself automatically; I want be able to ship a USB DAQ device and an installer CD with my program on it and have the end user just run the installer and plug in the device and be ready to go. I would really like to avoid requiring the operator to go into MAX at all, if possible.

 

I know I can include a MAX configuration file in the installer build, but I am afraid that I will run into the same problem. If the installer includes MAX and DAQmx, then it will need to be installed before the USB device. So, presumably, it will install the software and import the configuration, and since the USB device has not been installed yet, it will create a simulated device. When the USB device is connected, it will just be given a new generic name, and all the virtual channels included in the imported config will still be mapped to the simulated device.

 

It sure would be nice if there were a way around that problem...either to programmatically rename devices, or to programmatically handle the create/replace device dialog on config import...

0 Kudos
Message 3 of 3
(3,139 Views)