Modbus function code and Data Type

Source: Internet
Author: User

Table 1 Modbus Function Code
Function Code Name
01 read the coil status to obtain the current status of a group of logical coils (ON/OFF)
02 read the input status to get the current status (ON/OFF) of a set of switch inputs)
03 read the keep register to obtain the current binary value in one or more keep registers
04 read the input register to obtain the current binary value in one or more input registers
05 strong single-coil strong one logic-coil breaking state
06 preset single register load the specific binary value into a holding register
07 read the abnormal status to obtain the disconnection status of eight internal coils. The address of these eight coils is determined by the controller. The user logic can define these coils to indicate the slave status, short packets are suitable for fast reading.
08 send back diagnosis and verification send the diagnosis and verification packets to the slave machine for comments on communication processing
09 programming (only for 484) enables the host to simulate the function of the programmer and modify the PC slave Logic
10. An inquiry (only used for 484) allows the host to communicate with a slave machine that is executing a program task and to check whether the slave machine has completed its operation tasks, this function code is sent only after a message containing the Function Code 9 is sent.
11 reading the event count allows the host to issue a single inquiry and then determine whether the operation is successful, especially when the command or other responses generate a communication error
12. The host retrieves the Modbus transaction communication event records of each slave. If a transaction is processed successfully, the related error is returned.
13 programming (184/384 484 584) allows the host to simulate the programmer function to modify the PC slave Logic
14 inquiry (184/384 484 584) allows the host to communicate with the slave that is performing the task, and regularly checks whether the slave has completed program operations, this function code must be sent only after messages containing function 13 are sent.
15 strong multi-coil strong set a string of continuous logic Coil
16 preset multi-register to load the specific binary value into a series of continuous keep registers
17 Report the slave ID to enable the host to determine the addressing type of the slave and the status of the slave running indicator.
18 (884 and micro 84) enables the host to simulate programming and modify the PC status Logic
19 after a non-modifiable communication link is reset, It is reset from the host to the known status and the sequential bytes can be reset.
20 read common parameters (584l) display the data information in the extended storage file
21. Write the common parameters to the extended storage file or modify them.
22 ~ 64 reserved for extended feature backup
65 ~ 72 reserved for user functions as extended encoding of user functions
73 ~ 119 invalid features
120 ~ 127 reserved for internal use
128 ~ 255 reserved for exception response

Table 2 Modbus function code and Data Type table
Code function data type
01 read bit
02 read bit
03 read integer, fill, status word, floating point type
04 read integer, status word, floating point type
05 write bit
06 write integer, fill, status word, floating point type
08 N/A repeats "loop feedback" Information
15 Write bit
16 Write integer, fill type, status word, floating point type

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.