Skip to content
Search

Modbus

lastmod 2025-11-06created 2017-03-2626 edits

Modbus is a serial communications protocol originally published by Modicon (now Schneider Electric) in 1979 for use with its programmable logic controllers (PLCs). Simple and robust, it has since become a de facto standard communication protocol, and it is now a commonly available means of connecting industrial electronic devices. The main reasons for the use of Modbus in the industrial environment are:

  • developed with industrial applications in mind
  • openly published and royalty-free
  • easy to deploy and maintain
  • moves raw bits or words without placing many restrictions on vendors

Projects

Simulators

Data types

Type

Description

Value

Example uses

Coil

Digital output (read/write)

0 or 1
ON/OFF

Motor ON/OFF
Valve open/close
Lamp control

Discrete Input

Digital input (read-only)

0 or 1
ON/OFF

Button state
Sensor detection
Limit switch

Holding Register

Analog output (read/write)

16bit integer
-32768~32767

Speed setpoint
Temperature setpoint
Control parameters

Input Register

Analog input (read-only)

16bit integer
-32768~32767

Temperature reading
Pressure reading
Current/voltage

Terms

Origin of the term Coil

It means Coil = Digital Output (DO).

The term "coil" comes from the old days of relays:

전류 → [코일] → 자기장 발생 → 접점 ON/OFF

Today it is electronic, but the term is still used.

Function Code

Official standard Function Codes (Public)

The most commonly used standard codes:

Official standard Function Codes (Public)

FC

Name

Description

01

Read Coils

Read coil status

02

Read Discrete Inputs

Read discrete inputs

03

Read Holding Registers

Read holding registers

04

Read Input Registers

Read input registers

05

Write Single Coil

Write a single coil

06

Write Single Register

Write a single register

15

Write Multiple Coils

Write multiple coils

16

Write Multiple Registers

Write multiple registers

Extended Function Codes

Standard codes for additional functions:

Extended Function Codes

FC

Name

Description

07

Read Exception Status

Read exception status

08

Diagnostics

Diagnostics

11

Get Comm Event Counter

Communication event counter

17

Report Slave ID

Report slave ID

20

Read File Record

Read file record

21

Write File Record

Write file record

22

Mask Write Register

Mask write register

23

Read/Write Multiple Registers

Read/write multiple registers

43

Read Device Identification

Read device identification

User-defined range

Can be defined by manufacturers or for special purposes:

FC 65-72, 100-110: user-definable range

See also

Favorite site

Basics

Spec samples

author Zer0 sitemap