N
Gossip Blast Daily

What is a Modbus Function Code?

Author

Emily Baldwin

Updated on March 30, 2026

What is a Modbus Function Code?

A function code (FC) in Modbus is a specific code used in a Modbus request to tell the Modbus slave device what type of memory (i.e. holding registers, input coils, etc) to access and what action to perform on that memory (i.e. reading or writing).

How do you read Modbus input register?

Function 04 – Read Input Registers Registers are addressed starting at zero: meaning registers 1–10 are addressed as 0–9. Modbus Function 04 also includes the quantity of registers to read from the Modbus slave device. See the example command below that reads one register, 30010 from Modbus Slave address 01.

What is a Modbus exception code?

If a Modbus device responds to a request with an exception response, a value of 0x80 is added to the function code with a logical OR operation to form the error code in the response packet. It is followed by one of the exception codes that represent the reason for the error in the next byte of the packet.

What is difference between Modbus and BACnet?

BACnet is different from Modbus is several ways. First, the data that BACnet sends can be much more complex. The data is organized in “objects” and each object has “properties”. For example, a pressure transmitter might send one object called “Process Pressure”.

How do you troubleshoot Modbus communication?

Troubleshooting RS485 / Modbus RTU Wiring

  1. Check that communication settings parameters are correct (baud rate, etc).
  2. Check that the slave address matches with the id assigned in data logger.
  3. Check modbus wiring.
  4. Check for reversed polarity on RS485 lines. If uncertain, just try swapping them.

What is Modbus register table?

Modbus Registers Tables. General Description. The following chapters describe the Modbus registers of the MicroLogic trip unit and the Modbus registers of the modules connected to it. These registers provide information that can be read, like electrical measures, protection configuration, and monitoring information.

How do you do Modbus communication?

A conversation is always started by a master in the Modbus network. A Modbus master sends a message, and depending on the contents of the message, the slave interprets the message and responds to it. Physical slave addressing in the message header is used to define which slave device should respond to a message.

What is the difference between Modbus and BACnet networks?

All ModBus networks are implemented utilizing a master-slave arrangement where all Crest boilers are slaves and the master is a building automation system capable of communicating over RS-485 serial connections. BACnet networks are implemented using a token passing process where multiple masters and slaves share a common RS-485 bus.

Is the BACnet interface a Master only?

Th e Lochinvar BACnet interface is a master only. 3 2 ModBus Confi guration Addressing

What are the function codes for the analog input registers?

04: The Function Code 4 (read Analog Input Registers) 0008: The Data Address of the first register requested. ( 0008hex = 8 , + 30001 offset = input register #30009 ) 0001: The total number of registers requested. (read 1 register) B298: The CRC (cyclic redundancy check) for error checking. Response 11 04 02 000AF8F4

What is the baud rate for the Modbus board?

Th e baud rate for the ModBus board is selectable with Dip switch #9. 1 = 19200 bps 0 = 9600 bps Each message is started by at least 3.5 character times of silence. Th e maximum delay between frames is 1.5 character times.