FoundryNet / Error codes
Reference

Industrial protocol error codes

The error string is what you actually search for when a line stops. 67 codes across 14 protocols — what each one means, when it happens, and how to fix it.

67error codes
14protocols
366canonical fields

Modbus OPC UA MQTT / Sparkplug B FANUC FOCAS EtherNet/IP PROFINET / S7 BACnet/IP J1939 (CAN) MTConnect ROS 2 (DDS) SNMP MAVLink HTTP / REST CSV ingest


Modbus

6 documented codes

Modbus answers a bad request with an exception response: the function code echoed back with the high bit set, followed by a one-byte exception code. The codes below are from the MODBUS Application Protocol specification and mean the same thing over TCP and RTU. · protocol hub

CodeMeaningHex / value
Exception 01Illegal Function0x01
Exception 02Illegal Data Address0x02
Exception 03Illegal Data Value0x03
Exception 04Server Device Failure0x04
Exception 06Server Device Busy0x06
Exception 0BGateway Target Device Failed To Respond0x0B

OPC UA

6 documented codes

OPC UA returns a 32-bit StatusCode on every operation. Anything beginning Bad is a failure, Uncertain means the value is suspect, Good means usable. The severity is in the top two bits, which is why every Bad code is 0x80-something. · protocol hub

CodeMeaningHex / value
BadNodeIdUnknownNode ID is not known to the server0x80340000
BadConnectionClosedThe secure channel was closed0x80AE0000
BadTimeoutThe operation timed out0x800A0000
BadSecurityChecksFailedAn error occurred verifying security0x80130000
BadUserAccessDeniedUser does not have permission0x801F0000
BadSubscriptionIdInvalidThe subscription id is not valid0x80280000

MQTT / Sparkplug B

6 documented codes

MQTT rejects a connection with a CONNACK return code. Version 3.1.1 uses codes 1-5; version 5.0 replaces them with a wider set of reason codes starting at 0x80. Sparkplug B then adds its own sequencing rules on top, which is where most industrial MQTT problems actually live. · protocol hub

CodeMeaningHex / value
CONNACK 1Connection Refused: unacceptable protocol version0x01
CONNACK 2Connection Refused: identifier rejected0x02
CONNACK 3Connection Refused: server unavailable0x03
CONNACK 5Connection Refused: not authorized0x05
Sparkplug NDATA before NBIRTHData message received with no birth certificate
Sparkplug seq out of orderSequence number gap in the Sparkplug stream

FANUC FOCAS

4 documented codes

Every Fwlib32 call returns a short. Zero is EW_OK; negative values are communication-layer failures; positive values are the CNC rejecting the request. The negative codes are the ones people search for.

FOCAS is FANUC's own library, not one of Forge's 14 protocol adapters. Forge reaches FANUC controllers over MTConnect, OPC UA, or EtherNet/IP. These codes are documented because anyone integrating a FANUC directly will meet them, and because the fix is often to stop using FOCAS.

CodeMeaningHex / value
-16EW_SOCKET — socket communication error
-1EW_BUSY — CNC is busy
-8EW_HANDLE — library handle error
-17EW_PROTOCOL — protocol error

EtherNet/IP

5 documented codes

EtherNet/IP carries CIP, and CIP replies carry a General Status code. A general status of 0x01 is usually accompanied by a two-byte extended status that holds the actual reason. · protocol hub

CodeMeaningHex / value
0x01Connection failure0x01
0x04Path segment error0x04
0x05Path destination unknown0x05
0x08Service not supported0x08
0x16Object does not exist0x16

PROFINET / S7

4 documented codes

Two separate error surfaces get conflated here. S7 communication over ISO-on-TCP returns S7 error classes on data access, while PROFINET IO itself reports device and module faults through diagnostic alarms. · protocol hub

CodeMeaningHex / value
S7 0x05Address out of range0x05
S7 0x0AItem not available0x0A
ISO connection refusedISO-on-TCP connection rejected on port 102
PN station failurePROFINET IO device failure

BACnet/IP

5 documented codes

BACnet errors carry an error class and an error code. The class says which part of the system objected — object, property, device, security, resources, services — and the code says what specifically went wrong. · protocol hub

CodeMeaningHex / value
UNKNOWN_OBJECTError Class OBJECT, code UNKNOWN_OBJECT
UNKNOWN_PROPERTYError Class PROPERTY, code UNKNOWN_PROPERTY
WRITE_ACCESS_DENIEDError Class PROPERTY, code WRITE_ACCESS_DENIED
TIMEOUTError Class DEVICE, code TIMEOUT
VALUE_OUT_OF_RANGEError Class PROPERTY, code VALUE_OUT_OF_RANGE

J1939 (CAN)

6 documented codes

J1939 reports faults as diagnostic trouble codes in DM1 and DM2 messages. A DTC is an SPN naming the suspect parameter, an FMI naming the failure mode, and an occurrence count. The FMI is the part that tells you what kind of failure it is. · protocol hub

CodeMeaningHex / value
FMI 0Data valid but above normal operational range — most severe
FMI 3Voltage above normal or shorted to high source
FMI 4Voltage below normal or shorted to low source
FMI 5Current below normal or open circuit
FMI 2Data erratic, intermittent or incorrect
FMI 31Condition exists

MTConnect

4 documented codes

An MTConnect agent replies to a bad request with an MTConnectError document containing an errorCode attribute. Separately, the agent reports UNAVAILABLE as a data value — which is not an error, and confuses more integrators than any actual error code. · protocol hub

CodeMeaningHex / value
OUT_OF_RANGERequested sequence number is out of range
NO_DEVICENamed device does not exist on this agent
UNAUTHORIZEDRequest was not authorized
UNAVAILABLEData item value is UNAVAILABLE (not an error)

ROS 2 (DDS)

4 documented codes

ROS 2 failures are mostly discovery and QoS problems in the DDS layer underneath. Nodes that cannot see each other, or that see each other and refuse to connect, account for most of it. · protocol hub

CodeMeaningHex / value
Incompatible QoSPublisher and subscriber QoS do not match
No publishers discoveredTopic exists but nothing is discovered
RCL_RET_TIMEOUTOperation timed out2
Failed to find a free participant indexNo free DDS participant slot

SNMP

4 documented codes

SNMP responses carry an error-status field. Version 1 defines six values; version 2c and 3 extend the set and add per-variable exceptions that appear in place of a value rather than as a request-level error.

CodeMeaningHex / value
noSuchNameerror-status 2 — object does not exist2
tooBigerror-status 1 — response would not fit1
genErrerror-status 5 — general error5
authorizationErrorerror-status 16 — authorization failed16


HTTP / REST

5 documented codes

These are the status codes the Forge API itself returns. They follow standard HTTP semantics, with a few Forge-specific meanings worth stating so you do not debug the wrong layer. · protocol hub

CodeMeaningHex / value
401Unauthorized — missing or invalid API key
402Payment Required — billing, not permissions
403Forbidden — guardrail, and often intentional
422Unprocessable Entity — body shape is wrong
429Too Many Requests — rate limited

CSV ingest

4 documented codes

CSV has no error codes of its own — it is a file format with no protocol layer. What follows are the failures Forge's CSV ingest actually returns, and the data problems that make a CSV normalize badly rather than fail outright. The second group is more dangerous, because nothing errors.

CodeMeaningHex / value
empty_csvNo header row, or no data rows
too_many_fieldsColumn count exceeds the ingest limit
mixed types in a columnA column holds numbers and text (no error raised)
timestamp not recognizedObservation time falls back to ingest time

Connect

One schema for every protocol

Fixing the error gets the data flowing. Forge is what stops you writing a parser per vendor once it does.

# normalize telemetry from every protocol — and 13 other protocols
claude mcp add --transport http forge https://mcp.foundrynet.io/mcp \
  --header 'Authorization: Bearer YOUR_FORGE_KEY'
✓ forge connected — 32 tools available

Protocol hubs · All OEMs

Get the thesis behind this infrastructure — The Machine Agent, weekly.