CN106506307B - A kind of Modbus frame format self-described method - Google Patents

A kind of Modbus frame format self-described method Download PDF

Info

Publication number
CN106506307B
CN106506307B CN201611198341.XA CN201611198341A CN106506307B CN 106506307 B CN106506307 B CN 106506307B CN 201611198341 A CN201611198341 A CN 201611198341A CN 106506307 B CN106506307 B CN 106506307B
Authority
CN
China
Prior art keywords
self
register
byte
address
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201611198341.XA
Other languages
Chinese (zh)
Other versions
CN106506307A (en
Inventor
张杭
高建虎
丁洁
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
NANJING INTELLIGENT APPARATUS CO Ltd
Original Assignee
NANJING INTELLIGENT APPARATUS CO Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by NANJING INTELLIGENT APPARATUS CO Ltd filed Critical NANJING INTELLIGENT APPARATUS CO Ltd
Priority to CN201611198341.XA priority Critical patent/CN106506307B/en
Publication of CN106506307A publication Critical patent/CN106506307A/en
Application granted granted Critical
Publication of CN106506307B publication Critical patent/CN106506307B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/40006Architecture of a communication node
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L12/4013Management of data rate on the bus
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • H04L2012/40208Bus networks characterized by the use of a particular bus standard
    • H04L2012/40228Modbus

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Quality & Reliability (AREA)
  • Communication Control (AREA)

Abstract

The invention discloses a kind of Modbus frame format self-described methods, including register data type can self-described;Register address low byte can self-described before in preceding or high byte;Register data low byte can self-described before in preceding or high byte;The function code that register, relay, intake read-write are supported can self-described;Register, relay, intake initial address definition can self-described;Register, relay, intake quantity can self-describeds;CRC check low byte can self-described before in preceding or high byte.Slave computer increases Modbus frame format self-description information, and host computer goes calling data according to the self-description information of slave computer and parse data by instruction calling slave computer self-description information, can easily realize communication matching and data parsing matching.Substantially increase in this way between communication apparatus can interconnectivity, increase the versatility and flexibility of upper computer software, reduce the workload of upper computer software change.

Description

A kind of Modbus frame format self-described method
Technical field
The present invention is led between industrial control unit (ICU) or using based on Modbus agreement between controller and computer The occasion of letter;Especially multiple slave computer Modbus protocol frame formats are inconsistent, and host computer must modify program or configuration ability The application of normal communication.
Background technique
Modbus agreement is applied to a kind of all-purpose language on electronic controller.By this agreement, controller mutually it Between, controller can communicate via between network (such as Ethernet) and other equipment.It has become a kind of universal industrial mark It is quasi-.There is it, the control equipment of different vendor's production can be linked to be industrial network, carry out Centralized Monitoring.This protocol defines one A controller can recognize the message structure used, but regardless of them be communicated by which kind of network.It describes one Controller requests access to the process of other equipment, how to respond the request from other equipment, and how to detect mistake and remember Record.It has formulated the common format of message field layout and content.This agreement support traditional RS-232, RS-422, RS-485 and Ethernet device.Many industrial equipments, including PLC, DCS, intelligence instrument etc. all use Modbus agreement as between them Communication standard.It is all kinds of using the equipment based on Modbus agreement, but not all equipment based on Modbus agreement All communicated in strict accordance with identical frame format.Common difference mainly includes following several classes: 1, register data type;2, Register address low byte is in preceding or high byte preceding;3, register data low byte is in preceding or high byte preceding;4, it posts The function code that storage, relay read-write are supported;5, register, relay, the definition of intake initial address;6, register, relay Device, intake quantity;7, CRC check low byte is in preceding or high byte preceding.These differences are all brought to equipment room communication Inconvenience, the host computer communicated with must modify according to its agreement, could normal communication and parsing data.
Summary of the invention
Deficiency for existing use based on Modbus protocol devices, in order to solve the problems, such as that communication equipment agreement is inconsistent, And host computer must be modified for different agreement, the drawbacks of reducing integrated efficiency and increase cost, the invention proposes as follows A kind of new technical solution.
The technical solution adopted by the present invention are as follows: a kind of Modbus frame format self-described method, by being based on to existing Modbus protocol devices frame format difference summarizes and analyzes, and increases self-description information to difference section.Original communication equipment only needs Increase the support to self-description information interaction, so that it may easily realize that host computer communicates the adaptive of interconnection with slave computer.It is the next Machine increases self-description information to above-mentioned inconsistent place;Host computer calls slave computer self-description information by instruction, then root Calling data are gone again according to the self-description information of slave computer and parse data, can easily realize communication matching and data parsing Match.The interconnectivity between communication apparatus is substantially increased in this way, reduces the workload of upper computer software change.
Above-mentioned Modbus frame format self-described technical solution, it is further characterized by: register data type can be certainly Description;Register address low byte can self-described before in preceding or high byte;Register data low byte is in preceding or high word Section can self-described before;The function code that register, relay, intake read-write are supported can self-described;Register, is opened relay Entering the definition of amount address can self-described;Register, relay, intake quantity can self-describeds;CRC check low byte is preceding or high Byte can self-described before.
The invention the utility model has the advantages that the present invention increases the existing equipment based on Modbus in a kind of simple and practical method Add self-description information, upper computer and lower computer, which need to only increase, can easily realize interconnection to the support of self-description information interaction; Solve upper computer and lower computer because agreement it is inconsistent can not normal communication, host computer need to modify program or configuration the drawbacks of.
Detailed description of the invention
Fig. 1 is the self-description information interaction diagrams of the embodiment of the present invention.
Specific embodiment
Below by way of specific embodiment, the following further describes the technical solution of the present invention.
It is as follows to define self-description information frame format:
Host computer requests ADU:
Device address 1 byte
Function code 1 byte 0x71
Check code 1 byte 0x5A
Cumulative and verification 1 byte
Slave computer responds ADU:
Wherein register data type definition is as follows:
Register data type Meaning
0 In vain
1 16 signed binaries
2 16 unsigned binary numbers
3 4 binary-coded decimals
4 32 signed binaries
5 32 unsigned binary numbers
6 8 binary-coded decimals
7 32 floating numbers
8 ASCII character character string
Individual address tableau format is defined as follows (m=6):
Note: serial number is numbered from 1.
The function code wherein supported accounts for 2 bytes, and low byte is preceding, and high byte is rear;Corresponding position 1 indicates to support this function Energy code, every is defined as follows:
An existing slave computer supports the communication based on Modbus agreement, device address 1, and register data type is 16 Signed binary, register address high byte preceding, register data low byte preceding, cyclic redundancy check high byte preceding, Modbus address table and the function code of support are as follows:
Initial address Quantity The function code of support
Relay 0x0000 0x08 0x01、0x05、0x0F
Discrete intake 0x2000 0xA8 0x02
Input register 0x3000 0x2F 0x03、0x04
Output register 0x5000 0x20 0x03、0x06、0x10
Specified register 0x8000 0x05 0x03、0x06、0x16
Upper computer and lower computer is based on Modbus protocol communication, and to interconnect process automatically as follows:
1, host computer carries out calling self-description information according to process shown in Fig. 1, and it is as follows that host computer sends message:
0x01 0x71 0x5A 0xCC//device address, function code, check code, cumulative and verification
2, slave computer receives host computer message, and after judging address and cumulative and verification correctly, response message is as follows:
0x01 0x71 0x5A//device address, function code, check code
0x01//register data type is 16 signed binaries
0x21//register address high byte is preceding
0x12//register data low byte is preceding
0x21//CRC high byte is preceding
0x05//5 address table
0x1E//address table byte number
0x01 0x00 0x00 0x08 0x00 0x51//address table 1
0x02 0x20 0x00 0xA8 0x00 0x02//address table 2
0x03 0x30 0x00 0x2F 0x00 0x0C//address table 3
0x04 0x50 0x00 0x20 0x00 0xA4//address table 4
0x05 0x80 0x00 0x05 0x01 0x24//address table 5
0x9F//cumulative and verification
3, host computer receives self-description information message, after judging address, check code and cumulative and verification correctly, according to certainly The function code of the byte sequence, address table and the support that provide in description information carries out calling slave computer data, according to register class Type and byte sequence parsing data.
The present invention has been described by way of example and in terms of the preferred embodiments, but they be not for limiting the present invention, it is any to be familiar with this skill Skill person can make various changes or retouch from working as, therefore protection scope of the present invention without departing from the spirit and scope of the invention It should be subject to what claims hereof protection scope was defined.

Claims (2)

1. a kind of Modbus frame format self-described method, slave computer increases Modbus frame format self-description information, and host computer passes through Instruction calling slave computer self-description information, goes calling data according to the self-description information of slave computer and parses data, realize communication Matching and data parsing matching;It is characterized by:
It can self-described including register data type;Register address low byte can self-described before in preceding or high byte;It posts Latch data low byte can self-described before in preceding or high byte;The function code that register, relay, intake read-write are supported It can self-described;Register, relay, intake initial address definition can self-described;Register, relay, intake quantity can Self-described;CRC check low byte can self-described before in preceding or high byte;
The calling self-description information frame that host computer issues includes: device address, function code, check code and cumulative and verification;
Upper computer and lower computer is based on Modbus protocol communication, and to interconnect process automatically as follows:
Host computer carries out calling self-description information according to process, and it is as follows that host computer sends message:
0x01 0x71 0x5A 0xCC // device address, function code, check code, cumulative and verification slave computer receive host computer report Text, after judging address and cumulative and verification correctly, response message is as follows:
0x01 0x71 0x5A // device address, function code, check code
0x01 // register data type is 16 signed binaries
0x21 // register address high byte is preceding
0x12 // register data low byte is preceding
0x21 //CRC high byte is preceding
0x05 // 5 address table
0x1E // address table byte number
0x01 0x00 0x00 0x08 0x00 0x51 // address table 1
0x02 0x20 0x00 0xA8 0x00 0x02 // address table 2
0x03 0x30 0x00 0x2F0x00 0x0C // address table 3
0x04 0x50 0x00 0x20 0x00 0xA4 // address table 4
0x05 0x80 0x00 0x05 0x01 0x24 // address table 5
0x9F // cumulative and verification
Host computer receives self-description information message, after judging address, check code and cumulative and verification correctly, is believed according to self-described The function code of the byte sequence, address table and the support that provide in breath carries out calling slave computer data, according to register type and word Section sequence parsing data.
2. Modbus frame format self-described method according to claim 1, it is characterised in that: the register data type Can self-described, selection: 16 signed binaries, 16 unsigned binary numbers, 4 binary-coded decimals, 32 have symbol binary system Number, 32 unsigned binary numbers, 8 binary-coded decimals, 32 floating numbers, ASCII character character string;
The register address, register data and CRC check low byte preceding or high byte before can self-described, 0x12 table Show low byte preceding, 0x21 indicates high byte preceding;
The function code that the register, relay, intake read-write are supported can self-described, pass through every representatives of 16 control words and prop up Different function codes is held to select.
CN201611198341.XA 2016-12-22 2016-12-22 A kind of Modbus frame format self-described method Active CN106506307B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201611198341.XA CN106506307B (en) 2016-12-22 2016-12-22 A kind of Modbus frame format self-described method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201611198341.XA CN106506307B (en) 2016-12-22 2016-12-22 A kind of Modbus frame format self-described method

Publications (2)

Publication Number Publication Date
CN106506307A CN106506307A (en) 2017-03-15
CN106506307B true CN106506307B (en) 2019-08-16

Family

ID=58335030

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201611198341.XA Active CN106506307B (en) 2016-12-22 2016-12-22 A kind of Modbus frame format self-described method

Country Status (1)

Country Link
CN (1) CN106506307B (en)

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112180881B (en) * 2020-10-22 2021-05-18 华能青岛热电有限公司 Thermal power generating unit main control DCS trans-regional data communication integration system
CN112822083B (en) * 2021-01-25 2022-03-01 华电通用轻型燃机设备有限公司 MODBUS application layer-oriented data verification method and system
CN113824626B (en) * 2021-09-24 2023-12-22 广东科瑞德电气科技有限公司 Communication management method for preventing information interaction loss
CN114598567A (en) * 2022-03-03 2022-06-07 深圳市元征科技股份有限公司 Communication method, apparatus and storage medium
CN115174306B (en) * 2022-07-04 2023-07-25 北京广利核系统工程有限公司 Modbus communication memory optimization method, communication method and related device
CN116489254B (en) * 2023-06-21 2023-09-08 中储粮成都储藏研究院有限公司 Method for debugging lower computer by using upper computer

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102478797A (en) * 2010-11-22 2012-05-30 中国科学院空间科学与应用研究中心 Monitoring system with configurable communication protocol
CN103545933A (en) * 2013-11-11 2014-01-29 国家电网公司 Instation I/O interface protocol of intelligent substation online monitoring system
CN104052631A (en) * 2014-05-22 2014-09-17 中兴通讯股份有限公司 Equipment information collecting method, device and system
CN104578419A (en) * 2015-01-07 2015-04-29 山东鲁能智能技术有限公司 Transformer substation communication power supply monitoring system and method
CN104734980A (en) * 2015-04-10 2015-06-24 常州多维信息科技有限公司 Industrial field bus multi-protocol router and multi-protocol conversion method

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102478797A (en) * 2010-11-22 2012-05-30 中国科学院空间科学与应用研究中心 Monitoring system with configurable communication protocol
CN103545933A (en) * 2013-11-11 2014-01-29 国家电网公司 Instation I/O interface protocol of intelligent substation online monitoring system
CN104052631A (en) * 2014-05-22 2014-09-17 中兴通讯股份有限公司 Equipment information collecting method, device and system
CN104578419A (en) * 2015-01-07 2015-04-29 山东鲁能智能技术有限公司 Transformer substation communication power supply monitoring system and method
CN104734980A (en) * 2015-04-10 2015-06-24 常州多维信息科技有限公司 Industrial field bus multi-protocol router and multi-protocol conversion method

Also Published As

Publication number Publication date
CN106506307A (en) 2017-03-15

Similar Documents

Publication Publication Date Title
CN106506307B (en) A kind of Modbus frame format self-described method
CN112052242A (en) Data query method and device, electronic equipment and storage medium
CN102736565B (en) Communication method of automatic control equipment based on upper and lower computer structures
CN106933632A (en) FPGA function online upgrading methods based on Ethernet
CN102663094A (en) IEC61970CIM model checking method
CN113065314B (en) BIOS hardware adaptation method and device based on XML file format
CN107122343A (en) A kind of online contract template edit methods and system
CN103095726A (en) Processing method and device of protocol interpreter
CN112199556A (en) Automatic XML Schema file format conversion method, system and related equipment
CN112882995A (en) Script automatic generation method and device, electronic equipment and storage medium
CN112306473B (en) Program interface parameter transmission method, system and related equipment
CN105450656A (en) APP data configuration method, device, server and system
CN103390079B (en) A kind of interval alarm window drawing generating method based on common template
CN107301067A (en) Beidou subscriber machine remote update system and its upgrade method based on IAP technologies
CN110460473A (en) Communication configuration method and device of configuration software and computer readable storage medium
CN208284230U (en) A kind of speech recognition equipment, speech recognition system and smart machine
CN106599058A (en) RCD file model checking method and checking device
CN109471878A (en) A kind of substation's telecontrol device automatic comparison system
CN105917307A (en) User interface framework
CN205281479U (en) Intelligent substation's SCD file inspection device
CN111859826A (en) Method and tool for converting PROTEL netlist into ALLEGRO text
CN110020413B (en) Method and device for detecting IMIX message and electronic equipment
CN113468836B (en) Data processing method, data processing device, storage medium and electronic equipment
CN105608097A (en) Method and device for adaptively adjusting database structure
CN105242592B (en) The method and system of HART meter parameter are directly read by PROFIBUS PA active station

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant