Independent CNC repair and technical reference Contact

FANUC macro interrupt return: why adding P to M99 changes the modal state after return

Published Updated

The 16i/18i-MB macro-interrupt rules distinguish M99 restoring the original modes from M99 P retaining interrupt-modified modes. An assumed common start shows why the return destination and inherited coordinate/feed state need separate review.

Contents
  1. These are macro-interrupt rules, not rules for every subprogram
  2. The same X10.0 can mean two different endpoints
  3. Adding G90 alone may leave other state unchanged

In an interrupt-type custom macro, M99 and M99 with P can differ not only in return location but also in their treatment of modal information. Checking that the destination N block exists does not establish how X, F and other values will be interpreted after return.

These are macro-interrupt rules, not rules for every subprogram

According to the 16i/160i/160is-MB and 18i-MB, MB5 series operator's manual GFZ/B-63534EN/02, §15.11, pages 446–449 (public mirror of the original manual), an interrupt signal triggers a macro interrupt, unlike an ordinary call. M99 restores the modal information from before the interrupt, while M99 Pxxxx returns with the new modes changed by the interrupt program. P identifies the sequence number searched for on return, not an O program number to call. This discussion is limited to interrupt-type macros supported by that edition and memory operation.

The same X10.0 can mean two different endpoints

An original state example assumes metric G01, G90, G94 and F600 before the interrupt; the interrupt program changes to G91 and F120. Other coordinate transformations and compensation are excluded.

Return formAbsolute/incremental mode after returnFeed per minute after return
M99Restores G90Restores 600 mm/min
M99 P700Retains G91Retains 120 mm/min

To isolate semantics, additionally assume that in two separate analyses the first move after return starts from the same workpiece coordinate X=40 mm, and its block specifies only X10.0 without rewriting those modes. Under G90 the endpoint is X=10 mm, displacement −30 mm; under G91 it is X=50 mm, displacement +10 mm. Direction, distance and feed can all differ.

This does not assert that both return forms necessarily reach the same program block, nor predict the tool's physical position during interruption. The shared starting point isolates modal interpretation; an actual analysis must separately inspect the return target and interruption location.

Adding G90 alone may leave other state unchanged

In the M99 P700 branch above, a destination block that reissues only G90 makes absolute interpretation explicit, but F may still remain 120. A correct geometric endpoint does not establish restored machining conditions. Conversely, reissuing only F600 does not remove G91's effect on coordinates.

When reviewing the return interface, list “which block will execute” and “which modes are active at its entry” separately, then identify the inherited states it uses. Both return forms have purposes; adding P is not a side-effect-free jump repair.

Restoring modes does not rewind machine position, clamping state or external equipment actions. This article analyzes program semantics and supplies no directly executable macro-interrupt program. Related resources are in the OPTION section.

Related technical articles

FANUC optional rotary-axis control: how the sign of an absolute command selects directionFANUC direction-dependent high-speed position switches: why one coordinate can give different outputsFANUC flexible synchronization: matching speed and aligning phase are separate conditions