CN115189985B - Modbus multi-master-station data planning and forwarding device - Google Patents

Modbus multi-master-station data planning and forwarding device Download PDF

Info

Publication number
CN115189985B
CN115189985B CN202211015720.6A CN202211015720A CN115189985B CN 115189985 B CN115189985 B CN 115189985B CN 202211015720 A CN202211015720 A CN 202211015720A CN 115189985 B CN115189985 B CN 115189985B
Authority
CN
China
Prior art keywords
communication
master
time
command
sending
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
CN202211015720.6A
Other languages
Chinese (zh)
Other versions
CN115189985A (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.)
Shenyang Institute of Automation of CAS
Original Assignee
Shenyang Institute of Automation of CAS
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 Shenyang Institute of Automation of CAS filed Critical Shenyang Institute of Automation of CAS
Priority to CN202211015720.6A priority Critical patent/CN115189985B/en
Publication of CN115189985A publication Critical patent/CN115189985A/en
Application granted granted Critical
Publication of CN115189985B publication Critical patent/CN115189985B/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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04JMULTIPLEX COMMUNICATION
    • H04J3/00Time-division multiplex systems
    • H04J3/16Time-division multiplex systems in which the time allocation to individual channels within a transmission cycle is variable, e.g. to accommodate varying complexity of signals, to vary number of channels transmitted
    • 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/403Bus networks with centralised control, e.g. polling
    • 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
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Abstract

The invention belongs to the field of modbus multi-master stations, and particularly relates to a data planning and forwarding device for a modbus multi-master station. Comprising the following steps: the RS485 communication module is used for accessing the original modbusRTU/ASCII communication link and accessing other master stations to the master station interface of the master station; and the controller is used for finding out a communication interval period in each period by monitoring the communication period of the original modbusRTU/ASCII communication link, allowing other added master stations to communicate in the interval period, and realizing the modbusRTU/ASCII multi-master station communication through time-sharing communication. The invention solves the problem that other devices are difficult to collect slave data because only one host computer exists on the modbus bus, and has obvious use effect.

Description

Modbus multi-master-station data planning and forwarding device
Technical Field
The invention belongs to the field of modbus multi-master stations, and particularly relates to a data planning and forwarding device for a modbus multi-master station.
Background
In the equipment informatization of the existing production line, a PLC or an upper computer is often used as a master station to communicate with a lower computer or a slave station such as an instrument and meter through a Modbus protocol, and as the Modbus only has one master station, the data in the slave station cannot be directly obtained in a communication mode, if an original control system of the equipment is modified, the cost risk is high, the required period is long, and the production progress is influenced. Therefore, there is a need for a device that can obtain slave station data by communication in the existing modbusRTU/ASCII protocol bus, without extensive modification of the device itself, by simply incorporating the device into the original link, without affecting the normal production of the device.
Disclosure of Invention
The invention discloses a device capable of realizing multi-master data planning and forwarding in a modbusRTU/ASCII communication link, which is suitable for equipment data acquisition and informatization and solves the problem that the existing modbus of a master station cannot acquire data due to the monopolization of a modbus master station node.
The technical scheme adopted by the invention for achieving the purpose is as follows:
a modbus multi-master data planning and forwarding device, comprising:
the RS485 communication module is used for accessing the original modbusRTU/ASCII communication link and accessing other master stations to the master station interface of the master station;
and the controller is used for finding out a communication interval period in each period by monitoring the communication period of the original modbusRTU/ASCII communication link, allowing other added master stations to communicate in the interval period, and realizing the modbusRTU/ASCII multi-master station communication through time-sharing communication.
The system also comprises an Ethernet communication module which is used for configuring the controller module and interacting the data communicated by the multiple master stations with the upper computer.
The RS485 communication module is provided with a plurality of master station communication ports and a slave station communication port, wherein one master station communication port and one slave station communication port are connected with an original modbusRTU/ASCII communication link, and the added master station module is connected with the communication link through other master station communication ports.
A modbus multi-master station data planning and forwarding method comprises the following steps:
the RS485 communication module is accessed into an original modbusRTU/ASCII communication link, and other master stations are accessed into own master station interfaces;
the controller finds out the communication interval period in each period by monitoring the communication period of the original modbusRTU/ASCII communication link, and allows other added master stations to communicate in the interval period, and the modbusRTU/ASCII multi-master station communication is realized through time-sharing communication.
The system also comprises an Ethernet communication module for configuring the controller module and interacting the data communicated by the multiple master stations with the upper computer.
The controller performs the steps of:
optionally selecting a sending command of an original host station as an initial sending command, and recording the content and sending time of the command;
recording corresponding sending time and corresponding time of each sending command and response in the set time;
if the command with the same content as the initial command is not sent within 90 seconds, the link cannot automatically measure the idle communication time and is manually designated, otherwise, the time of the same command is recorded;
subtracting the two moments to obtain a second monitoring period;
in a second monitoring period, monitoring whether the content of the second sending command is the same as that of the first sending command;
if the two contents are the same, calculating an idle time according to the content, the communication time and the communication period of master-slave communication of the original link, otherwise, reselecting the starting command, and monitoring again;
after the idle time is calculated, whether the time interval of the idle time meets the communication requirement of the added master station is calculated, and if so, a new master station is added for communication.
The invention has the following beneficial effects and advantages:
1. the invention solves the problem that other devices are difficult to collect slave data because only one host computer exists on the modbus bus, and has obvious use effect.
2. The method does not influence the communication of the original equipment on the bus, does not change the original bus structure, and has good use reliability.
3. When in use, the RS485 module is connected in parallel to the original link, and the implementation is simple.
4. The method has lower implementation cost and can externally provide a plurality of interfaces for data communication.
Drawings
FIG. 1 is a schematic diagram of an apparatus for data acquisition over an existing modbusRTU/ASCII communication link;
FIG. 2 is a schematic diagram of an original modbusRTU/ASCII communication link;
FIG. 3 is a schematic diagram of the system accessing an original modbusRTU/ASCII communication link;
fig. 4 is a flow chart of a controller monitoring an original communication link.
Detailed Description
The present invention will be described in further detail with reference to the accompanying drawings and examples.
As shown in fig. 1, the present device mainly includes: the device comprises a controller (1), an RS485 communication module (2) and an Ethernet communication module (3).
The RS485 communication module (2) is provided with a plurality of master station communication ports and a slave station communication port; a main port and a slave port of the RS485 communication module (2) are accessed into an original modbusRTU/ASCII communication link; the added master station module can be connected into a communication link through other master station interfaces of the RS485 communication module (2); the controller (1) requests and responds to information on an original communication link through the RS485 communication module (2), and records the time and the communication interval of each communication; the controller (1) finds out the communication interval period in each period by monitoring the communication period of the original communication link, and allows other added master stations to communicate in the interval period, so as to realize modbusRTU/ASCII multi-master station through time-sharing communication; meanwhile, the device can be configured through the Ethernet communication module (3), and data communicated by multiple main stations are provided outwards through the Ethernet communication module (3).
The RS485 communication module (2) of the device is accessed to any position in the original link (4); the original system link is shown in fig. 2.
The added master station module can access the original link (4) through other master station interfaces of the RS485 communication module (2); the links of the system after joining the device are shown in figure 3.
The RS485 communication module (2) is accessed to the original communication link through an RS485 interface, is connected with information sent by a monitoring master station of a master station interface, and is connected with an interface monitoring slave station of a slave station to monitor information sent by the slave station.
After the original link is accessed, in order to ensure the communication of the original link, the information of the original master station and the information of the slave station need to be forwarded; the data monitored by the master station interface is forwarded to the slave station interface, and the data of the slave station interface is forwarded to the master station interface, so that the normal operation of the original communication link can be ensured.
The controller (1) records the time and communication interval of each communication while forwarding the request and response information;
the added master station is accessed into the device through the master station interface, data which is required to be transmitted to the original link is required to be forwarded to the original slave station interface link through the controller (1), and meanwhile, the original slave station interface returns information for the newly added master station and is also required to be converted back to the added master station through the controller (1).
Since a plurality of master stations exist simultaneously, when the plurality of master stations transmit data and the slave stations return data, the buses are possibly used simultaneously, and bus occupation conflict is generated. In order to avoid bus occupation collision, a controller (1) is required to monitor the communication period of the original communication link, find out the communication interval period in each period, allow other added master stations to communicate in the interval period, and realize modbusRTU/ASCII multi-master station through time-sharing communication.
As shown in fig. 4, the process of the controller (1) monitoring the original communication link is as follows:
1. optionally, taking a transmission command of an original master station as an initial transmission command, and recording the content and the transmission time of the command;
2. recording the corresponding sending moment and corresponding moment of each sending command and response;
3. if the command with the same content as the initial command is not sent within 90 seconds, the link cannot automatically measure the idle communication time and is manually designated;
4. if the same command as the initial sending command appears, recording the moment of the same command;
5. subtracting the two times to be used as a re-monitoring period;
6. monitoring whether the content of the second time is the same as that of the first time in a second monitoring period;
7. if the two contents are the same, the content, the communication time and the communication period of the master-slave communication of the original link can be judged, and the idle time can be calculated;
8. after the idle time is calculated, whether the time interval of the idle time meets the communication requirement of the added master station is calculated, and if so, the added master station can be arranged to communicate;
9. if the two contents are different, the start command is reselected and the monitoring is performed again.
Meanwhile, the device can be configured through the Ethernet communication module (3), and data communicated by multiple main stations are provided outwards through the Ethernet communication module (3).

Claims (5)

1. A modbus multi-master data planning and forwarding device, comprising:
the RS485 communication module is used for accessing the original modbusRTU/ASCII communication link and accessing other master stations to the master station interface of the master station;
the controller is used for finding out a communication interval period in each period by monitoring the communication period of the original modbusRTU/ASCII communication link, allowing other added master stations to communicate in the interval period, and realizing the modbusRTU/ASCII multi-master station communication through time-sharing communication;
the controller performs the steps of:
optionally selecting a sending command of an original host station as an initial sending command, and recording the content and sending time of the command;
recording corresponding sending time and response time of each sending command and response in the set time;
if no command with the same content as the initial command is sent within 90 seconds, the link cannot automatically measure the idle communication time and is manually designated, otherwise, the sending time of the same command is recorded and used as the second sending time, and the same command is used as the second sending command;
subtracting the initial sending time from the second sending time to be used as a second monitoring period;
in a second monitoring period, monitoring whether the content of the second sending command is the same as the content of the initial sending command;
if the two contents are the same, calculating an idle time according to the content, the communication time and the communication period of master-slave communication of the original link, otherwise, reselecting the starting command, and monitoring again;
after the idle time is calculated, whether the time interval of the idle time meets the communication requirement of the added master station is calculated, and if so, a new master station is added for communication.
2. The modbus multi-master data planning and forwarding device according to claim 1, further comprising an ethernet communication module, wherein the ethernet communication module is configured to configure the controller module, and interact data of the multi-master communication with the host computer.
3. The modbus multi-master data planning and forwarding device of claim 1, wherein the RS485 communication module has a plurality of master communication ports and a slave communication port, wherein one master communication port and a slave communication port access an original modbusRTU/ASCII communication link, and the added master module accesses the communication link through the other master communication ports.
4. The modbus multi-master station data planning and forwarding method is characterized by comprising the following steps of:
the RS485 communication module is accessed into an original modbusRTU/ASCII communication link, and other master stations are accessed into own master station interfaces;
the controller finds out a communication interval period in each period by monitoring the communication period of the original modbusRTU/ASCII communication link, and allows other added master stations to communicate in the interval period, and the modbusRTU/ASCII multi-master station communication is realized through time-sharing communication;
the controller performs the steps of:
optionally selecting a sending command of an original host station as an initial sending command, and recording the content and sending time of the command;
recording corresponding sending time and response time of each sending command and response in the set time;
if no command with the same content as the initial command is sent within 90 seconds, the link cannot automatically measure the idle communication time and is manually designated, otherwise, the sending time of the same command is recorded and used as the second sending time, and the same command is used as the second sending command;
subtracting the initial sending time from the second sending time to be used as a second monitoring period;
in a second monitoring period, monitoring whether the content of the second sending command is the same as the content of the initial sending command;
if the two contents are the same, calculating an idle time according to the content, the communication time and the communication period of master-slave communication of the original link, otherwise, reselecting the starting command, and monitoring again;
after the idle time is calculated, whether the time interval of the idle time meets the communication requirement of the added master station is calculated, and if so, a new master station is added for communication.
5. The modbus multi-master data planning and forwarding method according to claim 4, further comprising the step of configuring the controller module by the ethernet communication module and interacting data communicated by the multi-master with the host computer.
CN202211015720.6A 2022-08-24 2022-08-24 Modbus multi-master-station data planning and forwarding device Active CN115189985B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202211015720.6A CN115189985B (en) 2022-08-24 2022-08-24 Modbus multi-master-station data planning and forwarding device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202211015720.6A CN115189985B (en) 2022-08-24 2022-08-24 Modbus multi-master-station data planning and forwarding device

Publications (2)

Publication Number Publication Date
CN115189985A CN115189985A (en) 2022-10-14
CN115189985B true CN115189985B (en) 2023-09-19

Family

ID=83523094

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202211015720.6A Active CN115189985B (en) 2022-08-24 2022-08-24 Modbus multi-master-station data planning and forwarding device

Country Status (1)

Country Link
CN (1) CN115189985B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116566762B (en) * 2023-07-07 2023-10-20 武汉亚为电子科技有限公司 Cascading equipment based on Modbus-RTU protocol and application method thereof

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5852405A (en) * 1995-03-17 1998-12-22 Fujitsu Limited Wireless LAN system
CN1457575A (en) * 2001-03-06 2003-11-19 松下电器产业株式会社 Radio LAN system and radio LAN system signal collision evading method
CN109995632A (en) * 2019-05-16 2019-07-09 阳光电源股份有限公司 Communication means, the apparatus and system of multi-machine communication system
CN111159092A (en) * 2019-12-31 2020-05-15 北京力控华康科技有限公司 Serial port communication system, method and device and electronic equipment
CN212163361U (en) * 2020-07-06 2020-12-15 北京诚益通控制工程科技股份有限公司 Two main station controller communication systems
CN112214441A (en) * 2020-12-08 2021-01-12 北京和利时系统工程有限公司 Communication switching method, equipment and system based on serial bus polling protocol
CN112532496A (en) * 2020-11-30 2021-03-19 西安爱生技术集团公司 CAN bus communication network design method for avoiding conflict
CN114826812A (en) * 2022-02-18 2022-07-29 山东浪潮工业互联网产业股份有限公司 Method and system for realizing RS485 communication multiple master stations

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5331646B2 (en) * 2009-10-14 2013-10-30 株式会社日立製作所 Optical communication system and communication bandwidth control method
DE102019205488A1 (en) * 2019-04-16 2020-10-22 Robert Bosch Gmbh Subscriber station for a serial bus system and method for communication in a serial bus system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5852405A (en) * 1995-03-17 1998-12-22 Fujitsu Limited Wireless LAN system
CN1457575A (en) * 2001-03-06 2003-11-19 松下电器产业株式会社 Radio LAN system and radio LAN system signal collision evading method
CN109995632A (en) * 2019-05-16 2019-07-09 阳光电源股份有限公司 Communication means, the apparatus and system of multi-machine communication system
CN111159092A (en) * 2019-12-31 2020-05-15 北京力控华康科技有限公司 Serial port communication system, method and device and electronic equipment
CN212163361U (en) * 2020-07-06 2020-12-15 北京诚益通控制工程科技股份有限公司 Two main station controller communication systems
CN112532496A (en) * 2020-11-30 2021-03-19 西安爱生技术集团公司 CAN bus communication network design method for avoiding conflict
CN112214441A (en) * 2020-12-08 2021-01-12 北京和利时系统工程有限公司 Communication switching method, equipment and system based on serial bus polling protocol
CN114826812A (en) * 2022-02-18 2022-07-29 山东浪潮工业互联网产业股份有限公司 Method and system for realizing RS485 communication multiple master stations

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
基于Modbus RTU协议实现DCS系统主站通讯与从站通讯;田华艳等;自动化与仪器仪表;全文 *
基于MODBUS协议的多主站技术;戴尔晗, 赵元正, 王汝传;自动化与仪表(06);全文 *

Also Published As

Publication number Publication date
CN115189985A (en) 2022-10-14

Similar Documents

Publication Publication Date Title
CN108733604B (en) 485 bus intelligent expansion method and device based on modbus communication protocol
CN110138624A (en) Vehicle-mounted ethernet test equipment, system and test method
CN106814657B (en) Embedded real-time EtherCAT main website construction method based on ARM
CN110554943B (en) Multi-node server CMC management system and method based on I3C
CN115189985B (en) Modbus multi-master-station data planning and forwarding device
CN113406946B (en) Automobile diagnosis method and device and automobile diagnosis equipment
CN109067633B (en) Power management system and method based on Ethernet daisy chain communication network topology
EP3547049B1 (en) Safety control system and safety control unit
CN107608272A (en) A kind of workshop appliance monitoring system based on Powerlink
CN108512907B (en) Semi-transparent transmission equipment communication method
CN111740879A (en) Data acquisition and data forwarding gateway implementation method
CN110532140B (en) Simulation test system of 1553B bus
CN112965463B (en) Remote diagnosis system and remote diagnosis method
CN111865551B (en) Device and method for coordinated management of multistage system based on fast bus
CN111949456A (en) Serial port protocol automatic test system and method based on configuration updating
CN108345558B (en) RS485 centralized configuration unit supporting multiple protocols
CN116074397A (en) Data sharing system
CN107395478B (en) Network control system and network communication module for high-speed cigarette packaging equipment
CN109388598A (en) A kind of information processing method and general-purpose serial bus USB cluster server
CN207232713U (en) Workshop appliance monitoring system based on Powerlink
CN204944662U (en) Checking weight weigh system
CN111400215A (en) Bus address distribution and communication method based on cascade father node gating
CN202872811U (en) A data acquiring device
CN117254987B (en) Communication method, communication device, and storage medium
CN113341938B (en) Automobile controller testing system and control method thereof

Legal Events

Date Code Title Description
PB01 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