Back to all articles

Automatically alert when a Modbus PLC reports a fault code

Build a Modbus PLC fault code alert with verified register mapping, clear incident logic, and tested notifications. Keep lost communication separate.

KIEditorial TeamNov 19, 2026 — 11 min read
Automatically alert when a Modbus PLC reports a fault code

Instead of checking a PLC display for faults, configure a Modbus reader to send decoded fault data to the Kilo IoT Platform, then evaluate that data and notify the responsible person when a documented fault condition becomes active. A reliable Modbus PLC fault code alert needs the correct register mapping, a working ingestion path, and separate handling for equipment faults and lost communication.

TL;DR
  • Build a Modbus PLC fault code alert from decoded register data, not from connection status alone.
  • Kilo supports IoT monitoring workflows; a compatible reader must bridge the PLC to a supported ingestion path.
  • Use the manufacturer's register map to distinguish fault codes, bit flags, and Modbus exceptions.
  • Notify on fault transitions, preserve active incidents, and treat stale data as a separate condition.

Why a fault register needs more than a threshold

Modbus provides a way to read device data; it doesn't define a universal meaning for equipment fault codes. Your PLC program or equipment manufacturer determines which register represents a fault, how to interpret it, and what counts as normal.

A nonzero value isn't automatically a fault. A register can contain a warning, an operating mode, a bitmask, or a historical code that remains stored after the equipment recovers. Build the alert around the documented meaning, not the appearance of the number.

Kilo is a fit for integrators who need IoT monitoring, rules, and alarms around connected equipment. The integration boundary matters: this workflow requires a compatible Modbus reader and supported data ingestion, not an assumed direct connection from the cloud to an arbitrary PLC.

Before you start

  • Get the register map and authorized access. You need the PLC or equipment documentation, permission to read it, and access to the gateway or industrial computer performing the reads. Arrange an approved test method with the equipment owner.
  • Prepare the complete data path. Identify the Modbus TCP or serial connection, a compatible reader, a supported platform ingestion interface, and the intended alert recipient. Confirm the actual integration and notification capabilities before configuring production behavior.
  • Resolve the addressing gotcha first. A manual's register reference and a reader's address field can use different numbering conventions. Also establish whether the fault is a current code, a latched historical value, or individual bits; a successful read doesn't establish correct interpretation.

Keep the first implementation read-only. Alerting doesn't require a reset command, and adding writes introduces a separate equipment-control decision.

Fault register configuration

Read the documented fault source

  1. Identify the equipment's current fault indicator in the manufacturer's map or PLC program documentation. Record the register type, address convention, data format, normal state, and fault meanings.
  2. Configure the reader for the installed transport. For Modbus TCP, use the approved network endpoint and unit identifier; for serial Modbus RTU, match the documented serial settings and device address.
  3. Select the correct read operation. Modbus function 03 reads holding registers, while function 04 reads input registers. Neither function tells you what the returned value means.
  4. Compare the result with the local equipment display or an approved engineering view while the machine state is known.

A Modbus register contains 16 bits. Fault information that spans multiple registers needs the manufacturer's documented ordering and interpretation; don't apply a guessed numeric conversion.

Expected result: the reader returns a value that agrees with the equipment's documented current state, and you can explain how the address and value were interpreted.

Choose the right fault interpretation

Use the representation the equipment actually exposes. These are data formats, not interchangeable alert settings.

Fault representationBest fitAlert logicBenefitLimitation
Enumerated codeA documented current fault valueMatch named fault codesClear mapping to a fault descriptionA displayed code doesn't necessarily represent every simultaneous fault
BitmaskIndependent active fault flagsEvaluate the documented bitsPreserves simultaneous conditionsComparing the entire register with a single code misses combinations
Fault flag plus codeSeparate active state and diagnostic detailGate the code with the active flagSeparates occurrence from descriptionRead timing must preserve a consistent interpretation

Don't confuse an equipment fault with a Modbus exception response. An illegal-address exception concerns the requested Modbus operation; it isn't proof that the machine has developed the fault your alert is intended to detect.

Gateway and telemetry configuration

Publish a usable fault record

  1. Configure a read-only gateway or industrial service to collect the verified fault source. Select a polling interval appropriate to the equipment and network, rather than copying an arbitrary interval from a tutorial.
  2. Translate the register data into explicit application fields. Suggested field names are asset_id, fault_code, fault_active, observed_at, and read_ok; these are an integration schema, not claimed platform UI labels.
  3. Preserve the raw register value alongside the decoded meaning. Include the source identity so faults from different PLCs cannot merge accidentally.
  4. Send the record through an ingestion path supported by the deployment. For an MQTT-based bridge, verify authentication, topic mapping, payload mapping, and device association at both ends.
  5. Inspect the received record before adding alarm logic. Confirm that the platform associates it with the intended asset and retains the timestamp meaning you designed.

Kilo supports MQTT connectivity, but that doesn't make a Modbus gateway automatically compatible. The gateway's published payload still needs to match the configured ingestion path.

Expected result: a fresh PLC observation reaches the intended asset with a correct fault value, identity, timestamp, and read-quality indication.

Preserve freshness and read failures

A failed read must not become a healthy equipment value. If the gateway substitutes a normal code after a timeout, the alert can appear to recover while the PLC is unreachable.

Keep the last known equipment state separate from communication quality. Distinguish the time the PLC observation was collected from the time a buffered message arrived in the platform; otherwise, delayed data can look current.

This workflow has separate stages: Read registers, Decode faults, Publish telemetry, Evaluate state, and Notify owner. Verify each boundary independently so troubleshooting doesn't start at the recipient's inbox.

Fault alert workflow from reading Modbus registers to notifying the responsible person
Validate the fault value before testing its notification path.

Fault rule and notification configuration

Define activation, ownership, and recovery

  1. Define the fault predicate from the documented register meaning. Require a valid observation and the relevant active state, code match, or bit condition.
  2. Define incident identity using the asset and fault condition. Decide whether a changed fault code updates an existing incident or starts a separate one.
  3. Configure state handling in the component responsible for it. Use the platform's documented rule and alarm behavior where supported; otherwise, maintain the required transition state in the integration service.
  4. Assign the responsible recipient and a supported notification route. Include the asset name, site, observed fault, observation time, and the approved first response.
  5. Define recovery from a fresh observation of the documented normal state. Treat operator acknowledgment separately from equipment recovery.

Notify on a meaningful state transition, not on every successful poll. Repeated reads of the same active fault should preserve the incident rather than create an inbox full of indistinguishable alerts.

Expected result: an active fault produces an identifiable incident and actionable notification, while repeated identical observations follow your explicit repeat policy.

Keep the message useful

An alert should answer what happened, where it happened, and who responds. Include the raw code when it helps a technician consult the equipment manual, but don't make an unexplained number the entire message.

Illustrative scenario: a gateway reads a documented drive-fault state and publishes the machine identity with its diagnostic code. The workflow notifies the assigned maintenance contact, who follows the machine's approved troubleshooting procedure; a later valid normal observation supplies evidence of recovery.

That scenario requires the register mapping, integration, and recipient configuration described here. It isn't a claim about a customer installation or a turnkey integration for every drive.

Test and release configuration

  1. Validate the healthy state, a documented fault state, repeated fault observations, a changed code, and recovery using approved test data or an equipment-approved procedure.
  2. Interrupt the data path during testing. Verify that stale or failed reads produce a communication condition rather than clearing the equipment fault.
  3. Confirm the intended recipient receives the test notification. Inspect the asset identity, fault description, timestamp, and response instructions in the delivered message.
  4. Test restart behavior in whichever component stores incident state. Ensure a gateway or service restart doesn't silently clear an unresolved condition.
  5. Release the workflow through the deployment's documented procedure, then observe a complete fault-and-recovery sequence before expanding its scope.

If you test within Kilo's Rules Engine debugger, Execute performs the real operation for supported side-effect nodes and is selected initially. Choose Skip or Mock deliberately when you don't intend the real side effect; debugging isn't automatically an isolated sandbox.

Expected result: the complete path behaves correctly under faults, recovery, communication loss, and repeated observations—not just a single successful test message.

Alert when a fault changes or communication stops

A useful adjacent workflow alerts when an active fault changes into a different fault. Compare the new decoded condition with the previous active condition, then apply the incident policy you established rather than treating every non-normal sample as a new occurrence.

This helps when a machine progresses through different diagnostic states. The limitation is interpretation: some equipment rotates displayed codes, so a changed value doesn't automatically mean a separate failure.

Communication monitoring needs its own condition. Evaluate missing or unsuccessful observations against the deployment's defined freshness requirement, notify the appropriate owner, and retain the distinction between “equipment fault active” and “equipment state unknown.”

Neither workflow makes a cloud notification a machine-safety function. Keep protective interlocks and safety responses in the equipment's engineered control system.

Troubleshooting Modbus PLC fault alerts

The reader connects, but the fault value is wrong

Check the register type, function, address convention, unit identifier, and data interpretation. Compare the raw response with a known local state before changing alarm logic; a valid Modbus response can still contain the wrong register.

The fault appears locally, but no alert arrives

Trace one observation through the reader, published payload, received asset data, predicate result, and notification destination. Check whether a string-valued code is being compared with a numeric value, and whether a fault-active flag is missing.

The same fault triggers repeatedly

Inspect incident identity and state storage. If every poll starts a fresh incident, add transition handling in the responsible component and test whether its state survives an ordinary restart.

The alert clears when the connection fails

Inspect timeout handling and recovery logic. Remove any conversion of missing data into a normal fault value, and require fresh valid evidence before declaring equipment recovery.

Short faults never appear in the cloud

Compare the fault duration with polling behavior. If a fault appears and clears between reads, use a documented latched indicator or event record where available; faster polling alone doesn't guarantee capture.

Extend monitoring without adding automatic resets

Start by applying the verified mapping to another asset of the same documented configuration. Reuse the schema and response structure, but confirm each machine's identity, register map, fault meanings, and assigned owner before enabling notifications.

The platform software and the Modbus reader are separate parts of the system. If you need hardware, Kilo Electronics is a separate online authorised dealer serving individual and business buyers; verify the required Modbus interface and ingestion compatibility before selecting equipment.

Don't append an automatic reset to an alert simply because a write operation exists. A reset changes equipment state and needs a separately reviewed command path, permissions, operating conditions, and outcome verification.

FAQ

Can a Modbus PLC send a fault alert directly to the cloud?

A Modbus interface alone doesn't provide a cloud notification workflow. Use a compatible reader or gateway to collect the fault data, publish it through a supported ingestion path, and evaluate the alert condition.

Does every nonzero Modbus register value mean a fault?

No. The PLC program or equipment documentation defines whether a value is a fault code, warning, operating state, bitmask, or historical record.

What's the difference between a PLC fault and a Modbus exception?

A PLC equipment fault describes a machine condition, while a Modbus exception reports a problem processing a Modbus request. An illegal-address response, for example, doesn't establish a machine fault.

Can I build a Modbus PLC fault code alert without changing PLC logic?

Yes, when the existing program exposes the required fault information through an authorized readable interface. A program change needs separate review if the necessary state isn't exposed or transient events cannot be captured.

How often should I poll a PLC for fault codes?

Set the polling interval from the equipment documentation, expected fault behavior, and network constraints. For short events, a documented latched state or event record is more useful than assuming periodic reads will capture everything.

Does acknowledging an alert reset the PLC fault?

No. Acknowledgment records a person's response in the alert workflow; clearing or resetting equipment requires its own documented procedure and, where applicable, an authorized command path.

Check whether the register remembers the fault

Before accepting the workflow, establish whether the fault register represents the present or remembers the past. A historical last-fault code can remain unchanged after recovery, so an alert based on that code alone can stay active indefinitely.

Use the documented current-state indicator to determine recovery. Keep historical codes as diagnostic context rather than treating them as proof that a fault remains active.

Written by Tim Kravchunovsky

You might also like