CN101895462A - Serial communication gateway - Google Patents

Serial communication gateway Download PDF

Info

Publication number
CN101895462A
CN101895462A CN2010101020536A CN201010102053A CN101895462A CN 101895462 A CN101895462 A CN 101895462A CN 2010101020536 A CN2010101020536 A CN 2010101020536A CN 201010102053 A CN201010102053 A CN 201010102053A CN 101895462 A CN101895462 A CN 101895462A
Authority
CN
China
Prior art keywords
data
address
packet
gateway
module
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
Application number
CN2010101020536A
Other languages
Chinese (zh)
Other versions
CN101895462B (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.)
Shanghai Wanfeng Culture Communication Co., Ltd.
Original Assignee
袁亚军
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 袁亚军 filed Critical 袁亚军
Priority to CN 201010102053 priority Critical patent/CN101895462B/en
Publication of CN101895462A publication Critical patent/CN101895462A/en
Application granted granted Critical
Publication of CN101895462B publication Critical patent/CN101895462B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)
  • Small-Scale Networks (AREA)

Abstract

The invention discloses a serial communication gateway, comprising an Ethernet communication port and a serial communication port. The Ethernet communication port is connected with an upper computer, and the serial communication port connected with a lower computer. The gateway and the lower computer are uniformly numbered. The gateway comprises a configuring module, a data receiving and transmitting module, a preanalyzing module, a transparent data transmitting module and a data analyzing module, wherein the configuring module is used for configuring the gateway address, local data zone and destination/serial port path; the data receiving and transmitting module is used for receiving and transmitting the packets of the Ethernet communication port and serial communication port, wherein the packets comprise a destination address, a data address and a data value; the preanalyzing module is used for extracting the destination address from the packet; the transparent data transmitting module is used for transmitting the packets to the corresponding port; and the data analyzing module is used for processing the data value in the packets according to the data address and local data zone in the packets. The serial communication gateway can expand and support multiple protocols and ensure the quick exchange of the common data through combining the local data zone and the transparent data transmitting module.

Description

Serial communication gateway
Technical field
The present invention relates to a kind of communication gate, relate in particular to a kind of serial communication gateway.
Background technology
Ethernet and on-the-spot universal serial bus are industrial automation field communication modes commonly used, in fact, no matter be field bus or Industrial Ethernet, situations that has formed many standards and deposited all, kind of fieldbus surplus existing about 40 in the world at present, as the FIP of France, the ERA of Britain, the ProfiBus of Siemens Siemens, the FINT of Norway, the LONWorks of Echelon company, the InterBus of PhenixContact company, the CAN of RoberBosch company, the HART of Rosemounr company, the Dupline of CarloGarazzi company, the P-net of Denmark ProcessData company, the F-Mux of PeterHans company, and ASI (ActraturSensorInterface), MODBus, SDS, Arcnet, International Standards Organization-foundation fieldbus FF:FieldBusFoundat ion, WorldFIP, BitBus, the DeviceNet of the U.S. and ControlNet or the like.These fieldbus mostly are used for fields such as process automation, field of medicaments, processing and manufacturing, communications and transportation, national defence, space flight, agricultural and building, and in protocol conversion, heterogeneous network access procedure, gateway plays an important role.
Serial communication gateway commonly used at present comprises ethernet communication port that connects host computer and the communication port that is connected slave computer, serial communication gateway generally all is to transmit packet according to the address, point of destination, because industry control agreement commonly used is various, the employing data transparency is transmitted, serial communication gateway only need be done simple FPDP conversion to Ethernet and on-the-spot universal serial bus, do not need concrete resolution data, therefore can connect various existing field apparatuss, guarantee that gateway has good expanded function.
Above-mentioned serial communication gateway, because the transmission rate of Ethernet and on-the-spot universal serial bus does not generally match, the rate-constrained of whole communication gate in transmission rate the slowest communication port, in order to guarantee not packet loss of data, serial communication gateway generally all will use message queue to do buffering.Along with improving constantly of communicating requirement, when guaranteeing that gateway has good expanded function, be necessary to provide the quick exchange of communication data commonly used.
Summary of the invention
Technical problem to be solved by this invention provides a kind of serial communication gateway, can expand the support various protocols, can guarantee the quick exchange of frequently-used data again.
The present invention solves the problems of the technologies described above the technical scheme that adopts to provide a kind of serial communication gateway, comprise ethernet communication port that connects host computer and the communication port that is connected slave computer, wherein, the unified numbering of described gateway and described slave computer, described gateway comprises configuration module, and gateway address, local data district and point of destination/serial port path configurations is provided; Data transmit-receive module, the packet of transmitting-receiving ethernet communication port and communication port, described packet comprises address, point of destination, data address and data value; Pre-parsing module extracts the address, point of destination in the packet; The data transparency forwarding module if the address, point of destination in the packet is not a gateway address, is transmitted packet to the corresponding port according to address, point of destination in the packet and port path configuration; Data resolution module if the address, point of destination in the packet is a gateway address, is handled data value in this packet according to the data address in the packet and local data district.
Above-mentioned serial communication gateway, wherein, the static configuration data district that described local data district provides for described configuration module.
Above-mentioned serial communication gateway, wherein, the dynamic configuration data district that described local data district provides for described configuration module, described pre-parsing module extracts the data address in the packet, if described data address does not belong to the local data district, temporary this packet is in certain threshold value, if collect the read-write requests of different port to this data address, then this data address of dynamic assignment is to the local data district.
Above-mentioned serial communication gateway, wherein, if the address, point of destination in the packet is specified described serial communication gateway and slave computer simultaneously, described data transparency forwarding module is transmitted this packet to message queue, when message queue length surpasses threshold value, described data resolution module adopt successively packet in the processing messages formation of local data district until message queue length less than threshold value.
Above-mentioned serial communication gateway, wherein, described local data district is the internal storage data district, restart the back and recover the local data district from fixed memory device to fixed memory device in described gateway timed backup local data district.
The present invention contrasts prior art following beneficial effect: serial communication gateway provided by the invention, support various protocols by the expansion of data transparency forwarding module, the quick exchange of frequently-used data be can guarantee again by the local data district, protocol extension and fast data exchange taken into account.In addition, serial communication gateway of the present invention can also use data forwarding module and local data function of exchange simultaneously and adjust data exchange ways automatically according to network service speed.
Description of drawings
Fig. 1 is a serial communication gateway connection diagram of the present invention;
Fig. 2 is a serial communication gateway structured flowchart of the present invention;
Fig. 3 is a serial communication gateway main flow chart of the present invention;
Fig. 4 is a serial communication gateway dynamic assignment local data of the present invention district flow chart;
Fig. 5 is that the present invention utilizes local data district quick exchange schematic diagram data;
Fig. 6 is that the present invention utilizes data transparency forwarding module swap data schematic diagram.
Among the figure:
11 host computers, 12 serial communication gateways
13 slave computers, 21 configuration modules
22 data transmit-receive modules, 23 pre-parsing modules
24 data transparency forwarding modules, 25 data resolution modules
Embodiment
The invention will be further described below in conjunction with drawings and Examples.
Fig. 1 is a serial communication gateway connection diagram of the present invention; Fig. 2 is a serial communication gateway structured flowchart of the present invention.
See also Fig. 1 and Fig. 2, serial communication gateway 12 provided by the invention, comprise the ethernet communication port that connects host computer 11 and be connected slave computer 13 communication ports, wherein, described gateway 12 and described slave computer 13 unified numberings, described gateway comprises configuration module 21, and gateway address, local data district and point of destination/serial port path configurations is provided; Data transmit-receive module 22, the packet of transmitting-receiving ethernet communication port and communication port, described packet comprises address, point of destination, data address and data value; Pre-parsing module 23 extracts the address, point of destination in the packet; Data transparency forwarding module 24 if the address, point of destination in the packet is not a gateway address, is transmitted packet to the corresponding port according to address, point of destination in the packet and port path configuration; Data resolution module 25 if the address, point of destination in the packet is a gateway address, is handled data value in this packet according to the data address in the packet and local data district.
Above-mentioned serial communication gateway 12 is supported various protocols by 24 expansions of data transparency forwarding module, by the quick exchange that the local data district can guarantee frequently-used data again, has taken into account protocol extension and fast data exchange.Fig. 1 has provided dual serial communication gate 12, and one of them backs up, and forms redundant system, during actual the use, also can singlely use certainly.
Fig. 3 is a serial communication gateway main flow chart of the present invention.
See also Fig. 3, serial communication gateway main flow of the present invention is as follows:
Step S301: serial communication gateway system initialization, configuration module 21 provides gateway address, local data district and port path configuration, wherein, the port path configuration comprises the station number of serial communication gateway station number and slave computer that each communication port connects, and enters step S302 then;
Step S302: the packet of data transmit-receive module 22 transmitting-receiving Ethernet interfaces and communication port, communication port can be the fieldbus of using always, enters step S303 after receiving packet;
Step S303: pre-parsing module 23, extract the address, point of destination in the packet, enter step S304 then;
Step S304: whether the address, point of destination in the judgment data bag is this gateway address, if enter step S306, otherwise enters step S305;
Step S305: data transparency forwarding module 24, transmit packet to the corresponding port according to address, point of destination in the packet and port path configuration, and carry out simple format conversion between Ethernet interface and the communication port, concrete packet is not done to resolve and handle;
Step S306: data resolution module 25 is responsible for the resolution data bag, to read request packet, according to the data address in the packet, searches corresponding value in the local data district and makes up respond packet; To the write request bag, according to data address in the packet and data value, search corresponding address variable in the local data district, upgrade the variables corresponding value and make up respond packet;
Repeat above-mentioned steps S302~step S306 and promptly finish serial communication gateway main flow processing of the present invention.
Above-mentioned serial communication gateway, described local data district is the static configuration data district that is provided by described configuration module 21, in the packet of receiving in the serial communication gateway work,, the data address of request visit then can't not provide exchanges data if not belonging to the local data district.
Fig. 4 is a serial communication gateway dynamic assignment local data of the present invention district flow chart.
See also Fig. 4, serial communication gateway dynamic assignment local data of the present invention district flow process is as follows:
Step S401: the packet of data transmit-receive module 22 transmitting-receiving Ethernet interfaces and communication port, communication port can be the fieldbus of using always, enters step S402 after receiving packet;
Step S402: pre-parsing module 23, extract the address, point of destination in the packet, if the address, point of destination is a gateway address, continue to extract the data address in the packet, enter step S403 then;
Step S403: whether the judgment data address is positioned at the local data district, if then give the data resolution module in the main flow, otherwise enters step S404;
Step S404: continue to judge that gateway has or not the read-write requests that receives from different port,, otherwise enter step S406 if enter step S405;
Step S405: this data address of dynamic assignment is given the data resolution module in the main flow then to the local data district;
Step S406: only receive the request of reading or writing, the temporal data bag, repeating step S401~step S406, if receive a certain data address read or write then this data address of dynamic assignment to the local data district, otherwise surpass threshold value sometime, packet discard.
In addition, serial communication gateway of the present invention can also use data forwarding module and local data function of exchange simultaneously, can specify the address, point of destination simultaneously from the request package of host computer 11 is described serial communication gateway and a certain slave computer, described data transparency forwarding module 24 is transmitted this packet to message queue, promptly when the serial network port communication is smooth and easy, adopt forwarding capability to obtain initial data as far as possible.But when message queue length surpasses threshold value, described data resolution module 25 adopt successively packet in the processing messages formation of local data district until message queue length less than threshold value, promptly when the serial network port communication blocks up, utilize the local data district on the gateway that fast data exchange is provided.
Above-mentioned serial communication gateway, described local data district often adopts the internal storage data district, and local data district as hard disk or USB flash disk, automatically from fixed memory device recovered after restarting to fixed memory device by described gateway timed backup local data district.
In order further to describe the exchanges data flow process of gateway of the present invention, be example with Modbus agreement commonly used below, describe the process that gateway of the present invention utilizes local data district exchange Modbus data in detail.
Fig. 5 is that the present invention utilizes local data district quick exchange schematic diagram data.
See also Fig. 5, controller Controller links to each other with serial communication gateway 12 by Ethernet interface as host computer 11, the Modbus serial device links to each other with serial communication gateway 12 by the RS485 communication port as slave computer 13, wherein, controller Controller and Modbus serial device are as the Master of main website, serial communication gateway 12 utilizes local data district ModbusData that fast data exchange is provided as slave station Slave.The Modbus communication mode comprises broadcast type and replys formula that wherein, the request package form is as follows:
The address, point of destination Function code An initial address high position The initial address low level Register is counted a high position Register is counted low level Byte count Data Checksum CRC
The respond packet form is as follows:
The address, point of destination Function code An initial address high position The initial address low level Register is counted a high position Register is counted low level Checksum CRC
The address, point of destination of standard Modbus agreement is a byte, is described serial communication gateway and a certain slave computer in order to specify the address, point of destination simultaneously, and the present invention can be appointed as the slave computer station number with wherein low four, and Gao Siwei specifies gateway address.If slave computer equipment surpasses 16, can the extended address byte be 2 byte also then.
The data variable of ModbusData, it is the register number, comprise coiled type state variable (Coil status), input switch amount (Input status), input register variable (Input register), internal register variable (Holding register) and extended register variable (Extended register), concrete data address is allocated as follows:
Coil?status:1-9999
Input?status:10001-19999
Input?register:30001-39999
Holding?register:40001-49999
Extended?register:600001-665535
Local data district ModbusData is according to can be according to using needs, or static state or the above-mentioned data field of dynamic-configuration.
Controller Controller goes up communication module ModnetM and sends the Modbus/TCP request package, Modbus/TCP is that Modbus forms the TCP information frame according to the Modbus call format, as step 1., comprise address, point of destination, data address and request command in the request package, wherein, the address, point of destination is the station number of serial communication gateway 12, and serial communication gateway 12 is received request package, utilize ModbusData to make up respond packet, 2. as step.In like manner, the Modbus serial device sends the Modbus request package, as step 3., comprise address, point of destination, data address and request command in the request package, wherein, the address, point of destination is the station number of serial communication gateway 12, and serial communication gateway 12 is received request package, utilize ModbusData to make up respond packet, 4. as step.Controller Controller and Modbus serial device, one-period is read the ModbusData on the serial communication gateway 12, another periodically writes the ModbusData on the serial communication gateway 12, promptly finishes the fast data exchange between controller Controller and Modbus serial device.
Fig. 6 is that the present invention utilizes data transparency forwarding module swap data schematic diagram.
See also Fig. 6, after serial communication gateway 12 is received request package on the host computer 11, as step 1., carry out simple port format conversion, be about to Modbus/TCP based on Ethernet and convert Modbus to based on serial ports, pre-parsing module on the serial communication gateway 12 23 extracts the address, point of destination of request package then, and shut the binding relationship of each serial port and purpose station number according to Home Network, transmit request package from the corresponding port and give corresponding slave computer 13, be Modbus Serial Device, 2. as step; The Modbus serial device, after promptly slave computer 13 is received the Modbus request package that forwards, the response bag, as step 3., serial communication gateway 12 transmitted response bags are given host computer 11, as step 4..By above-mentioned steps 1.~4., host computer 11 and slave computer 13 are finished exchanges data one time.
Though the present invention discloses as above with preferred embodiment; right its is not in order to qualification the present invention, any those skilled in the art, without departing from the spirit and scope of the present invention; when can doing a little modification and perfect, so protection scope of the present invention is when with being as the criterion that claims were defined.

Claims (5)

1. a serial communication gateway comprises it is characterized in that ethernet communication port that connects host computer and the communication port that is connected slave computer, the unified numbering of described gateway and described slave computer, and described gateway comprises:
Configuration module provides gateway address, local data district and point of destination/serial port path configurations;
Data transmit-receive module, the packet of transmitting-receiving ethernet communication port and communication port, described packet comprises address, point of destination, data address and data value;
Pre-parsing module extracts the address, point of destination in the packet;
The data transparency forwarding module if the address, point of destination in the packet is not a gateway address, is transmitted packet to the corresponding port according to address, point of destination in the packet and port path configuration;
Data resolution module if the address, point of destination in the packet is a gateway address, is handled data value in this packet according to the data address in the packet and local data district.
2. serial communication gateway according to claim 1 is characterized in that, the static configuration data district that described local data district provides for described configuration module.
3. serial communication gateway according to claim 1, it is characterized in that, the dynamic configuration data district that described local data district provides for described configuration module, described pre-parsing module extracts the data address in the packet, if described data address does not belong to the local data district, temporary this packet is in certain threshold value, if collect the read-write requests of different port to this data address, then this data address of dynamic assignment is to the local data district.
4. serial communication gateway according to claim 1, it is characterized in that, if the address, point of destination in the packet is specified described serial communication gateway and slave computer simultaneously, described data transparency forwarding module is transmitted this packet to message queue, when message queue length surpasses threshold value, described data resolution module adopt successively packet in the processing messages formation of local data district until message queue length less than threshold value.
5. according to the described arbitrary serial communication gateway of claim 1 to 4, it is characterized in that described local data district is the internal storage data district, restart the back and recover the local data district from fixed memory device to fixed memory device in described gateway timed backup local data district.
CN 201010102053 2010-01-28 2010-01-28 Serial communication gateway Expired - Fee Related CN101895462B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 201010102053 CN101895462B (en) 2010-01-28 2010-01-28 Serial communication gateway

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 201010102053 CN101895462B (en) 2010-01-28 2010-01-28 Serial communication gateway

Publications (2)

Publication Number Publication Date
CN101895462A true CN101895462A (en) 2010-11-24
CN101895462B CN101895462B (en) 2012-12-19

Family

ID=43104535

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 201010102053 Expired - Fee Related CN101895462B (en) 2010-01-28 2010-01-28 Serial communication gateway

Country Status (1)

Country Link
CN (1) CN101895462B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102098800A (en) * 2010-12-28 2011-06-15 中兴通讯股份有限公司 Processing device and processing system for mobile gateway, and method for processing data
CN102938728A (en) * 2012-10-18 2013-02-20 北京经纬纺机新技术有限公司 Method for converting Modbus TCP (Transmission Control Protocol)/IP (Internet Protocol) into Modbus serial gateway
CN105282019A (en) * 2014-12-29 2016-01-27 中国科学院沈阳自动化研究所 Service-based data gateway configurable method and system
CN105812346A (en) * 2015-12-12 2016-07-27 重庆川仪自动化股份有限公司 Data interaction method of serial port device and Ethernet device
CN107276870A (en) * 2017-06-15 2017-10-20 上海诺仪表有限公司 The data transmission method and device of instrument slave computer
CN110166481A (en) * 2019-06-03 2019-08-23 易事特智能化系统集成有限公司 A kind of power equipment protocol conversion system and method

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1220360C (en) * 2003-06-20 2005-09-21 上海大学 Method and apparatus for protocol switch between MODBUS/TCP industrial Ethernet and device network field bus
CN100438517C (en) * 2006-04-30 2008-11-26 中国移动通信集团公司 Family gateway equipment
CN101482643B (en) * 2009-02-23 2010-09-22 中国科学院光电技术研究所 Bidimensional large-diameter fast control reflection mirror

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102098800A (en) * 2010-12-28 2011-06-15 中兴通讯股份有限公司 Processing device and processing system for mobile gateway, and method for processing data
CN102098800B (en) * 2010-12-28 2014-09-10 中兴通讯股份有限公司 Processing device and processing system for mobile gateway, and method for processing data
CN102938728A (en) * 2012-10-18 2013-02-20 北京经纬纺机新技术有限公司 Method for converting Modbus TCP (Transmission Control Protocol)/IP (Internet Protocol) into Modbus serial gateway
CN102938728B (en) * 2012-10-18 2015-08-19 北京经纬纺机新技术有限公司 A kind of Modbus TCP/IP turns the implementation method of the gateway of Modbus serial
CN105282019A (en) * 2014-12-29 2016-01-27 中国科学院沈阳自动化研究所 Service-based data gateway configurable method and system
CN105812346A (en) * 2015-12-12 2016-07-27 重庆川仪自动化股份有限公司 Data interaction method of serial port device and Ethernet device
CN107276870A (en) * 2017-06-15 2017-10-20 上海诺仪表有限公司 The data transmission method and device of instrument slave computer
CN107276870B (en) * 2017-06-15 2020-08-28 上海一诺仪表有限公司 Data transmission method and device of instrument lower computer
CN110166481A (en) * 2019-06-03 2019-08-23 易事特智能化系统集成有限公司 A kind of power equipment protocol conversion system and method

Also Published As

Publication number Publication date
CN101895462B (en) 2012-12-19

Similar Documents

Publication Publication Date Title
JP7024047B2 (en) EtherCAT master-slave integrated bridge controller and control method
CN101895462B (en) Serial communication gateway
CN101917316B (en) Communication method and device for high-speed real-time industrial Ethernet
Jansen et al. Real-time Ethernet: the EtherCAT solution
US20130262714A1 (en) Fieldbus gateway using virtual serial filedbus port and data transmission method thereof
CN101454763B (en) Gateway for data transfer between serial buses
US9467309B2 (en) Network distributor
CN102332971B (en) Field-bus full duplex reliable communication method for numerical control system
CN102035688B (en) Design method for rapidly controlling network link access
CN212163361U (en) Two main station controller communication systems
CN105187283A (en) Industrial control network slave station communication method and device based on EtherCAT protocol
CN102843288A (en) Method for transmitting data packets
CN112666905B (en) Multichannel communication control system and channel control method
US20100146225A1 (en) Acyclic data transfer via a field bus coupler
CN101145052B (en) Real-time information interactive system between apparatuses and method
US6907488B1 (en) Serial data transmission via a bus system
CN101753486B (en) Industrial automation field bus gateway equipment
CN101415027B (en) Communication module based on HDLC protocol, and control method for data real time forwarding and storage
CN103248547A (en) Fast data capture method for slave station in Modbus RTU (remote terminal unit) and slave station
CN103346943A (en) Method and system of data transmission
US20040114582A1 (en) Electronic switching circuit and method for a communication interface with buffer storage
US20080091850A1 (en) Method for processing consistent data sets
CN1798113A (en) Profibus bus - bridge of Ethernet network
Park et al. Design of an integrated fieldbus gateway
CN103001839A (en) Automatic configuration setting system, automatic configuration setting gateway and automatic configuration setting method by means of command learning

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
ASS Succession or assignment of patent right

Owner name: SHANGHAI WANFENG CULTURAL TRANSMISSION CO., LTD.

Free format text: FORMER OWNER: YUAN YAJUN

Effective date: 20150225

C41 Transfer of patent application or patent right or utility model
COR Change of bibliographic data

Free format text: CORRECT: ADDRESS; FROM: 201101 MINHANG, SHANGHAI TO: 200335 CHANGNING, SHANGHAI

TR01 Transfer of patent right

Effective date of registration: 20150225

Address after: 200335, Shanghai, Changning District, No. 33, Canton Road, industry and Trade District, B room, North third floor

Patentee after: Shanghai Wanfeng Culture Communication Co., Ltd.

Address before: 201101 Shanghai Minhang District City 1597 Longming Road No. 51 Lane 401

Patentee before: Yuan Yajun

CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20121219

Termination date: 20190128

CF01 Termination of patent right due to non-payment of annual fee