What are the data types of Modbus? What is the difference between them?

freeFree Technical Resource

This content is free to read, suitable for basic learning and search traffic.

What are the data types of Modbus? What is the difference between them?缩略图

In the Modbus protocol, commonly used data types include the following:

  1. Coils: The Coils data type represents the state of a single switch, which can indicate on/off, true/false, and other states. It can only read and write a single bit, and can be read or written using function codes 01H or 05H.
  2. Discrete inputs: The D discrete inputs data type represents the state of the input and can only be read, not written. The function code 02H can be used to perform read operations on Discrete inputs.
  3. 16 bit unsigned integers (Input Register): The Input Register data type represents unsigned 16 bit integers that can only be read and not written. The function code 04H can be used to perform read operations on the Input Register.
  4. 16 bit signed integers (Holding Register): The data type of Holding Register represents a signed 16 bit integer that can be read and written. Function codes 03H or 06H can be used to perform read and write operations on Holding Register.

The difference between these data types lies in their functions and operation types. Coil and Discrete Input can only be read, while Input Register and Holding Register can be read and written. In addition, Input Register and Holding Register also distinguish between signed and unsigned types. In practical applications, appropriate data types are selected for communication and operation based on different application scenarios and the types of data that need to be collected.

Put this resource to use in a real project?

Go to the Tool Center for message parsing, CRC verification and device debugging, or submit your requirements for selection and integration advice.

Engineer Membership

Turn this article into actionable debugging resources

After activation, you can use advanced message parsing, resource pack downloads, code examples, engineering cases and priority technical support, suitable for real project delivery.

Unlimited Advanced Tools
Resource & Code Packs
Complete Engineering Case Library
Priority Technical Support

Leave a Reply

Your email address will not be published. Required fields are marked *.