Back to CNC Alarms Guide

Fanuc PS5111 alarm: Improper modal G-code

The control has found a modal G code that cannot coexist with the advanced mode that is active, typically something related to high-speed machining functions and look-ahead. It is not that the code is written wrongly: it is that it cannot be there at that moment.

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, Mill-turn
Area
Program
Severity
Stop

Symptoms

  • Alarm when activating advanced mode.
  • Fails with G05.1/look-ahead or high speed.
  • May depend on previous modal states.

Common causes

  • Incompatible G-code active.
  • Do not cancel previous mode.
  • Post-processor not adapted to the control.

First safe checks

  1. 01Check the modal states before the block.
  2. 02Cancel advanced modes when applicable.
  3. 03Validate the post for that Fanuc.

What not to do

  • Do not bypass safety devices.
  • Do not manipulate energized electrical cabinet.
  • Do not continue producing if the alarm reappears.

When to call maintenance:

If the installed option does not match the documentation or configured post.

Reset/rearm:

Reset after correcting the modal sequence.

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

Advanced machining modes change the way the control prepares the path. Instead of executing block by block, it reads many blocks ahead, works out how to link them while smoothing corners, distributes acceleration and decides feed rates so the machine does not jerk. To do all of that it needs the block flow to be predictable. Certain codes break that predictability: those that force the control to flush the buffer and wait, those that change the coordinate system or the compensation midway, canned cycles, and those that introduce run-time decisions. When one of those appears with the advanced mode active, the control cannot guarantee the path it had calculated, and rather than do something unpredictable with the tool inside the part, it stops and warns. That is why in practice this alarm almost always means the same thing: a block cancelling the advanced mode is missing before doing something that mode does not allow, or the program enters the advanced mode without closing what was already open. The other side of it is the post processor: when the post is not adapted to the functions that machine has, it emits the activation and cancellation sequences in the wrong place, and then the failure always appears at the same points in the program, typically at operation changes.

Step-by-step diagnosis

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

  1. 01See whether the failure falls on an operation change

    If the alarm comes up just as one operation ends and another starts, it is almost certainly a missing cancellation of the advanced mode before the tool change or the safety positioning move. That pattern repeats so often it is worth checking before anything else.

  2. 02Check the active modals at the failing block

    On the modal display, check which advanced mode is active and what compensations and cycles are open. The conflict is usually visible straight away: a canned cycle inside the advanced mode, or a compensation switched on or off without having exited first.

  3. 03Find where the mode is activated and cancelled in the program

    Go through the lines where the advanced mode is entered and exited and check that every activation has its cancellation before any operation that is not continuous contouring. If there are activations with no cancellation, the sequence is badly built.

  4. 04Confirm which functions the machine actually has

    High-speed and contour control modes are options, and not every machine on the same series has the same ones. Check the option list on the control's system screen; its name and location vary by series. If the function is not installed, the post should not be emitting it.

  5. 05Compare against a program that does work on that machine

    Take a part that runs correctly and look at how it enters and leaves the advanced mode. If the problem program does it differently, you have identified the difference and probably the post that needs fixing.

  6. 06Fix it in the post, not block by block

    If the pattern repeats across several programs, fixing it at the machine line by line is wasting your time twice. Adjust the post processor so it emits the cancellation where it belongs and re-post. The final check, as always, is a dry run before cutting.

Typical cases

It always trips at the tool change, on every high-speed program.

The post does not cancel the advanced mode before the change. It is confirmed by the exact repetition of the point across different programs. Fix it in the post, adding the cancellation to the end-of-operation sequence.

It started happening when programs that ran on another machine were brought to this one.

The other machine has different options or accepts the sequence as written. Confirm it by comparing the option lists. Fix it by posting with this machine's own post.

It only fails when the program includes a canned cycle between two stretches of fast contouring.

The canned cycle cannot run with the advanced mode active. Confirm it by checking the modals at that point. Fix it by cancelling the mode before the cycle and re-activating it afterwards.

How to stop it coming back

One post per machine, built around the advanced functions that machine actually has, and dry-run validated with a representative part. A fixed end-of-operation structure that always cancels everything open before the tool change. Each machine's option list documented and accessible to whoever programs. A dry run of the first execution of any program that uses advanced modes. And a benchmark part per machine to run whenever something in the post changes, so these things are caught in the shop and not in the middle of an order.

Frequently Asked Questions (FAQ)

What does alarm PS5111 mean on Fanuc?

Fanuc detects an incompatible modal G-code, typical in look-ahead modes or advanced functions. It is an alarm from the Program area, and in the catalog it is listed as “Improper modal G-code”. On the machine you notice it like this: Alarm when activating advanced mode, Fails with G05.1/look-ahead or high speed, May depend on previous modal states.

Why does alarm PS5111 come up?

On the shop floor it almost always comes from one of these causes: Incompatible G-code active, Do not cancel previous mode, Post-processor not adapted to the control. Rule out the most likely one on your machine first, before touching parameters or swapping anything.

How do you clear alarm PS5111?

Reset after correcting the modal sequence. Resetting without fixing the cause first only hides the problem: PS5111 trips again and, in the meantime, you keep working with the machine in bad shape.

What should I check first with alarm PS5111?

With the machine stopped and in a safe state, start with these checks: Check the modal states before the block, Cancel advanced modes when applicable, Validate the post for that Fanuc. 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 PS5111?

With PS5111 active, avoid this: Do not bypass safety devices, Do not manipulate energized electrical cabinet, Do not continue producing if the alarm reappears. Skipping any of these points is what turns a minor stop into an expensive breakdown.

When do I have to call maintenance for alarm PS5111?

If the installed option does not match the documentation or configured post. 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 PS5111?

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. Guidance reference. Always confirm the full text in the exact machine/control manual.

More alarms for Fanuc

See all alarms for this brand

Related tools