Skip to main content
RUGGED COMPUTING · CONNECTORS

What Is an M12 B-Coded Connector?

An M12 B-coded connector is the M12 coding reserved for PROFIBUS fieldbus networks. It usually has 5 pins and a key on the opposite side to A coding, so a fieldbus cable cannot be connected to a sensor or power port by mistake. It is defined in IEC 61076-2-101.

01

What a B-coded M12 connector is

An M12 B-coded connector is the M12 coding reserved for PROFIBUS fieldbus, with a key on the opposite side to the standard A coding. It usually has 5 pins and is defined in IEC 61076-2-101, the same standard as the A, C and D codings.

B coding exists to keep the fieldbus separate. PROFIBUS devices on a machine sit alongside sensors that use A-coded M12, and the cables look much the same. Moving the key means a fieldbus cable can never be screwed onto a sensor port, or a sensor cable onto the bus, during installation or maintenance.

PROFIBUS itself is a fieldbus standardised in IEC 61158 and IEC 61784. Its DP version runs over an RS-485 physical layer at up to 12 Mbit/s, linking PLCs to drives, remote I/O and valve islands.

B coding marks the DP version specifically. PROFIBUS PA, the process automation version used on instruments in chemical and water plants, runs at 31.25 kbit/s over a two-wire bus that also powers the devices, and it commonly uses A-coded M12 instead. A site with both versions therefore has two connector codings for what is nominally one fieldbus, and the coding is a quick way to tell which segment a cable belongs to.

02

B-coded pinout for PROFIBUS

The PROFIBUS guidelines assign the five pins of a B-coded connector as shown. The data lines use the standard PROFIBUS cable colours, so a technician can check a termination by eye.

Pin Signal Function Typical wire
1 VP +5 V supply for bus termination Not always connected
2 A line Data (negative, RxD/TxD-N) Green
3 DGND Data ground for termination Not always connected
4 B line Data (positive, RxD/TxD-P) Red
5 Shield Cable screen Braid

Assignments for pins 1 and 3 vary between device makers, so check the datasheet before relying on them to power a terminating resistor.

03

Cable, speed and distance

PROFIBUS DP cable is a shielded twisted pair with a characteristic impedance of 150 ohm, usually with a violet outer sheath. The higher the data rate, the shorter each segment can be:

  • //
    Up to 93.75 kbit/s. Segments of around 1,200 m.
  • //
    500 kbit/s. Around 400 m per segment.
  • //
    1.5 Mbit/s. Around 200 m per segment, a common setting on factory lines.
  • //
    12 Mbit/s. Around 100 m per segment.
  • //
    Devices per segment. Up to 32 including repeaters, with up to 126 addresses on the whole network.
04

Termination and B-coded accessories

Each PROFIBUS segment needs an active terminator at both ends. With M12, that is usually a B-coded terminating plug screwed onto the last device, rather than a switch on a 9-pin D-sub connector. T-pieces and Y-splitters keep the bus continuous when a device is removed, so the rest of the line keeps running during a swap.

One caution from our own catalogue: a few rugged computers use a B-coded socket for their DC power input, because the key stops a sensor cable being connected by mistake. Never assume a B-coded socket on a computer is a PROFIBUS port; read the datasheet first. Our overview of M12 codings shows how the other codings are used.

05

Finding faults on a B-coded segment

PROFIBUS is tolerant of noise when it is wired well and unforgiving when it is not. Most faults on an M12 segment trace back to a handful of causes, and checking them in order saves time on site.

First, confirm there are exactly two active terminators, one at each end, and none in the middle. A missing terminator causes reflections at higher data rates; an extra one loads the line and shrinks the signal. Second, check the A and B lines are not crossed at any connector, which is easy to do on a field-wired plug. Third, check the shield is bonded at every device and that the cable is genuine 150 ohm PROFIBUS cable rather than general-purpose twisted pair. Finally, check the segment length against the data rate. Dropping the bus from 12 Mbit/s to 1.5 Mbit/s often makes an over-long segment work while a repeater is fitted.

FAQ · 01
Is Modbus the same as PROFIBUS?
No. Both can run over RS-485, but Modbus is a simpler, openly published protocol used widely on meters, drives and controllers, while PROFIBUS is a faster, deterministic fieldbus built around Siemens-led PLC systems. They need separate interfaces or a gateway to talk to each other.
Read the full FAQ —
06

B-coded connectors and PROFINET

Many plants now move from PROFIBUS to PROFINET, which runs over Ethernet on D-coded or X-coded M12 instead. B-coded connectors remain common on existing lines and wherever fieldbus devices are extended or replaced, and a mixed site often runs both for years. An edge computer that collects data from such a line usually connects to the PROFINET side over Ethernet and reaches PROFIBUS devices through the PLC or a gateway.

Our IP67 computers use M12 Ethernet for that connection, and our guide to M12 waterproof connectors explains why sealed connectors suit the machine side.

07

Quick answers on M12 B-coded connectors

M12 B-coded: common questions

What is a B-coded M12 used for?

PROFIBUS. Mainly PROFIBUS DP fieldbus connections to drives, remote I/O and valve islands, plus some other RS-485 based buses.

What is the difference between A-coded and B-coded M12?

The key position. B coding moves the key to the opposite side of the insert, so B-coded fieldbus cables and A-coded sensor cables cannot mate.

Does B-coded M12 carry Ethernet?

No. Ethernet on M12 uses D coding for 100 Mbit/s or X coding for Gigabit and faster.

How fast is PROFIBUS over B-coded M12?

Up to 12 Mbit/s. PROFIBUS DP runs from 9.6 kbit/s to 12 Mbit/s. The connector supports the full range; segment length and cable quality set the practical limit.

Do I need a terminator on a B-coded network?

Yes, at both ends. Fit an active B-coded terminating plug at the first and last device on each segment.

We integrate edge computers with the Ethernet, serial and fieldbus gateway connections a line needs as standard, and we check the coding of every port against your cabling before the system ships.