X20 CPU Service Mode: Task Overrun, Not a Sensor Alarm

Mark Townsend6 min read
B&R AutomationPLC HardwareTroubleshooting
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

The X20 CPU drops into Service Mode while the machine is running. A power cycle clears the condition, production resumes, and the same stop returns later. If the Logger reports a cycle-time violation in TaskClass#1, start with task execution and scheduling—not the sensor that happened to move before the fault.

Stop applying the wrong fixes

These actions may restart the machine or change the interval between stops, but they do not identify the overload:

  • Repeated power cycling: This resets the immediate condition and discards the operating state that produced it. The CPU can run again until the same execution pattern returns.
  • Adjusting a suspected sensor: A sensor does not directly create a cycle-time violation. Its state can activate a slower code path, additional communications, or repeated event handling, so adjustment may change when the software overload appears. That makes the sensor a trigger candidate, not the established fault.
  • Increasing the TaskClass#1 cycle time: More time may suppress the violation, but it can also hide excessive execution, priority interference, or abnormal hardware-related processing. Do not make this the first correction.
  • Replacing hardware without diagnostics: A hardware defect or wiring problem remains possible, but the Logger and profiler must show where execution time is being consumed before replacement becomes a rational step.
Observed symptom Cause to investigate
Service Mode clears after a power cycle and later returns Recurring task overload, intermittent priority interference, or a hardware/wiring condition that drives abnormal processing
Logger names TaskClass#1 The class exceeded its permitted execution window; it may be the overloaded task or the victim of higher-priority tasks
Sensor adjustment changes the fault interval The input may select a costly software path, but the sensor alone is not the cycle-time violation
Fault appears only during a machine operation Code, communication, or interrupt load associated with that operating state

Read the Logger first

Start here. Preserve the diagnostic record before cycling power whenever the machine state permits it.

  1. Connect a laptop to the PLC network.
  2. Open System Diagnostics Manager in a browser at http://ipaddressOfPlc/sdm, replacing the placeholder with the PLC address, or open the Logger in Automation Studio.
  3. Locate the entries immediately before and at the transition to Service Mode.
  4. Record the complete cycle-time violation entry, the named task class, preceding hardware or communication events, and the backtrace.
  5. Export or capture the diagnostics for the OEM. Do not rely on a photograph of only the final alarm line when the preceding sequence is available.

The backtrace is the shortest path from the symptom to the executing software context. A cycle-time entry identifies the scheduling failure; nearby entries can show whether I/O, communications, or hardware diagnostics appeared first.

Interpret the task-class violation correctly

A cyclic task must finish within the execution window configured for its class. Service Mode can follow when the runtime detects that the permitted limit has been exceeded.

The class named in the Logger is not automatically the code that consumed all CPU time. A lower-priority task can exceed its limit because higher-priority work interrupted it too often or held the processor longer than usual. Diagnose both paths:

  • Direct overrun: Code within TaskClass#1 takes too long. Look for a data-dependent loop, blocking operation, unusually large calculation, repeated error handling, or work that activates only in a particular machine state.
  • Priority interference: Higher-priority tasks preempt TaskClass#1 frequently or for long intervals. The named class reaches its limit even though its own execution demand has not changed.
  • Hardware or wiring contribution: An intermittent condition can generate repeated processing, communication recovery, or diagnostic activity. Correlate it with Logger events and profiler load before assigning the failure to a device.

That distinction matters. Extending the affected class may not help if a higher-priority task continues to dominate the processor.

Capture a profiler recording

The Logger tells you that the deadline was missed. A profiler recording shows which task ran, how long it ran, and where preemption occurred.

  1. Connect with Automation Studio using the correct machine project when it is available.
  2. Configure the profiler to include TaskClass#1 and the higher-priority tasks that can interrupt it.
  3. Start the recording before the operating state that normally precedes Service Mode.
  4. Run the machine through the relevant sequence without changing several sensors or settings at once.
  5. At the fault, inspect whether TaskClass#1 shows excessive execution or long and repeated interruptions.
  6. Match the profiler timeline to the Logger timestamps and machine state.

If moving a sensor changes the interval, record the input state and machine sequence during both a normal cycle and a failing cycle. The useful question is which software path changes when that input changes.

Correct the load at its source

The permanent correction depends on the profiler result and normally requires the PLC project:

  • If TaskClass#1 consumes excessive time, find the routine or state that expands execution and reduce, split, or reschedule that work.
  • If a higher-priority task causes the miss, correct its abnormal execution or activation rate. Changing only the victim task leaves the processor contention in place.
  • If Logger entries precede the violation with hardware or communication diagnostics, inspect the associated wiring, device, and network condition. Confirm that repairing the physical problem also removes the abnormal task load.
  • If the execution requirement is legitimate, review task-class allocation and cycle-time settings against the machine’s control requirements before changing them.

Without the project, you can collect SDM diagnostics, document the operating state, and provide the Logger record. You cannot safely identify or modify the responsible routine. Avoid changing task timing simply to keep the machine running while waiting for the OEM.

Verify the correction under the failing sequence

  1. Repeat the same machine operation that previously produced Service Mode.
  2. Monitor the Logger for new cycle-time violations and related diagnostic entries.
  3. Repeat the profiler capture and compare task execution and interruption patterns with the failing recording.
  4. Confirm that the repaired task completes within its configured window during the worst observed operating state.
  5. Run repeated production sequences without additional timing changes or sensor adjustments. Changing multiple variables invalidates the comparison.

A successful power cycle is not verification. The correction is verified only when the original sequence no longer generates the violation and the profiler shows that the scheduling margin was restored.

FAQ

Why does an X20 CPU enter Service Mode while running?

When the Logger reports a cycle-time violation, a task class exceeded its permitted execution window. The cause can be excessive code execution, preemption by higher-priority tasks, or hardware-related activity that drives abnormal processing.

Why does power cycling make the X20 CPU run again?

The restart clears the immediate Service Mode condition, but it does not remove the execution pattern that caused the deadline miss. The stop returns when that task load or machine state occurs again.

Why does the Logger blame TaskClass#1 when another task is faulty?

TaskClass#1 may be the task that finally exceeded its limit after higher-priority tasks interrupted it too often or too long. Use a profiler recording to distinguish its own execution time from preemption.

Why does adjusting a sensor change the Service Mode interval?

The input can select a different software path or machine state, changing processor load. Correlate the input transition with the Logger and profiler; replacing or adjusting the sensor alone does not correct a task overrun.

When should I stop troubleshooting and contact B&R support?

Stop making runtime changes when you lack the PLC project, cannot capture the responsible task, or see hardware diagnostics that cannot be isolated safely. Send the OEM and official B&R support the SDM export, complete Logger sequence, backtrace, profiler recording, and the machine operation that triggers the stop. Do not keep increasing cycle time or repeatedly power cycling a production machine without identifying the overload.

Back to blog