Back to CNC Alarms Guide

Fanuc PS0010 alarm: G/M code or format not allowed

PS0010 is Fanuc's illegal code warning: the program interpreter has read a block containing a G code, an M code, an address or a format it cannot execute in the machine's current state. It is not a fault, it is the control telling you it does not recognise what you are asking for. It always stops on the same block, and it will keep stopping there until you fix it.

For reference only: alarms change with the manufacturer, the control and the machine PLC. Check the full code in the official manual before doing anything. Legal notice.

Control
Fanuc
Machine
Milling, Turning, Mill-turn
Area
Program
Severity
Stop

Symptoms

  • The program stops when reading a specific block.
  • The alarm always appears on the same line.

Common causes

  • G-code not supported by that Fanuc series.
  • Parameter or address incompatible with the active cycle.
  • Post-processor configured for another control.

First safe checks

  1. 01Note exact block of the alarm.
  2. 02Compare the G/M code against the manual for the installed control.
  3. 03Test in simulation or single block before automatic cycle.

What not to do

  • Don't delete random lines without understanding the function.
  • Do not run the program from halfway without checking active modal.

When to call maintenance:

If the code comes from a standard post and fails in several programs or after parameter changes.

Reset/rearm:

It can be reset after correcting the block and returning to the safe start of the program.

Fanuc varies by series and installed options; validate against the exact programming manual.

Official documentation

Choose the manual matching your control series, software version and machine builder. A support portal is a starting point; it does not establish applicability to every model.

What happens on the machine

The control does not execute a program letter by letter as it moves. Before any motion is generated, the interpreter breaks each block down into words (an address letter plus its value) and validates them against three things at once. First, the G code table for each modal group in that series. Second, the software options actually purchased and enabled on that particular CNC, which are never the same on two machines with identical-looking screens. And third, the modal state the machine was left in at the end of the previous block: active plane, canned cycle still open, compensations applied, work coordinate system. If the word does not exist in the table, or it exists but belongs to an option that is not installed, or it exists and is installed but contradicts the live modal state at that instant, the interpreter aborts block preparation and raises PS0010. That is why the alarm appears with the axes standing still and nothing damaged: the machine stopped during the read phase, not during execution. And it is why the same program that runs fine on the machine next door fails here: the code exists in that series or with those options, and not in this one.

Step-by-step diagnosis

In order, from the fastest and cheapest check to the most expensive.

  1. 01Copy the whole block, not just the code you suspect

    The control leaves the cursor on the block it could not interpret. Careful: with look-ahead active the cursor can sit one or two blocks past the real fault, because the interpreter runs ahead of the motion. Write down the complete line and the two before it. The problem is often not the G code that catches your eye but an address at the end of the same block.

  2. 02Decide whether it is an unknown code or bad formatting

    If the block contains a G or M that does not appear in the code list in the programming manual for your series, it is a code problem. If the G exists and you use it every day (G01, G90, G54), it is formatting: a letter repeated twice in the same block, a value with no decimal point where the control expects one, a stray sign, an odd character that crept in when the file was edited off a USB stick. Fixing formatting takes minutes; fixing a code that calls an option you do not own is a different story.

  3. 03Check which modals were active when it got there

    The control's modal display shows the active G code of every group. The classic clashes: a move programmed with a canned cycle still open and no G80, a plane change inside cutter compensation without cancelling with G40, rigid tapping called without closing the previous mode. If it does not fail when you start from the top of the program but does fail when you start mid-program, it is definitely modal.

  4. 04Confirm the option is installed on that machine

    Custom macro, high-speed and surface machining cycles, C-axis functions, on-machine probing: those are all purchased options. The control's system screen has a list of enabled options (the screen name changes between series; look for the option list or system configuration). If the function is not listed, the code will never work no matter how you rewrite it: either you change the programming strategy or the option gets bought.

  5. 05Compare against the post processor that produced the program

    Open another program that does run correctly on that same machine and compare the header and the way cycles are written. If the failing one has a different style, a different post generated it or somebody edited it by hand. A post pointed at the wrong machine is the number one cause of PS0010 in batches.

  6. 06Dry run it before going back into production

    With the block corrected, go back to the start of the program, put it in single block with the spindle stopped and the axes clear above the part, and let it read through the area that failed. If it passes cleanly, you are done. If it stops on another similar block, the problem is systematic in the post and it has to be fixed in the CAM system, not at the machine.

Typical cases

The program runs on one machine in the shop and throws PS0010 on the other, and both are Fanuc.

It is almost always different options or a different series, not the program. Confirm it by comparing the option list and the series version on both machines' system screens. Typically the failing one lacks the macro or advanced cycle option the program uses. The fix is one post per machine, not one post for all of them.

It suddenly started failing on programs that had run for months, right after a CAM update.

The post changed the way it emits some cycle, or introduced a new code. Compare an old saved program against the newly posted one for the same job: the difference jumps out in the header or in the cycles. Fix it in the CAM system and re-post everything currently in work.

It only appears when the operator restarts the program from the middle after a stop.

It is modal: jumping into a block halfway through means the control never read the G codes that set the plane, the units, the compensations and the work coordinate system. It is confirmed by the fact that it does not fail from the top. The shop-floor answer is to place safe restart blocks every few operations, with the full modal state written out again.

How to stop it coming back

One post processor per machine, built around that machine's real options, and no reusing another machine's post without a dry run first. Put a full cancellation line in every program header (units, plane, G40, G49, G80) so nothing modal is dragged in from the previous job. Have every long operation or subprogram start by restating the plane and the work coordinate system as well, so restarting from the middle is safe. And keep a reference program per machine on the server: when something starts failing, comparing against it is the fastest diagnosis there is.

Frequently Asked Questions (FAQ)

What does alarm PS0010 mean on Fanuc?

The Fanuc control detects a program block with an invalid command, address or format for the active mode. It is an alarm from the Program area, and in the catalog it is listed as “G/M code or format not allowed”. On the machine you notice it like this: The program stops when reading a specific block, The alarm always appears on the same line.

Why does alarm PS0010 come up?

On the shop floor it almost always comes from one of these causes: G-code not supported by that Fanuc series, Parameter or address incompatible with the active cycle, Post-processor configured for another control. Rule out the most likely one on your machine first, before touching parameters or swapping anything.

How do you clear alarm PS0010?

It can be reset after correcting the block and returning to the safe start of the program. Resetting without fixing the cause first only hides the problem: PS0010 trips again and, in the meantime, you keep working with the machine in bad shape.

What should I check first with alarm PS0010?

With the machine stopped and in a safe state, start with these checks: Note exact block of the alarm, Compare the G/M code against the manual for the installed control, Test in simulation or single block before automatic cycle. That alone will tell you whether it is the program or whether you need to raise a maintenance job.

What should I NOT do with alarm PS0010?

With PS0010 active, avoid this: Don't delete random lines without understanding the function, Do not run the program from halfway without checking active modal. Skipping any of these points is what turns a minor stop into an expensive breakdown.

When do I have to call maintenance for alarm PS0010?

If the code comes from a standard post and fails in several programs or after parameter changes. If you are not sure how far it goes, stop the machine and report it: a repeat alarm always works out cheaper than a crash.

How serious is alarm PS0010?

It is a stop alarm: the cycle will not continue until you fix the cause. It does not always mean serious damage, but it leaves the machine where it is and you have to check it before running again. Fanuc varies by series and installed options; validate against the exact programming manual.

More alarms for Fanuc

See all alarms for this brand

Related tools