M12 Connector Coding Guide

Posted by SZFRS Engineering Team

M12 connectors dominate industrial signal and power connectivity. The 12 mm threaded coupling is reliable, the IP67 sealing is well-proven, and the form factor accepts everything from 3-pin sensor connections to 17-pin signal multiplexing. The complication is the coding system — nine different codes (A, B, C, D, L, S, T, X, Y) that look similar from the outside but have completely different pinouts and electrical purposes. Mating an A-coded connector to a D-coded receptacle is mechanically blocked but selecting the wrong code in a system specification creates installation problems and rework. This guide walks through each code, what it does, and how to choose.

TL;DR — Quick Answer

A-coded is the most common — sensors, actuators, general signal I/O, 3-12 pin variants. B-coded served PROFIBUS DP and is in legacy installations. C-coded handles AC sensor and contactor wiring. D-coded is 100 Mbps Ethernet (PROFINET, EtherCAT, EtherNet/IP) — 4 pins. X-coded is 10 Gbps Ethernet — 8 pins, the modern choice for industrial high-speed networks. L-coded handles 24V DC power distribution at higher current than A-coded can carry. S-coded handles 3-phase AC up to 630V. T-coded is DC power up to 60V. Y-coded handles hybrid signal-plus-data applications. Below covers each in practical detail with selection guidance.

A-Coded — The Workhorse

A-coded M12 is the dominant code in industrial automation. Available 3, 4, 5, 8, and 12 pin variants. Used for proximity sensors, photoelectric sensors, ultrasonic sensors, encoder signals, valve actuators, indicator lights, IO-Link devices, and general industrial I/O wiring. The pinout convention is standardized — pin 1 is +24V, pin 3 is 0V, signal pins follow application convention.

Where A-coded dominates: sensor wiring across factory automation, IO-Link device connections, conveyor and machine I/O, AGV sensor inputs, robot end-effector sensor connections, valve manifold control, and any application where a few pins of mixed power and signal need to be routed. Industrial wire harness work covers A-coded extensively across customer programs.

The cable construction is typically PVC or PUR jacket with 22 AWG or 24 AWG conductors, depending on current requirement. PUR for drag chain or rough environments; PVC for static installations. Standard cable lengths run 2 m to 30 m, with 5 m being a common stock length.

D-Coded — 100 Mbps Industrial Ethernet

D-coded M12 carries 100 Mbps Ethernet over 4 pins (2 twisted pairs). PROFINET, EtherCAT, and EtherNet/IP all run on D-coded for legacy installations and devices that don’t need higher bandwidth. The keying prevents accidental mating with A-coded sensors that share the M12 form factor.

Where D-coded wins: legacy industrial Ethernet installations, PROFINET-based factory networks, EtherCAT slave-to-master in systems where 100 Mbps is sufficient, IO-Link masters connecting back to PLCs, and any field bus implementation that doesn’t require gigabit speeds. The cable construction follows Cat5e specifications — typically PUR jacket for drag chain, two twisted pairs.

D-coded is increasingly being replaced by X-coded for new installations as gigabit and 10G become more common. New programs should default to X-coded unless there’s a specific reason to stay on D-coded.

X-Coded — Modern 10 Gbps Ethernet

X-coded M12 carries 10 Gbps Ethernet over 8 pins (4 twisted pairs) — Cat6A construction in M12 form factor. The keying is incompatible with D-coded so there’s no mating risk between Ethernet generations. Power over Ethernet (PoE+, PoE++) is supported through the same 8-pin arrangement when required.

Where X-coded dominates: GigE Vision and 10GigE Vision cameras, IIoT edge gateways needing more than 100 Mbps backhaul, modern PROFINET and EtherCAT installations standardizing on gigabit, robot vision systems, AGV onboard networking, and high-bandwidth factory automation. The cable handles full 10 Gbps over typical industrial run distances (passive 30 m, longer with optical or active extension).

X-coded has become the new default for industrial Ethernet in new programs. Drag-chain rated X-coded cable using PUR jacket survives millions of flex cycles for robot-mounted vision and moving gantry applications.

L-Coded — 24V DC Power Distribution

L-coded M12 handles 24V DC power distribution at higher current than A-coded can manage. 5-pin variant rated for 16A, 4-pin variant rated for 16A, with proper conductor sizing. The keying prevents accidental connection of power into a signal port.

Where L-coded wins: drive panel power distribution, conveyor motor power feed, AGV battery and charger connections, IIoT edge device power input from a 24V DC bus, and field-distributed I/O master power. The pinout reserves dedicated power and ground pins; signaling-grade pinouts are not interchangeable.

L-coded cable construction uses 16 AWG or 18 AWG conductors to handle the rated current with appropriate margin. Insulated jacket is rated for industrial environment — typically PUR for drag chain, PVC for static installations.

S-Coded — 3-Phase AC Power

S-coded M12 handles 3-phase AC power up to 630V. 4 pins (3 phase + ground) or 4+2 (3 phase + ground + auxiliary). Used for AC motor connections in compact industrial systems where a full M12 form factor is desirable for sealing and mechanical retention.

Where S-coded wins: small industrial AC motors, fan motor power, pump connections in compact machinery, AC distribution to remote subsystems, and any 3-phase application that benefits from M12 compatibility with the broader industrial connector family. The connector ratings (typically 12A or 16A per phase) match small motor and fan applications.

B, C, T, Y Coded — Specialized Applications

  • B-coded. Originally for PROFIBUS DP — RS485 differential signaling. Largely legacy now as PROFIBUS gives way to PROFINET. Still found in installed base.
  • C-coded. AC sensors and contactors. Less common than A-coded for new installations. Found in legacy contactor wiring.
  • T-coded. DC power up to 60V — between A-coded (low current) and L-coded (higher current). Found in some legacy applications.
  • Y-coded. Hybrid signal-plus-data applications. Combines low-voltage signal with data lines in a single connector. Used in some specialized industrial applications.

Side-by-Side Comparison Table

CodePinsVoltage / SpeedPrimary UseStatus
A-coded3, 4, 5, 8, 1230V DC sensor levelsSensors, IO-Link, general I/ODominant
B-coded5RS485 PROFIBUSPROFIBUS DP fieldbusLegacy
C-coded4, 5AC sensorAC sensors, contactorsLegacy
D-coded4100 Mbps EthernetPROFINET, EtherCAT, EtherNet/IPBeing phased out
L-coded4, 524V DC, 16ADC power distributionStandard for power
S-coded4, 6630V 3-phase ACAC motor, AC distributionStandard for AC
T-coded460V DCMid-current DC powerLegacy
X-coded810 Gbps EthernetModern industrial EthernetNew default
Y-coded8 hybridMixed signal + dataSpecialized hybrid applicationsNiche

Application Selection Framework

ApplicationRecommended CodeReasoning
Proximity / photoelectric sensorA-coded 4 pinStandard sensor wiring
IO-Link deviceA-coded 4 pinStandard IO-Link wiring
Encoder signalA-coded 8 or 12 pinQuadrature plus index plus power
Valve actuator (24V)A-coded 4 pinStandard valve wiring
PROFINET legacy installationD-codedMatch installed base
PROFINET new installationX-codedModern default, gigabit ready
EtherCAT new installationX-codedModern default, future-proof
GigE Vision cameraX-coded 8 pinGigabit Ethernet with industrial sealing
10GigE Vision cameraX-coded 8 pin10 Gbps Cat6A construction
24V drive panel power feedL-coded16A current capability
AGV battery connectionL-codedDC power capability
IIoT edge gateway powerL-coded 4 pin24V DC power input
Small AC motorS-coded3-phase AC capability
Cooling fan AC powerS-coded3-phase AC distribution
Robot vision drag chainX-coded PUR jacket10G with flex life
PROFIBUS legacyB-codedMatch installed base

A Common Mistake — Mixing Codes in Specifications

The most common M12 spec error we see is mixing codes within a single program — sensors specified A-coded but connector accessories ordered as D-coded, or attempting to use a D-coded cable on an X-coded port and discovering the keying blocks the connection. The codes are mechanically incompatible by design, so the field installation hits the problem; the spec writer should have caught it earlier.

The other frequent issue is specifying old codes for new installations. PROFIBUS B-coded continues to show up in specs even though most new fieldbus installations use PROFINET or EtherCAT now. D-coded shows up when X-coded would future-proof the installation for gigabit upgrades. Reviewing the connector code list against actual application requirements catches these issues before procurement.

PROFINET, EtherCAT, EtherNet/IP — Same Cable, Different Protocol

One source of confusion: D-coded and X-coded M12 cables are physically identical regardless of which Ethernet protocol runs on top. The cable doesn’t know whether the network is PROFINET, EtherCAT, EtherNet/IP, or generic Ethernet — it’s just twisted pair signaling. The protocol differences live in the device firmware and PLC programming, not the cable.

This means a D-coded or X-coded M12 patch cable works for any of those Ethernet protocols. Specifications sometimes call out “PROFINET cable” or “EtherCAT cable” as if they were different products, but the physical cable is the same. The protocol-specific behavior happens at the device level.

Bottom Line

M12 coding selection follows function — A for sensors and general I/O, D for legacy 100 Mbps Ethernet, X for modern 10 Gbps Ethernet, L for 24V DC power, S for AC power, with B/C/T/Y for specific legacy and specialized applications. New installations should default to A-coded for sensors and X-coded for Ethernet unless there’s a specific reason otherwise. The keying system prevents physical mating mistakes, but specification mistakes happen before installation and cost more to fix later.

Related Reading


M12 Cable Program?

Send us your M12 application — code, pin count, length, drag chain or static, jacket material preference, and any required fieldbus protocol. We’ll quote within 48 hours.

Similar Posts