Switch Hardware and Software

cancel
Showing results for 
Search instead for 
Did you mean: 

MAX virtual device error

Hi,
 
I've managed to create a corrupted virtual device in Switch Executive. I think I did this trying to save a virtual device to a network drive using Max 4.0 (I now realise after reading this forum that this bug/feature is fixed in Max 4.1). Reading through the forum it appears several others have done the same thing.
 
However, the question still unanswered is..... how do we delete a corrupted virtual device in Switch Executive??? Trying to delete the virtual device using the normal menus simply raises an exception in Labview.
 
Do we simply create a blank mxs file (found in ProgramFiles/National Instruments/Max/Data/) or is there an application that can regenerate this file? Note that I've saved my desired configuration to a local drive successfully, so can afford to completely erase all the current virtual devices.
 
Regards,
Tom
0 Kudos
Message 1 of 8
(8,277 Views)

Hi Tom,

As you already know, this issue appeared with MAX 4.0 and it is fixed with MAX 4.1. The previous workaround was to export your configuration locally and copy it manually to the network location.

It is possible that the crash might have permanently corrupted your mxs file system stored in the data folder. To restore a clean data folder follow the steps below: FOLLOWING THESE STEPS WILL DELETE EVERY CONFIGURED ITEM IN MAX (NISE CONFIGURATIONS, DAQMX TASKS, VIRTUAL CHANNELS). Excel needs to be installed to use this procedure.

1. Export the configuration to Excel using the NISE Excel example GenerateExcelReport.xls (Program Files\National Instruments\Switch Executive\Examples\Excel)
2. In the command prompt type (with MAX closed) : net stop mxssvr
3. Delete the MAX Data directory (Program Files\National Instruments\MAX\Data)
4. Reboot your computer
5. Import your xls file created in the first step using the example: ImportFromExcel.xls

Note: You may get an "Invalid resource name" error when you attempt to import your xls file. This will occur if Hardware Assets do not match DAQmx device names. Deleting the MAX Data directory forces your system to redetect all your DAQmx devices. All the devices will be reverted to default names, usually PXI_Slot_ or Dev_. If the Hardware Asset for any device differs from it's DAQmx name, simply right-click on the device under NI-DAQmx Devices to Rename it so they are the same.

The following two steps will allow you to export the configuration to a network drive.

6. Export the configuration to your local drive by right clicking on the configuration
7. Copy the exported NISE configuration from your local drive to your network drive

Let me know if you have further questions or if this does not resolve your issue!

Chad Erickson
Switch Product Support Engineer
NI - USA

0 Kudos
Message 2 of 8
(8,272 Views)

Hi Chad,

Thanks for the detailed reply. A couple of additional questions...

1/ The machine I have the problem on is a factory production machine, which doesn't have a copy of Excel installed. Is it possible to simply copy the entire MAX/Data subdirectory to a machine that does have Excel, then copy the repaired directory back when I've completed the process?

2/ When I try to run the "ImportFromExcel.xls" spreadsheet I get a runtime error whenever I move the mouse over any of the buttons or the dropdown box (the ones contained inside the yellow border). The error reads "compile error in hidden module: Mainsheet". Any ideas what I've done wrong?? The "GenerateExcelReport.xls" runs fine.

Regards,

Tom

0 Kudos
Message 3 of 8
(8,265 Views)

Hi Tom,

The only reason to have Excel installed is to facilitate the creation of a backup Switch Executive configuration.  I notice in your first forum post you've already saved your desired configuration to a local drive sucessfully, so I was incorrect in referencing Excel in any way in the recommended procedure.  Instead, the aforementioned procedure should have been the following:

1. With MAX closed, type in the command prompt: net stop mxssvr
2. Delete or rename the MAX Data directory (Program Files\National Instruments\MAX\Data)
3. Reboot your computer
4. Open MAX (this will recreate a default Data directory)
5. Import your saved Switch Executive configuration 

In response to your first question, I've never attempted copying the MAX/Data subdirectory from one machine to another, and therefore would not recommend it to any customer.  It would be an interesting test, but I would recommend having the same software versions installed on both machines.  Let me know if you need me to test this solution in order for you to fix your issue.  As to your second question, so far I've been unable to reproduce this runtime error.  I've not yet contacted the developer of the example, but that is my next step if necessary.

Chad Erickson
Switch Product Support Engineer
NI - USA

0 Kudos
Message 4 of 8
(8,250 Views)

Hi Chad,

Sorry for the confusion. I've actually got two machines setup, one with a corrupted "virtual device", and another that is ok. I was experimenting with the Excel export on the good machine just to see how it would work.

I've followed your instructions re deleting the Max/Data directory on my corrupted machine, and this worked perfectly. I was also able to import my original "good" virtual device settings I had saved before I deleted the directory. Thanks for your help :-)))

Re the Excel bug: I don't actually need to used the Excel sheet anymore, as deleting the directory solved my problems. However for general interest I have more information on this.

It initially throws this exception error

"Runtime error 40036. Application defined or object defined error".

After you press END, it then starts raising the errors "compile error in hidden module: Mainsheet" when you move the mouse over the buttons. I'm assuming the 40036 runtime error is our clue. Should I shutdown the mxssvr server (or some other server), before I attempt to import the excel data?

Regards,

Tom

0 Kudos
Message 5 of 8
(8,243 Views)
runtime error 40036 does not have anything to do with the mxs server. It is MS error raised by the form that was not ready when you tried to access it. Putting delays or retrys may fix the issue. ( I googled the error 40036 and found many instances of it in Office applications, and most articles indicated the intermittent nature of the error).

One suggestion there was to catch the error, compare the number to 40036 and ignore it (!?) - seemed to work for some people. If this is really a timing issue for you it may work assuming that you test it and it works. Alternatively, you can trap the 40036 error and try again multiple times (give it some time, or a fixed number of iterations to retry).

Hope this helps.

-Serge
0 Kudos
Message 6 of 8
(8,238 Views)
Hi Tom,
 
Is Excel running before you open the example?  Perhaps opening Excel on it's own first, and then opening the example will fix the issue.  However, this suggestion will be of no assistance if this is what you are already doing. 
 
I also decided to google the error and found the following:
 
This user was able to work around a problem with the same error by creating a new workbook and copying and pasting the data into it.  This user even named the sheets in the new file the same as the old file.  Let me know if either of these suggestions assist you!
 
Chad Erickson
Switch Product Support Engineer
NI - USA   
0 Kudos
Message 7 of 8
(8,233 Views)

Hi Chad,

Yes, Excel is open before I load the workbook. I can't even view the visual basic code to debug it as the project appears to be locked.

I'm not too worried. I've fixed my immediate problem using your last email. However this may be something someone else has problems with in the future.

Regards,

Tom

0 Kudos
Message 8 of 8
(8,226 Views)