Resolving SINUMERIK 840D Alarm 20122 Compensation Table 5 Error

David Krause15 min read
Motion ControlSiemensTroubleshooting
Licensed PE Working through this on a live machine? A Maine-licensed engineer can take it from here — included with IMD hardware, by the hour for everything else. Book an engineer

Resolving SINUMERIK 840D Alarm 20122: Compensation Table 5 Invalid Axis Assignment

Alarm 20122 "Compensation table 5: invalid axis assignment" is a configuration-level alarm that fires on Siemens SINUMERIK 840D / 840D sl controllers whenever the NCK boots, performs a warm restart, or activates a channel whose axis list does not match the axis index stored inside a compensation table. The alarm clears with NC Reset, which often makes it look "harmless" during early commissioning, but it is a hard configuration error that prevents unattended start-up and must be resolved before the machine can be released for production. This reference covers the underlying compensation-table architecture, the exact parameter set that controls it, the three valid resolution paths, and the multi-channel behavior that triggers the alarm when a second channel is enabled with axes that table 5 cannot reference.

Scope: The fault described in this document applies to SINUMERIK 840D, 840D sl, and 840Di sl controllers using the NCU 710/730/750 and SINUMERIK Operate / HMI Advanced. Compensation tables 0..7 are accessible on the standard NCK; tables 8..15 require the additional "Compensation tables extended" option. Alarm 20122 always references one specific table number — in this case, table 5.

1. Alarm 20122 Problem Summary

Alarm 20122 belongs to the SINUMERIK alarm range 20000-20999, which is reserved for compile-time and run-time errors in NCK configuration data. The alarm is delivered with channel context and a table index, and the standard alarm text from the SINUMERIK alarms documentation is:

Channel %1: Compensation table %2: invalid axis assignment. The compensation table has been assigned an axis that does not exist or is not configured to use compensation.
Attribute Value
Alarm number 20122
Alarm class Configuration / Setup error
Reaction NCK disables the affected compensation table; alarm is active
Acknowledge NC Reset (Power On not strictly required)
Trigger condition Channel reset / channel enable where the compensation table references an invalid axis
Standard remedy Correct $SN_CEC_TABLE_AXIS or disable $SN_CEC_TABLE_ENABLE for the offending table

The behavior described in the field — "alarm appears on every restart but disappears after Reset" — is exactly the expected behavior of a configuration alarm. NCK performs an internal consistency check on compensation tables at channel activation. If the table references a non-existent or compensation-disabled axis, the NCK raises 20122. NC Reset clears the display, but the next channel activation re-runs the check, so the alarm re-appears. The Reset-only workaround is not acceptable for production release; the configuration itself must be corrected.

2. SINUMERIK 840D Compensation Table Architecture

SINUMERIK 840D supports several types of geometric and thermal compensation that all share the same data structure: an axis-indexed compensation table stored as a series of (position, compensation value) points. The NCK can hold up to eight (or sixteen with the extended option) such tables per channel.

Compensation family Typical use Axis MD prefix Setting data prefix
Leadscrew / pitch error (LEC) Compensates mechanical pitch error of ball screws $MA_LEADSCREW... $SN_LEC_TABLE_*
Sag / sling compensation Compensates vertical axis droop $MA_CEC_SLING_* $SN_CEC_TABLE_*
Cross-compensation (CEC) Compensates cross-coupling between axes $MA_CEC_ENABLE $SN_CEC_TABLE_*
Quadrant error compensation Compensates reversal spikes $MA_QEC_* (per axis, no SD)
Following error compensation Compensates drive following error $MA_FOLLOWING_ERROR_COMP_* (per axis)

All cross-compensation (CEC) tables share a single set of enabling setting data: $SN_CEC_TABLE_ENABLE[n] and $SN_CEC_TABLE_AXIS[n], where n is the table index 0..7 (0..15 with extended option). Each table is permanently assigned to one specific machine axis in its channel through these two setting data entries. The compensation values themselves live in $NN_CEC_TABLE[n,0..7] and the per-table scaling / offset in $SN_CEC_TABLE_OFFSET[n] and $SN_CEC_TABLE_FACTOR[n].

The naming convention matters: $MN_* = NCK machine data (loadable, requires NCK reset), $MA_* = axis machine data (loadable, requires axis reset), $SN_* = setting data (immediate, channel-specific), $NN_* = non-volatile NC data. Compensation tables are setting data + non-volatile table values, not loadable MD, which is why modifications take effect immediately without an MD reset.

3. Root Cause Analysis of Invalid Axis Assignment

Alarm 20122 fires for one of four reasons, all of which are essentially the same root condition — the table's axis index does not resolve to a configured, compensation-enabled axis in the active channel:

  1. Axis index out of range: $SN_CEC_TABLE_AXIS[5] contains a number that is not a valid machine axis in the current channel (e.g., the table still references axis 7 from an old config, but the channel has only 5 axes).
  2. Axis not assigned to the channel: The axis index is valid on the system, but the axis is assigned to channel 1 while the compensation table is being evaluated in channel 2 (or vice-versa).
  3. Axis compensation globally disabled: $MA_CEC_ENABLE[AX] for the referenced axis is set to 0, so even though the table "points" at a valid axis, the NCK refuses to bind the table to a compensation-disabled axis.
  4. Cross-channel pollution: The compensation table data was copied from another channel's image where the axis indices were 1..6 (channel 1) and the table was loaded into channel 2 without re-mapping the axis index.

The most common field scenario — "alarm appears when I enable channel 2" — is almost always scenario 4: a commissioning engineer copies a multi-axis configuration that includes an active compensation table (e.g., for vertical-axis sag or leadscrew error) but the table still references an axis from channel 1's geometry. When channel 2 is activated, the NCK re-validates the table and rejects the cross-channel axis index.

4. Key Parameters and Data Words

The complete parameter set that must be inspected and corrected is summarized below. Pay attention to the prefix — it determines whether the parameter is NC-wide, axis-specific, or channel-specific.

Parameter Type Index Default Meaning
$SN_CEC_TABLE_ENABLE[5] Setting data, channel 0..7 (0..15 ext.) 0 Enables/disables the compensation table. 0 = inactive, 1 = active.
$SN_CEC_TABLE_AXIS[5] Setting data, channel 0..7 0 Machine axis index that the table is bound to. Must match an axis present in the channel and configured for compensation.
$SN_CEC_TABLE_OFFSET[5] Setting data, channel - 0.0 Offset added to the interpolated compensation value.
$SN_CEC_TABLE_FACTOR[5] Setting data, channel - 1.0 Scaling factor applied to the table values.
$NN_CEC_TABLE[5,0..7] NC data 8 points (32 extended) 0.0 Compensation value points (position + value pairs).
$MA_CEC_ENABLE[AX] Axis machine data per axis 0 Master enable for cross-compensation on the axis. Must be 1 for any CEC table to bind.
$MA_CEC_SLING_ASSIGNM[AX] Axis machine data per axis 0 Table index assigned to this axis for sling/sag compensation.
$MA_CEC_SCATTER_ASSIGNM[AX] Axis machine data per axis 0 Table index assigned to this axis for scatter (general CEC) compensation.
$MN_MM_NUM_CEC_TABLES NCK machine data global 0 Number of CEC tables the NCK reserves. Must be ≥ 6 if table 5 is used.
$MN_MM_CEC_MAX_POINTS NCK machine data global 128 Total compensation points across all tables.

Note that setting data items use the $SN_ prefix and live at the channel level, so they are per-channel. If the same compensation must apply to channel 1 and channel 2, each channel must have its own correctly-assigned $SN_CEC_TABLE_AXIS[n] entry. The table values stored under $NN_CEC_TABLE are NC-wide.

5. Locating $SN_CEC_TABLE_ENABLE in the HMI / NC

The most common reason field engineers "cannot find" $SN_CEC_TABLE_ENABLE is that the HMI display filter is set to a category that excludes setting data, or the access level (password) is insufficient. Use the following sequence to surface the parameter set on a stock SINUMERIK Operate install:

  1. On the HMI, navigate to Setup > Compensation. For older HMI Advanced, use Commissioning > NC > Setting Data.
  2. If the screen is empty, press the softkey Display MD and change the filter to Setting Data ($SN_).
  3. Open the filter dialog and enter CEC_TABLE in the search box — this filters all $SN_CEC_TABLE_* entries.
  4. If nothing appears, the active access level is too low. Press the Access level softkey and switch from Operator to Service or Manufacturer (password required; default manufacturer password on commissioning is SUNRISE, service CUSTOMER — change immediately on production hardware).
  5. Alternatively, write the parameter directly from an NC program: SETAL("CEC_TABLE_ENABLE[5]",0), or via PLC FB7 ("PI Service") to set the setting data remotely.

Once the parameter is visible, record the current value of $SN_CEC_TABLE_ENABLE[5], $SN_CEC_TABLE_AXIS[5], and the corresponding $MA_CEC_ENABLE on the axis referenced by the table. These three values together diagnose whether the table is configured correctly.

6. Solution Path A — Correct the Axis Assignment in Table 5

If the compensation is genuinely required (most commonly: vertical-axis sag, leadscrew compensation on a long-travel axis, or cross-coupling between gantry axes), the correct fix is to re-bind table 5 to a valid, channel-resident, compensation-enabled axis.

  1. Decide which axis in the channel needs the compensation. For a vertical-axis sling, this is typically the Z axis. For leadscrew error, it is the longest-travel linear axis. For gantry cross-coupling, it is the slave axis of the gantry pair.
  2. Verify that $MA_CEC_ENABLE[AXn] = 1 on the chosen axis. If it is 0, change it to 1 and trigger an NCK reset (or click Activate MD on the HMI).
  3. Set $SN_CEC_TABLE_AXIS[5] to the axis index. In multi-channel systems, axis indices are NC-wide: axis 1 = first machine axis on the system, axis 2 = second, etc. The axis index is NOT the channel-local axis number; it is the global axis index as listed in $MN_AXCONF_MACHAX_NAME_TAB and visible under Axis configuration.
  4. Confirm $SN_CEC_TABLE_ENABLE[5] = 1.
  5. If using scatter or sling assignment instead, ensure $MA_CEC_SLING_ASSIGNM[AXn] = 5 or $MA_CEC_SCATTER_ASSIGNM[AXn] = 5 matches the table number.
  6. Trigger an NC Reset. The alarm should not re-appear on subsequent resets or channel enables.
The axis index in $SN_CEC_TABLE_AXIS is the global axis index, not the channel name (X1, Z2, etc.). A common commissioning error is to enter the channel name (e.g., "Z2") instead of the numeric axis index (e.g., 4). Verify by reading $MN_AXCONF_MACHAX_NAME_TAB[,] to obtain the mapping.

7. Solution Path B — Disable Table 5 via $SN_CEC_TABLE_ENABLE

If the compensation was inherited from a previous configuration and is not actually needed in the new channel layout, the table can simply be disabled. This is also the correct remediation if the customer cannot provide the original commissioning sheet for the compensation.

  1. Set $SN_CEC_TABLE_ENABLE[5] = 0.
  2. Optional but recommended: set $SN_CEC_TABLE_AXIS[5] = 0 to flag the table as unassigned. A non-zero value on a disabled table is harmless but can confuse later engineers reading the data.
  3. Trigger an NC Reset. Alarm 20122 should clear immediately and not return on the next boot.
  4. To make the change survive a Power-On, perform Commissioning > Save data > NC active data from the HMI, or set $ON_BACKUP_REQUIRED = 1 and run the PI service _N_BACKUP. Skipping this step causes the setting data to revert to the loaded image after a Power-On, and the alarm will reappear on the next cold start.

If the alarm reappears after Power-On despite setting $SN_CEC_TABLE_ENABLE[5] = 0, the issue is almost always that the value was changed but not backed up. Setting data modifications are volatile in NCK memory until the backup is performed.

8. Solution Path C — Reset Behavior and NCK Persistent Storage

The behavior described in the original field report — "alarm appears on every restart but disappears after Reset" — is consistent with a setting-data configuration error that has been loaded into the NCK image (loadable backup) but where the in-RAM image has been modified. To permanently resolve the condition without disabling the table:

Alarm 20122 Resolution State Machine NCK Boot / Reset Alarm 20122 Active Path A: Correct $SN_CEC_TABLE_AXIS Path B: $SN_CEC_TABLE_ENABLE = 0 Path C: $MA_CEC_ENABLE = 0 NC Reset — Alarm Cleared Save Setting Data (HMI or _N_BACKUP PI)
  1. Identify which of Solution A or Solution B is appropriate (see sections 6 and 7).
  2. Apply the change in the active NCK image.
  3. Press NC Reset — alarm clears.
  4. From the HMI, navigate to Commissioning > Save data > NCK active data, or invoke PI _N_BACKUP from the PLC via FB7.
  5. Perform a controlled NCK Power-On to verify the change persists.

Without step 4, the alarm will indeed reappear after the next Power-On, which is the behavior the original field engineer observed.

9. Multi-Channel Configuration Considerations (Channel 2 Specific)

SINUMERIK 840D supports up to ten channels per NCU, and compensation tables are channel-scoped. The behavior "alarm appears only when I enable channel 2" is therefore expected if:

  • The compensation table is enabled in channel 2 but its axis index resolves to a channel-1 axis that is not part of channel 2's geometry.
  • The original commissioning left $SN_CEC_TABLE_ENABLE[5] = 1 globally while the table was meant for channel 1 only.
  • The axis reference index in $SN_CEC_TABLE_AXIS[5] refers to a spindle or a positioning axis that is not assigned to channel 2.

The corrective pattern is to use channel-specific configuration: read the table data in the channel where it is meant to apply, and set $SN_CEC_TABLE_ENABLE[5] = 0 on the channel that does not need it. Because setting data is channel-local, you can have $SN_CEC_TABLE_ENABLE[5] = 1 on channel 1 with a correct axis index, and $SN_CEC_TABLE_ENABLE[5] = 0 on channel 2, and the NCK will not complain on channel 2 activation. Use the HMI to switch channels (Channel switch softkey, or click the channel name in the status bar) and confirm each channel's setting data separately.

Channel Status before fix Status after fix Alarm 20122?
CH1 (X1, Y1, Z1, B1) $SN_CEC_TABLE_AXIS[5] = 3 (Z1), $MA_CEC_ENABLE[Z1]=1, ENABLE=1 Unchanged No
CH2 (X2, Y2, Z2, A2) $SN_CEC_TABLE_AXIS[5] = 3 (still points to Z1), ENABLE=1 $SN_CEC_TABLE_ENABLE[5] = 0 (or rebind to axis 7 = Z2) No (after fix)

10. Verification Procedure and Commissioning Checks

After applying any of the three solutions, perform the following verification sequence to confirm the alarm is permanently cleared:

  1. NC Reset — observe alarm log. 20122 should be marked Cancelled.
  2. Disable and re-enable the affected channel from the HMI (Channel state menu). No new alarm should appear.
  3. Power-On the NCK (cold restart). After NCK comes back up, no 20122 should appear at any of: NCK ready, channel activation, channel reset.
  4. Display the active compensation state under Diagnostics > Comp. table state or by reading $AC_CEC_TABLE_STATE in the NC program. State should show "active" if the table is enabled, "inactive" if disabled — never "invalid axis".
  5. Run a referencing sequence and a simple linear move on the axis that uses compensation. If the compensation is active, you can verify it by plotting actual vs. nominal position via Trace and looking for the expected compensation curve.
  6. Save the commissioning changes via Commissioning > Save data > NC active data. This is required for the fix to persist across Power-On.
  7. Archive the resulting image and update the machine documentation: record the table number, the axis it's bound to, the compensation values, and the SD snapshot date.
If 20122 reappears on a Power-On after the fix, the most common cause is that the setting data was not saved (step 6 above). Setting data lives in volatile RAM and is only persisted to flash on a "Save NC active data" action or via PI service _N_BACKUP. Loadable MD changes ($MA_*) require a separate MD-activation step and an NCK reset.

11. Related Compensation Alarms and Cross-Reference

Alarm 20122 is part of a family of compensation-related alarms in the 20000-20999 range. When investigating, it is worth scanning the alarm log for siblings that often co-occur:

Alarm Text Relationship to 20122
20120 Compensation table: too many tables requested Preceded by 20122 if $MN_MM_NUM_CEC_TABLES is too low
20121 Compensation table: not enough memory Preceded by 20122 if $MN_MM_CEC_MAX_POINTS is too low
20122 Compensation table %2: invalid axis assignment This alarm
20123 Compensation table %2: axis direction invalid Triggered if table signed-direction does not match axis direction
20124 Compensation table %2: table position not monotonic Triggered if compensation points are not monotonically increasing in position
20125 Compensation table %2: output value out of range Triggered if compensation values exceed configured limits
20130 CEC: error in axis enable Comes from $MA_CEC_ENABLE mismatch

If 20122 is accompanied by 20130, fix $MA_CEC_ENABLE first (it is a precondition) before addressing the table-axis binding. For full reference, see the official SINUMERIK 840D sl Diagnostics Manual and the SINUMERIK 840D sl Parameter Lists Manual which provide the definitive parameter database.

12. Frequently Asked Questions

Why does alarm 20122 appear every time I restart the NCK, even after pressing Reset?

Alarm 20122 is a configuration alarm that the NCK re-raises at every channel activation because the underlying data is still invalid. Pressing Reset only clears the display. To make the alarm stay away, correct the table-axis binding or disable the table, then perform "Save NC active data" so the setting data is persisted to flash.

I disabled $MA_CEC_ENABLE on the axis but the alarm still appears. Why?

Alarm 20122 is raised on the table, not on the axis. Even with $MA_CEC_ENABLE=0, the NCK still validates the axis index in $SN_CEC_TABLE_AXIS against the channel's axis list. The alarm is cleared by either correcting $SN_CEC_TABLE_AXIS[5] to a valid channel-resident axis, or by setting $SN_CEC_TABLE_ENABLE[5]=0 to take the table out of service entirely.

I cannot find $SN_CEC_TABLE_ENABLE in the HMI display. Where is it?

The parameter is hidden under "Setup > Compensation" if the active access level is too low. Switch the access level to Service or Manufacturer (password SUNRISE by default for manufacturer level on commissioning systems). The parameter can also be set via the SETAL() NC command or via PLC FB7 (PI Service) from the PLC program.

The alarm only appears when I enable channel 2, never on channel 1. What is the correct fix?

Set $SN_CEC_TABLE_ENABLE[5]=0 in channel 2 (the channel that does not use the compensation), or rebind $SN_CEC_TABLE_AXIS[5] to a valid axis that is part of channel 2's geometry. Setting data is channel-local, so the table can be active on channel 1 and inactive on channel 2 simultaneously.

Is alarm 20122 safety-relevant? Can I run the machine in production with it active?

No. Alarm 20122 indicates that the compensation table is not being applied. On machines that depend on the compensation for geometric accuracy (sag on a vertical Z axis, leadscrew correction on long axes), running without compensation degrades part accuracy and may push the machine outside its specification envelope. Clear the alarm before releasing the machine to production and verify accuracy with a measurement trace.

What is the difference between $SN_CEC_TABLE_ENABLE and $MA_CEC_ENABLE?

$SN_CEC_TABLE_ENABLE[n] is a setting data item that enables or disables the nth compensation table at the channel level (one entry per table). $MA_CEC_ENABLE[AX] is axis machine data that acts as a global enable for cross-compensation on a specific machine axis. The axis enable must be 1 for the table to bind; the table enable then determines which tables on that axis are actually evaluated.

Back to blog