What's new
What's new

Mazatrol 640T This program has performed an illegal operation and will be shut down


Sep 20, 2022

About a week ago I switched on my QTN 200 after it had been sitting for a few weeks and it came up with an alarm in regards to 378 battery malfunction turret due to the battery being below critical voltage. I swapped out the battery and went through the steps to fix the alarm.

After that issue the machine was running fine until I switched it on the next day and it came up with the following alarm at start up "this program has performed an illegal operation and will be shut down''. I was able to get the alarm to go away two or three times by doing a disk scan via the windows interface. Now it won’t go away.

Windows appears to be running okay.

Once windows is open if I try to open Mazatrol I get the M6SdgShrmem is failed on getting disposal iStatus 5 iSubStatus 5.

The Red PS emg light on the back of the Control is red and the Numbers on back are cycling from 2 through to 8.

The battery in the back of the control is reading about 3.7 volts so it seems okay and the battery light is not on.

We did a scan disk via MSDOS. While doing this the work light near the turret started randomly switching on and off along with some contactors. Even after we closed windows down it continued until we switched off the power to the machine. We have switched it on a bunch of times and it has not done this again so far however you can hear a contactor or two switching a few moments after starting the NC unit. I think when the machine was running properly you didn’t hear any contactors until a few seconds before mazatrol was running and the turret was ready to be homed.

Our machine does not have a defrag option loaded on it but we are working on it. Just need a way of transferring data in larger quantities than a floppy disk can handle.
I have been reading forum threads with some similarities to my problem and I am learning what I can from them.

We are working on backing up or cloning the hard drive as I guess the next step will be one of the following Re-initializing the NC, replacing the hardrive or nc unit

I have spoken to a helpful mazak technicain and he suggested I backup everything and send the hardrive and nc unit to him for testing. Before I send the units I thought I would see if anyone has any other suggestions.

Below are links to videos in regards to the issue

Any help would be appreciated.


  • This program has performed an illegal op1.JPG
    This program has performed an illegal op1.JPG
    318.4 KB · Views: 6
  • failed on getting disposal.JPG
    failed on getting disposal.JPG
    346.3 KB · Views: 5
try to clear your NC RAM memory and re-initialize your control. may be you lost NC parameters. If you want to do it yourself, I can send you a procedure. No harm in trying. All you are about to loose is your machine parameters. Hopefully you have them saved somewhere.

When it comes to your MR-J2 drive, it complains about NC not talking to him:


S1 36 Communication
timeout, NC

with the NC
was cut off.


The bus cable
connection was


The NC power
was turned

Turn the NC
power ON.

The amplifier
or NC is faulty.

Replace the
amplifier or NC


  • Untitlesadasa.jpg
    90 KB · Views: 11
Last edited:
Thanks for your reply Noname77. If you could please send the procedures for re-initializing my control that would be great thank you. In the mean time I'll check bus cable SH21 and the amplifier. A bus control tab appears at the bottom of the screen if that means anything. Before I try re-initializing I am thinking I should save what I can to an external device. My machine does not have a floppy emulator at this stage so we are working on how to transfer this quantity of data. Floppy disk does not have the capacity. I can't find much information about the card that goes in the slot besides the liquid crystal control panel screen. Maybe it can hold enough data however I don't have one and I guess it will take a while to get hold of and be expensive if its mazak specific. Thanks again for your help.
See if you can use MAINTENANCE tool to back up your SRAM data, it might help you later on.
Second PDF is RAM clear procedure.
See if you can go through both of them


  • _Mazak Fusion 640M Pro How to Backup and Restore SRAM.pdf
    1.2 MB · Views: 14
  • Mazak Fusion 640 Series SRAM Data Clear Procedure.pdf
    6.5 KB · Views: 14
Did you disconnect the ribbon cable to get to the battery? More important is if you re connected that ribbon cable AND flipped the cable locks. I know from experience that the cable can loose a connection if not locked. Then that dreaded message and a lot of stuff on the hard drive and controller gets toasted. I had to load backups for a lot of programs even though windows could see them on the hard drive, control could not.
G'day Scruffy. Thanks for your advice. That's handy to know. I didn't disconnect the ribbon cable but I will check it to make sure it hasn't come loose. It was the battery in the electrical cabinet at the back of the machine that I replaced so I didn't need to touch the ribbon cable.

I am waiting on some gear to make up to date backups. At the moment the only way I can transfer data to an external device is via floppy disk. I should have already sorted this out (Beginners error). Once I have backups I will try re-initializing as No name777 suggested. If that dosn't work I might have a go at cloning the hard drive to a SSD hard drive and see if that works. If I still have no luck I might send the NC unit to my local mazak dealer as they suggested so they can check it over. If they find a problem that will probably be an expensive option.

It could be just a coincidence or maybe this issue is related to the battery going flat or the process of fixing the alarms caused by the flat battery. Another thing, I was using the tig welder with HF frequency start while the lathe was running. I know this can effect electrical equipment although it did not appear to affect the lathe while it was running and I would assume an industrial machine like would be able to handle this. However I am wondering if and electrical component was on its way out, could the hf frequency from the tig welder have hurried up the process of the component failing.

Thanks again for your help Scruffy and Noname777
I am hoping to backup the Sram before I get the HDD out and clone it. Because I can't open mazatrol I can't save the Sram files using the standard procedure. Does anyone know if there is a way to do this without opening mazatrol 640T on Windows 95? We tried saving via Mainte.exe found in windows explorer (I think) but it wouldn't run. I assume Mainte.exe is related to Mazatrol.

There are PLC ladder and parameter files on C drive which date back to when the machine was new. We have saved these to a USB stick but if I understood correctly a Mazak tech told me the original data might be out of date. Computers are not my strong point so please forgive me if I don't know what I am on about.

Once we have backed up what we can I plan to try the re-initializing the NC and if that's no good try cloning the hard drive to start eliminating possible causes.
I think it’s quite odd that the contactors labelled KM1 KM2 KM3 KM4 in the attached photo were randomly opening and closing every 10 - 20 seconds when the NC unit was switch off (as well as when it is on). I am wondering if the NC unit could cause this to happen when it’s switched off e.g it’s still communicates with contactors when it’s switched off. If not then maybe the problem is coming from another source unrelated to the NC unit e.g something that can cause these contactors to open and close even when the NC unit is off.

Last night when we started the NC unit Mazatrol briefly booted up for the first time in a few weeks. I was able to home out the axis is and jog. Then after a brief moment of glory the four contactors KM1 KM2 KM3 KM4 started randomly opening and closing and the PS emg light intermittently started coming on and the number 9 changed to scrolling from number 2 -8 in the back of the control. This coincided with the contactors opening and closing. When number 9 was up and PS EMG was off I think the machine was ready to run. So it was intermittently ready to run and then not ready to run.

I started looking for a loose connection e.g carefully wiggling wires to see if I could trigger it to kick in and out but it appeared that all the cables I tried had no effect.

Attached is a pic of the four contactors.


  • Contactors.jpg
    92.5 KB · Views: 4
If anyone knows of someone who is an expert on diagnosing and fixing Mazak 640T controls and related systems who would be happy to be paid for advice please let me know. Someone located in Australia would be ideal but if not anywhere in the world will work.
KM 1,2,3,4 are operated by SAFETY RELAY (A35) unit. No one knows what this A35 does when NC control is malfunctioning. KM1 and KM2 are spindle LOW/HIGH gear switchover. KM3/4 are MS configuration.

You have to do "SRAM clear" even if you don't want to. Parameters and other data probably saved on you HDD in BACKUP folders as installers normally would do SRAM back up and save parameters on HDD during m/c commissioning. Dont worry about parameters, local dealer can get original ones from Japan if he wants, or find a similar machine and give you another set of parameters ( very close to your configuration). They know how to manage it.

you aren't missing a phase by any chance? all 3 phases are connected to the electrical cabinet?
you need to check all DC and AC voltages before you start pulling everything apart and sending it to your local dealer.
Thanks Noname777 for your advice. All 3 phases are connected to the cabinet but I'll see if I can confirm there is no loose connection and check DC and AC voltages
I agree w noname777 - clear the ram.

Cloning the hard drive will go OK with acronis. pull the drive get a USB to ide cable $10 on Amazon, plug the mazak drive in and you can clone or copy all the files, some are hidden. To my knowledge the OEM drive is the only one that will actually boot mazatrol on the control. Some type of registration process is required to use different drive-I was not able to get through it. The Mitsu tech had no issues but he did it super fast and I didn't see how.
Our 640's HD was on the way out and we started having issue like you describe. Failure to boot, and other odd behavior, the old w95 replacement drive was "not available" and we had to "upgrade" to the w2000 system with the SS hard drive.
It all worked out but wasn't cheap-available directly through MEAU.
I would get all your data- 1st run a repair/recovery on the original drive-attached by USB to functioning computer(we kept w w2000 around for the purpose), clone it. Then try the original again.
G'day Bob and Noname777. Thank you very much for your advice. That is very handy. I have the USB to IDE cable and plan to clone to another hard drive. I checked the 3 phase voltage as Noname777 suggested and I'm getting approx 400 volts per phase.
the problem with cloning is this: you want to be sure your NC controls motherboard can recognize new HDD. BIOS needs to support it.This info is for 640M control, your NEXUS probably has different BIOS configuration.

The following details are for a 586 processor with a 2.0 gigabyte drive
Plug in a keyboard and power on. You will see the following on the display:
Copyright (C) Seiko Epson Corp. 1997
All rights reserved
CARD-PC Version- PC010-*
032384 KB- OK
To get to setup Press F10 from this screen and you will get into the Cmos setup display.
See below for details:

Hard Disk Drive Setup Screen
CARD-586 SETUP (C) Copyright SEIKO EPSON Corp. 1997
Primary IDE (1F0h) = <Enable>
-----------------------------------------cyl. head sec. size(MB)
Master [Auto detection LBA ] 4200 16 63 2167

Slave [No drive ] ------- -- -- ------
<External IDE controller support>
*Secondary IDE (170h)= [Disable ] *CARD-PC does not have this I/F.
Press Enter key to [Set and exit ] at this choice
Tab/ ^ / \/: Move cursor, Enter:Select, Esc: Cancel, F1:Help
Note:Do not change anything on this page

The following details are for a 486 processor with a 540 megabyte or a 2.0 gigabyte drive
Plug in a keyboard and power on. You will see the following on the display:
CARD 486D4 BIOS Version1.24A.023.01.02
Copyright (C) Seiko Corp.1996
All rights reserved
Card PC version- PC004-A
To get to setup Press F10 from this screen and you will get into the Cmos setup display.
See below for details.

HDD (hard drive settings)
Drive type = type 1 or auto detection
Number of cylinders = (4200)
Number of heads = 16
Number of sectors = 63
Capacity = 2167 MB
Drive type = [No drive]
Number of cylinders = ----
Number of heads = ----
Number of sectors = ----
Capacity = ---- MB
ATA boot = [Disable]
Press Enter key to [Set and exit ] at this choice
Last edited:
Thank you very much for all that info Noname777. It looks like you put quite a bit of time in to putting that info together.

Strangely enough Mazatrol and machine ran without any problems yesterday evening so I took the chance (maybe risking hdd failure) to make some parts and worked it in to the early hours of the morning. We saved sram data to the hdd. The hard drive is out of the machine know and we have made various backups and an image with Acronis. Now that we have backups I plan to see if I can get the machine running with the original hard drive, make some parts over the weekend, get some breathing space (make customers happy) while we prep a new ssd and then have a crack at getting it to work.
I'll let you know how I go.
Thank you both again for all your advice so far its been a great help.
I am under impression that all this is part of a bigger conspiracy. Call it whatever you want. Fanuc hardly ever uses Windows based NC controls, Fanuc controls hardly ever fail. All these funny Okuma and Mazaks windows based NC controls always involved in one or another drama scenario. Windows was never designed to have real time application to be run on it, as Windows has all these processes prioritized in weird way. I think "someone" told Japanese if they wanted to penetrate USA machine tools market they just have to buy licensed Windows product.
Maybe your on to something noname777. Some people get up to tricky things when there is bulk coin involved.

I'm learning cnc machines can take a lot of time or money when they are down but give it back when they are up and running. When machining 1/2'' bsw thread on 316 round bar the best I could do on the manual lathe was about 18 minutes per piece including a seperate process of facing and chamfering the end (I'm sure the old timers could do better). I was only getting about 20 threads before my insert was warn out (The cross hole through the deep thread didn't help). My cnc lathe did a better job in 33 seconds with no sign of the insert wearing out. I'm sure most others could make it happen even faster but I was very happy with 33 seconds.
Here's and updated on progress.

We had two goes at cloning two different ssd hard drives and managed to get the lathe to run after the second attempt however the problem with mazatrol performing an illegal operation and shutting down remains unchanged (The SSD may be very handy in future though).

I have been able to get my lathe to run after I warm the NC unit up with a hair dryer. The coldest temperatures I get in my shed is about 5 degree c but I need to warm the NC unit up even if its 20 degrees c or if the lathe has been running for hours and I shut it down and start it back up a few minutes later I still need to heat the NC unit up although to a lesser extent.

I was wondering if there was a heating element for the NC unit to avoid condensation at startup (I think there is one for the HDD on the outer case) however if there was, it wouldn't make sense that this is the problem as the problem persists (although to a lesser degree) when the machine is warm and has been running for hours. Unless the NC receives a signal that the heating element has not run and shuts down regardless of temperature. This may not make sense either because temperature does play a roll in getting it running. Anyway I thought I would mention this just encase someone has had a similar problem or this info helps someone one day. I'll try to narrow down to which circuit board is sensitive to low temperatures