Example Code

MAX Database Corruption Removal Tool

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Other

  • Measurement & Automation Explorer

Code and Documents

Attachment

Description

Introduction

The instructions for removing MAX Database corruption seem pretty daunting and it would be much easier if there was a tool to automate the process. This VI does just that!

If you would like to know what is done to your computer by running this tool, check out Knowledgebase 4GA9TOQA: What is the Process For Removing MAX Database Corruption? MAX Database corruptions are rare, but may be caused when a system reboots without being properly shut down due to a power loss or a sytem crash. One sign that your database may be corrupt is if you click on the plus sign for a folder in MAX and if instead of expanding, the plus sign disappears. If this error occurs after installing a newer version of MAX, verify that you have already performed a reboot of your PC before proceeding.

 

Steps to Complete

This utility is provided in two different forms:

 

Executable:

If you already have LabVIEW and/or the LabVIEW RunTime Engine installed, use the executable to remove database corruption by following the prompts. If you do not have either, please download the LabVIEW 2009 RunTime Engine here.

 

Source Code:

This consists of the LabVIEW project and associated VIs that are necessary to run the main application. If you are curious about exactly how this works, this is the place to look.

 

Step by Step Guide:

  1. Ensure that NI Measurement & Automation Explorer (MAX) and LabVIEW are not running.
  2. Run Max Corruption Removal.exe OR run the Remove MAX Database Corruption VI in the source code.
  3. After the main screen appears read the description and disclaimer then click Start.
  4. A new window will appear prompting for where to save a backup of your Last folder.  Navigate to your desired folder and click Current Folder
  5. A similar window will appear asking for where to save a backup of your Data folder.  Navigate to the same folder as above and click Current Folder
  6. The next window will display the date and time of your current backup.  If that file is from a date and time when MAX worked correctly, click Yes.  If MAX was still corrupt at that time or if you want to start from a completely new MAX database, click No.
  7. There will be a series of promptings asking if you want to confirm the deletion of one or many of various files or folders. For all of these click OK.
  8. The final window will say that the MAX database corruption removal tool is complete.  Click OK and reboot your computer.

 

Additional Notes

This procedure can result in loss of data. If you have custom scales you would like to back up before attempting this repair, visit ni.com and follow the steps listed in KnowledgeBase 4XQAJPBQ.

 

This program may have to delete the Data folder in its entirety in order to remove database corruptions. All configuration settings will be lost. The next time MAX is launched, you will have to reconfigure all of your hardware again.

 

Release Notes

[9/10/10]

-Updated Code to State Machine Architecture

-Implemented Additional Error Handling

-Added ability to restart services and hopefully avoid reboots

[9/17/10]

-Made Stopping and Starting of Services scaleable for easy addition of new dependent services

[1/19/11]

-Recompiled for LabVIEW 2010

[3/7/2011]

-Added step by step guide for using this tool

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.

Comments
JC89
Member
Member
on

Thank you.

eweems
Member
Member
on

I am having this problem after upgrading to LV2011.  Will this be re-compiled for the 2011 run-time engine?

LDBM
Active Participant
Active Participant
on

Problem with LV 2011SP1 VI and exe, 2010 exe, and 2009sp1 exe. versions.

Capture.PNG

LDBM
Active Participant
Active Participant
on

Instead I used MAX : Tool>>Reset Configuration Data after making sure I first exported all my configuration (devices, tasks, channels, scales...)  as described here.

onins_05
Member
Member
on

Can anyone help me with this problem. reinstalling and cleaning the registry doesn't work.

ni_error.jpg\

thanks!

FelipeRC_Chile
NI Employee (retired)
on

Onins_05

Plase write your problem in the NI forum http://forums.ni.com/, there the NI engineers will answer it, as soon as possible.

Felipe RC
Field Applications Engineer
National Instruments para Chile, Argentina, Perú, Bolivia, Paraguay y Uruguay




(Si mi respuesta te ayudo dale click a la estrella para el Kudos)
DanRichards
Member
Member
on

Link to EXE takes me here: http://joule.ni.com/nidu/cds/view/p/id/1603/lang/en 

This is 64-bit and we are running on a 32-bit machine.

Dan Richards
Certified LabVIEW Developer
galaxyminer
Member
Member
on

"Link to EXE takes me here: http://joule.ni.com/nidu/cds/view/p/id/1603/lang/en 

This is 64-bit and we are running on a 32-bit machine"

 

Same problem here. Any answers from NI ?????

 
DanRichards
Member
Member
on

GM- no, no answers. I solved the problem I was having through another method.

 

I wonder if the minimum RTE (https://www.ni.com/en/support/downloads/software-products/download.labview.html#359526) will work for you..

Dan Richards
Certified LabVIEW Developer
galaxyminer
Member
Member
on

Thanks, I installed a later version of MAX (4.6) and was able to get the problem resolved.

gpdurban
Member
Member
on

Great! This tool solved my issue with no problems.

Roger76
Member
Member
on

Muchas gracias por su ayuda, hoy por la mañana pudimos restaurar la base de datos de nuestro equipo de prueba y en conjunto con el ingeniero Rafael Escamilla de la compañia Softest Designs pudimos resolver el problema Thanks for all your help!

opejumeys1
Member
Member
on

Windows 11, Max file are located here:  C:\ProgramData\National Instruments\MAX

All this utility really does is

1. stop these services:
         NITaggerServer
         nipxirmu
         nidevldu
         nimcdldu
         mxssvr
2. Copy the backup of config3.mxs (it will be renamed as config3.mxs.bak)
3. restart the services above

If the backup file is corrupted, then you are out of luck.  I'm curious if there are any tools to help diagnose the corruption itself and what may be causing it.