CN103595625A - Method for achieving communication gateway - Google Patents
Method for achieving communication gateway Download PDFInfo
- Publication number
- CN103595625A CN103595625A CN201310613622.7A CN201310613622A CN103595625A CN 103595625 A CN103595625 A CN 103595625A CN 201310613622 A CN201310613622 A CN 201310613622A CN 103595625 A CN103595625 A CN 103595625A
- Authority
- CN
- China
- Prior art keywords
- modbus
- gateway
- concurrent
- read command
- mapping table
- 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.)
- Granted
Links
Images
Landscapes
- Small-Scale Networks (AREA)
- Communication Control (AREA)
Abstract
The invention provides a method for achieving a communication gateway. The method for achieving the communication gateway is characterized by comprising the steps that firstly, concurrence function configuration is conducted on the gateway; secondly, two data mapping tables are formed by the gateway; thirdly, according to control types, different values are set to unit identifier fields in a Modbus/TCP message by a Modbus/TCP master station needing concurrence control; fourthly, after the Modbus/TCP message from the Modbus/TCP master station is received by the gateway, the values of the unit identifier fields are judged, if the values of the unit identifier fields are specific values, concurrence control is conducted, and if the values of the unit identifier fields show the address of a sub station, unique control is conducted. The method for achieving the communication gateway has the following advantages that the problems that the polling cycle of a multi-device network is long and data are slow in refreshing are solved. It is guaranteed that real-time data and non-real-time data of a device can be collected at the same time according to different requirements. The burden of data processing of an upper-layer Ethernet system is relieved.
Description
Technical field
The present invention relates to a kind of Communication Gateway, belong to industrial automation and industrial communication field.
Background technology
Modbus/TCP Industrial Ethernet is the Industrial Ethernet of market share maximum, and application prospect is good.Modbus agreement easily realizes because its principle is simple, in industrial automation, power automatic system, has a wide range of applications.Therefore how by supporting the field bus device of Modbus agreement to be seamlessly linked in Modbus/TCP Industrial Ethernet, by networking mode, realize the concurrent control of field bus device and single control are just become to a current demand.
Along with the increase of control system complexity, the demand of concurrent control and single control is more and more.Concurrent control can reduce the underlying device poll time effectively, improves system response time.Single control is the assurance of control system flexibility.As in Lighting Control Assembly, need to complete the centralized control to a region or several regions inner light source by a control command, to reach the demand of unified switch light source or Landscape Lighting, need again to control flexibly single light source simultaneously; For another example in intelligent energy management domain, need to a plurality of energy collection devices, conduct interviews by a control command, this moment energy SDI of real-time acquisition system, have simultaneously and need to conduct interviews to single energy collection device control, to its data analysis or adjust its acquisition parameter.
In upper layer communication network using Modbus/TCP agreement, underlying device adopts in the control system of Modbus agreement.If gateway not only can be realized simple protocol conversion, can, in conjunction with to the concurrent control of institute's attached device and single control, the demand for control of this type of control system will well be solved so simultaneously.But technology known today and product, not yet well solve the problem that in this type of control system, concurrent control combines with single control.
The implementation method that the patent of invention of application number 201210397405.4 provides a kind of Modbus TCP/IP to turn the serial gateway of Modbus, whether the method passes data by instruction area divided data from gateway swaps out still.The defect of this kind of mode is, first it can only an equipment connected in series, cannot realize the concurrent control of equipment; Secondly, the instruction mechanism of swapping out that this equipment is used causes it can only be operated under a kind of command status, and equipment is controlled very flexible.
Summary of the invention
The technical problem Shi Shi Modbus/TCP main website that will solve of the present invention realizes the point-to-point single access control to Modbus RTU slave station, and Modbus/TCP main website also can carry out concurrent control to several ModbusRTU slave stations of be reappointed or reelected consecutively meaning simultaneously.
In order to solve the problems of the technologies described above, technical scheme of the present invention has been to provide a kind of implementation method of communication gate, it is characterized in that, step is:
The first step, gateway is carried out to concurrent function configuration: be that any Modbus RTU equipment of gateway connected adds a Modbus read command and/or a Modbus write order, repeat above-mentioned steps, until add Modbus read command and/or Modbus write orders or be that a Modbus RTU equipment adds the Modbus read command of many groups and/or Modbus write orders for many Modbus RTU equipment of gateway connected;
Second step, gateway form two data mapping tables, are respectively the read command data address mapping table of all concurrent Modbus RTU equipment, the write order data address mapping table of all concurrent Modbus RTU equipment;
The 3rd step, the Modbus/TCP main website that need to carry out concurrent control are set to different value according to the cell designation symbol field of controlling in type Modbus/TCP message, if carry out concurrent control, cell designation accords with field and is set to particular value, if carry out single control, cell designation accords with the tributary address that field is set to corresponding Modbus RTU slave station;
The 4th step, gateway receive after the Modbus/TCP message from Modbus/TCP main website, the value of judging unit indicator field, if particular value, contrasting read command address mapping table and write order address mapping table is reappointed or reelected consecutively meaning Modbus RTU equipment to it and carries out concurrent control, if tributary address,, to corresponding ModbusRTU slave station transparent transmission Modbus/TCP message, realize single control.
Preferably, in second step, described read command data address mapping table and described write order data address mapping table are continuous storage areas, this storage area carries out consecutive order sequence to user configured read command or write order, and the total length of read command or write order is no more than the length of Modbus/TCP message regulation.
Preferably, in the 4th step, when described gateway carries out concurrent control to Modbus RTU equipment, for concurrent, read instruction, gateway is kept at the data based read command data address mapping table of reading in gateway data buffer area, for concurrent write command, gateway, according to write order data address mapping table, periodically mails to relevant Modbus RTU equipment by data in inner buffer.
Feature of the present invention is:
Solve the compatibility issue of concurrent control and single control.Equipment can become ModbusRTU main website after configuring, and concurrent conducts interviews to gateway connected Modbus equipment, obtains each device data and state.Upper strata Modbus/TCP main website can obtain gateway by a message and be reappointed or reelected consecutively data and the state information of several the equipment of anticipating and realize concurrent control.Simultaneously upper strata Modbus/TCP main website also can carry out transparent transmission to arbitrary equipment that gateway connects by Modbus/TCP instruction and accesses and realize single control.
Tool of the present invention has the following advantages:
1, well to have solved many device networks polling cycle long in the concurrent control of data, the problem that Refresh Data is slow.User only just can, to the multiple devices control that conducts interviews, compare traditional polling mechanism Refresh Data speed and be improved largely by a Modbus/TCP message.
2, concurrent control and single control deposit, guarantee that equipment real time data can gather according to different demands from non-real-time data simultaneously.
3, gateway replaces Modbus RTU main website to realize the periodic access to equipment, and the data set mid point of access control is moved down, and has alleviated the burden of upper strata Ethernet system data processing.
Accompanying drawing explanation
Fig. 1 is equipment application block diagram;
Fig. 2 is Parallel access control and single access control flow chart;
Fig. 3 is concurrent write command data address mapping table;
Fig. 4 is the concurrent director data address mapping table of reading.
Embodiment
For the present invention is become apparent, hereby with preferred embodiment, and coordinate accompanying drawing to be described in detail below.
In conjunction with Fig. 1 and Fig. 2, the invention provides a kind of implementation method of communication gate, the steps include:
The first step, gateway is carried out to concurrent function configuration: be that any Modbus RTU equipment of gateway connected adds a Modbus read command and/or a Modbus write order, repeat above-mentioned steps, until add Modbus read command and/or Modbus write orders or be that a Modbus RTU equipment adds the Modbus read command of many groups and/or Modbus write orders for many Modbus RTU equipment of gateway connected.
Second step, gateway form two data mapping tables, are respectively the read command data address mapping table of all concurrent Modbus RTU equipment, as shown in Figure 3, and the write order data address mapping table of all concurrent Modbus RTU equipment, as shown in Figure 4.
Read command data address mapping table and write order data address mapping table are continuous storage areas, this storage area carries out consecutive order sequence to user configured read command or write order, and the total length of read command or write order is no more than the length of Modbus/TCP message regulation.During concurrent operations, according to read command data address mapping table and write order data address mapping table, read/write command is once shone upon, by a Modbus/TCP, read instruction and realize the Concurrency Access to read/write data.
The 3rd step, the Modbus/TCP main website that need to carry out concurrent control are set to different value according to the cell designation symbol field of controlling in type Modbus/TCP message, if carry out concurrent control, cell designation accords with field and is set to particular value, if carry out single control, cell designation accords with the tributary address that field is set to corresponding Modbus RTU slave station;
The 4th step, gateway receive after the Modbus/TCP message from Modbus/TCP main website, the value of judging unit indicator field, if particular value, contrasts read command address mapping table and write order address mapping table and it is reappointed or reelected consecutively to meaning Modbus RTU equipment carries out concurrent control.For concurrent, read instruction, gateway is kept at the data based read command data address mapping table of reading in gateway data buffer area, for concurrent write command, gateway, according to write order data address mapping table, periodically mails to relevant Modbus RTU equipment by data in inner buffer.If tributary address,, to corresponding Modbus RTU slave station transparent transmission Modbus/TCP message, realizes single control.
Claims (3)
1. an implementation method for communication gate, is characterized in that, step is:
The first step, gateway is carried out to concurrent function configuration: be that any Modbus RTU equipment of gateway connected adds a Modbus read command and/or a Modbus write order, repeat above-mentioned steps, until add Modbus read command and/or Modbus write orders or be that a Modbus RTU equipment adds the Modbus read command of many groups and/or Modbus write orders for many Modbus RTU equipment of gateway connected;
Second step, gateway form two data mapping tables, are respectively the read command data address mapping table of all concurrent Modbus RTU equipment, the write order data address mapping table of all concurrent Modbus RTU equipment;
The 3rd step, the Modbus/TCP main website that need to carry out concurrent control are set to different value according to the cell designation symbol field of controlling in type Modbus/TCP message, if carry out concurrent control, cell designation accords with field and is set to particular value, if carry out single control, cell designation accords with the tributary address that field is set to corresponding Modbus RTU slave station;
The 4th step, gateway receive after the Modbus/TCP message from Modbus/TCP main website, the value of judging unit indicator field, if particular value, contrasting read command address mapping table and write order address mapping table is reappointed or reelected consecutively meaning Modbus RTU equipment to it and carries out concurrent control, if tributary address,, to corresponding ModbusRTU slave station transparent transmission Modbus/TCP message, realize single control.
2. the implementation method of a kind of communication gate as claimed in claim 1, it is characterized in that, in second step, described read command data address mapping table and described write order data address mapping table are continuous storage areas, this storage area carries out consecutive order sequence to user configured read command or write order, and the total length of read command or write order is no more than the length of Modbus/TCP message regulation.
3. the implementation method of a kind of communication gate as claimed in claim 1, it is characterized in that, in the 4th step, when described gateway carries out concurrent control to Modbus RTU equipment, for concurrent, read instruction, gateway is kept at the data based read command data address mapping table of reading in gateway data buffer area, for concurrent write command, gateway, according to write order data address mapping table, periodically mails to relevant Modbus RTU equipment by data in inner buffer.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310613622.7A CN103595625B (en) | 2013-11-27 | 2013-11-27 | A kind of communication gate realize method |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201310613622.7A CN103595625B (en) | 2013-11-27 | 2013-11-27 | A kind of communication gate realize method |
Publications (2)
Publication Number | Publication Date |
---|---|
CN103595625A true CN103595625A (en) | 2014-02-19 |
CN103595625B CN103595625B (en) | 2016-07-06 |
Family
ID=50085614
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201310613622.7A Active CN103595625B (en) | 2013-11-27 | 2013-11-27 | A kind of communication gate realize method |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN103595625B (en) |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104407983A (en) * | 2014-12-02 | 2015-03-11 | 上海电器科学研究院 | Modbus address remapping method used for electric quantity module |
CN105897574A (en) * | 2016-05-27 | 2016-08-24 | 中国东方电气集团有限公司 | Modbus RTU/TCP gateway device supporting double-Ethernet and double-master-station redundancy |
CN107220070A (en) * | 2017-08-01 | 2017-09-29 | 浙江佳乐科仪股份有限公司 | A kind of Internet of Things DTU collecting methods |
CN108540584A (en) * | 2018-02-10 | 2018-09-14 | 西安融盛智汇电子科技有限公司 | A kind of general Modbus protocol address configuration methods |
CN111445654A (en) * | 2019-12-09 | 2020-07-24 | 珠海派诺科技股份有限公司 | Quick access method for fire monitoring system, fire monitoring system and storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101741770A (en) * | 2009-12-23 | 2010-06-16 | 上海电器科学研究所(集团)有限公司 | Ethernet/IP communication gateway and implementation method thereof |
WO2012060019A1 (en) * | 2010-11-01 | 2012-05-10 | Telefonaktiebolaget L M Ericsson (Publ) | Gateway apparatus, control method therefor and computer program |
CN102938728A (en) * | 2012-10-18 | 2013-02-20 | 北京经纬纺机新技术有限公司 | Method for converting Modbus TCP (Transmission Control Protocol)/IP (Internet Protocol) into Modbus serial gateway |
-
2013
- 2013-11-27 CN CN201310613622.7A patent/CN103595625B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101741770A (en) * | 2009-12-23 | 2010-06-16 | 上海电器科学研究所(集团)有限公司 | Ethernet/IP communication gateway and implementation method thereof |
WO2012060019A1 (en) * | 2010-11-01 | 2012-05-10 | Telefonaktiebolaget L M Ericsson (Publ) | Gateway apparatus, control method therefor and computer program |
CN102938728A (en) * | 2012-10-18 | 2013-02-20 | 北京经纬纺机新技术有限公司 | Method for converting Modbus TCP (Transmission Control Protocol)/IP (Internet Protocol) into Modbus serial gateway |
Non-Patent Citations (1)
Title |
---|
俞野秋: "基于modbus和modbus TCP协议的远程监控技术研究", 《中国优秀硕士学位论文全文数据库》 * |
Cited By (9)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104407983A (en) * | 2014-12-02 | 2015-03-11 | 上海电器科学研究院 | Modbus address remapping method used for electric quantity module |
CN104407983B (en) * | 2014-12-02 | 2017-05-17 | 上海电器科学研究院 | Modbus address remapping method used for electric quantity module |
CN105897574A (en) * | 2016-05-27 | 2016-08-24 | 中国东方电气集团有限公司 | Modbus RTU/TCP gateway device supporting double-Ethernet and double-master-station redundancy |
CN105897574B (en) * | 2016-05-27 | 2021-11-05 | 中国东方电气集团有限公司 | Modbus RTU/TCP gateway device supporting double-network double-master redundancy |
CN107220070A (en) * | 2017-08-01 | 2017-09-29 | 浙江佳乐科仪股份有限公司 | A kind of Internet of Things DTU collecting methods |
CN107220070B (en) * | 2017-08-01 | 2020-09-08 | 浙江佳乐科仪股份有限公司 | DTU data acquisition method for Internet of things |
CN108540584A (en) * | 2018-02-10 | 2018-09-14 | 西安融盛智汇电子科技有限公司 | A kind of general Modbus protocol address configuration methods |
CN108540584B (en) * | 2018-02-10 | 2021-01-15 | 西安融盛智汇电子科技有限公司 | Universal Modbus protocol address configuration method |
CN111445654A (en) * | 2019-12-09 | 2020-07-24 | 珠海派诺科技股份有限公司 | Quick access method for fire monitoring system, fire monitoring system and storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN103595625B (en) | 2016-07-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN108040005B (en) | Digit control machine tool intelligent monitoring gateway based on thing networking | |
CN103595625A (en) | Method for achieving communication gateway | |
CN201966855U (en) | AC (alternating current) servo control system based on Ether CAT network | |
CN109257208A (en) | A kind of information integrated system and method based on OPC UA | |
CN205485380U (en) | Industrial data collection system | |
CN103455463B (en) | A kind of main control unit communication accesses and produces method | |
CN103825883A (en) | Multi-protocol conversion equipment based on wireless ZigBee, CAN bus and MODBUS/TCP and realization method thereof | |
CN102833141A (en) | CAN (control area network) open slave station system based on DSP (digital signal processor) 28335 | |
CN108650127B (en) | Automatic identification method for distribution transformer area power grid based on one-line bus mode | |
CN101741770A (en) | Ethernet/IP communication gateway and implementation method thereof | |
CN104539502A (en) | Method for adding modbus equipment in customized manner | |
CN104767598A (en) | Data transmission system and method used between energy storage power station site equipment | |
CN201163782Y (en) | Intelligent network gateway used for EPA/HART interconnection | |
CN203445899U (en) | Embedded gateway based on Modbus and TCP/IP protocol conversion | |
CN102263709A (en) | Gateway for realizing communication transformation between EtherCAT (Ethernet for control and automation technology) and RS485 and communication method thereof | |
CN208903126U (en) | A kind of information integrated system based on OPC UA | |
CN104283978A (en) | Equipment control method, system and converter and third-party control system | |
CN202918326U (en) | Intelligent multi-serial switch | |
CN201926904U (en) | Multi-interface data acquisition unit based on OPC technology | |
CN205028119U (en) | Servo universal control system of gas -liquid based on PCI bus | |
CN114466039A (en) | OPCUA communication system and method based on 5G private network | |
CN102710017B (en) | MMS-based interaction method and system of real-time data of intelligent substation | |
CN205038504U (en) | Wind stores up monitored control system | |
CN202696645U (en) | Modularized and channelized Ethernet gateway | |
CN103135538B (en) | Efficient method for collecting data of converter of energy storage power 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 | ||
C14 | Grant of patent or utility model | ||
GR01 | Patent grant |