CN111327503B - MODBUS bus-based multi-master-station token scheduling device, communication method and system - Google Patents

MODBUS bus-based multi-master-station token scheduling device, communication method and system Download PDF

Info

Publication number
CN111327503B
CN111327503B CN202010160115.2A CN202010160115A CN111327503B CN 111327503 B CN111327503 B CN 111327503B CN 202010160115 A CN202010160115 A CN 202010160115A CN 111327503 B CN111327503 B CN 111327503B
Authority
CN
China
Prior art keywords
token
configuration table
address
address information
information configuration
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
CN202010160115.2A
Other languages
Chinese (zh)
Other versions
CN111327503A (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.)
Mingdu Zhiyun Zhejiang Technology Co Ltd
Original Assignee
Mingdu Zhiyun Zhejiang Technology 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 Mingdu Zhiyun Zhejiang Technology Co Ltd filed Critical Mingdu Zhiyun Zhejiang Technology Co Ltd
Priority to CN202010160115.2A priority Critical patent/CN111327503B/en
Publication of CN111327503A publication Critical patent/CN111327503A/en
Application granted granted Critical
Publication of CN111327503B publication Critical patent/CN111327503B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

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
    • 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/407Bus networks with decentralised control
    • H04L12/417Bus networks with decentralised control with deterministic access, e.g. token passing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • 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

Abstract

The invention discloses a MODBUS bus-based multi-master token scheduling device, which is provided with a first interface, a second interface and a controller, wherein the first interface is connected with a master station, the second interface is connected with slave stations and other token scheduling devices through buses, the controller stores a first address information configuration table and a second address information configuration table, the first address information configuration table comprises slave station parameters, self protocol addresses and fixed broadcast addresses, and the second address information configuration table comprises self protocol addresses of the rest token scheduling devices; the controller is configured to sequentially acquire MODBUS bus control power and communicate with the corresponding master station for communication through a preset token rotation mode. And the MODBUS bus multi-master station communication is realized through a token scheduling mechanism of the multi-master station token scheduling device.

Description

MODBUS bus-based multi-master-station token scheduling device, communication method and system
Technical Field
The invention relates to the technical field of gateways, in particular to a multi-master-station token scheduling device, a communication method and a system based on MODBUS.
Background
The MODBUS-RTU bus is one of the most popular universal industry standard protocols in the global field of industry, and can be applied to various data acquisition and process monitoring. This protocol supports legacy RS-232, RS-422, RS-485 devices. Many industrial devices, including PLC, DCS, smart meters, etc., are using MODBUS-RTU bus. The MODBUS-RTU bus communication uses a master-slave technology, namely only one master station and a plurality of slave stations are allowed to perform digital communication on one MODBUS-RTU bus, and the master-slave communication protocol of the MODBUS-RTU bus determines that only one master station can perform data acquisition at any time. At present, in practical application of an MODBUS-RTU bus, application requirements of multiple Baud rates of multiple master stations are more and more, a communication converter is added to the bus in wide application at present, all master stations access the communication converter through independent MODBUS-RTU interfaces, the communication converter is connected with all slave stations through an MODBUS-RTU interface, and the communication converter achieves MODBUS-RTU bus multi-master station communication through unified scheduling.
However, the following disadvantages exist in the type of implementing multi-master communication by using a communication converter: each master station needs to access the same communication converter, and when the master station is far away, the installation is inconvenient and the wiring is difficult; meanwhile, each master station needs to access an independent MODBUS-RTU interface on the communication converter, and the access number of the master stations is limited by the number of the interfaces; the configuration of the communication converter is required to be changed when the master station is newly added or reduced, which will affect the bus communication data and cannot realize no disturbance; in addition, when the communication converter fails, the whole bus fails, and the system reliability is low.
Disclosure of Invention
The invention provides a multi-master-station token scheduling device based on an MODBUS bus, which is provided with a first interface, a second interface and a controller, wherein the first interface is connected with a master station, the second interface is connected with slave stations and other token scheduling devices through buses, the controller stores a first address information configuration table and a second address information configuration table, the first address information configuration table comprises slave station parameters, self protocol addresses and fixed broadcast addresses, and the second address information configuration table comprises self protocol addresses of other token scheduling devices; the controller is configured to sequentially acquire MODBUS bus control power and communicate with the corresponding master station for communication through a preset token rotation mode.
Preferably, the controller is configured to obtain an own protocol address of a token scheduling apparatus for next receiving the token from the second address information configuration table according to a preset token round-robin manner and forward the token.
Preferably, the controller is configured to, when it is monitored that there is no own protocol address of the token scheduling apparatus in the second address information configuration table, complement the own protocol address of the token scheduling apparatus and forward the address through the fixed broadcast address.
Preferably, the first interface and the second interface are COM ports.
The invention also discloses a multi-master station communication method based on the MODBUS bus, which is used for a token scheduling device, wherein the token scheduling device is connected with the master station through a first interface and is accessed to the MODBUS bus through a second interface, and the method comprises the following steps:
s1, parameter configuration parameters are configured according to a first address information configuration table and a second address information configuration table, the first address information configuration table comprises slave station parameters, own protocol addresses and fixed broadcast addresses, and the second address information configuration table comprises the own protocol addresses of other token scheduling devices;
s2, after monitoring the token frame sent according to the own protocol, obtaining the MODBUS bus driving right;
s3, judging whether the master station command needs to be forwarded, if so, acquiring the needed slave station parameters from the first address information configuration table to initialize the second interface and forwarding the second interface to the slave station;
and S4, acquiring the own protocol address of the next token scheduling device from the second address information configuration table according to a preset token rotation mode, and performing token rotation.
Preferably, the communication method further includes: monitoring a second address information configuration table sent from the fixed broadcast address, judging whether the second address information configuration table is successfully acquired, if not, obtaining MODBUS bus driving power after overtime judgment, otherwise, continuing to monitor.
Preferably, when the monitored second address information configuration table does not have the own protocol address of the token scheduling device, the own protocol of the token scheduling device is added to the second address information configuration table, and the second address information configuration table is sent to the fixed broadcast address for broadcasting.
Preferably, the preset token rotation mode is that the token rotation is performed from large to small according to the own protocol address or the token rotation is performed from small to large according to the own protocol address.
Preferably, the communication method further includes: and monitoring a second address information configuration table sent from the fixed broadcast address, judging whether an address identical to the self-owned protocol address of the token scheduling device exists in the second address information configuration table, if so, alarming for address conflict, otherwise, continuing to monitor.
The invention also discloses a multi-master station communication system based on the MODBUS bus, which comprises a plurality of master stations, at least one slave station and a plurality of token scheduling devices as described in any one of the above, wherein each master station is respectively connected with a corresponding token scheduling device, the token scheduling devices communicate with the slave stations through the MODBUS bus, and the token scheduling devices communicate with each other through a self-owned protocol.
According to the MODBUS bus-based multi-master-station token scheduling device and the communication method, any M master stations and N slave stations can be arranged on the MODBUS bus through the MODBUS bus-based multi-master-station token scheduling device, and the baud rates of the slave stations can be different. Each master station is independently configured with a multi-master station token scheduling device, and each multi-master station token scheduling device needs an address information configuration table: the address of the device, the addresses of other multi-master station token scheduling devices on the bus, the addresses of slave stations on the bus and the baud rate of the slave stations on the bus. And according to an address information configuration table, multi-baud rate communication of the MODBUS bus by the multi-master station token scheduling mechanism in the multi-master station token scheduling device is realized. Because each multi-master-station token scheduling device is installed nearby on the master station, distributed installation is realized, the workload of wiring is reduced, and the usability of MODBUS bus multi-master-station multi-baud-rate communication is improved. And because every device can all independently install and dispose, the newly-increased, reduction, trouble, change of each main website can not cause the influence to other token scheduling device or main website on the bus, has promoted reliability and maintainability of MODBUS bus many main websites many baud rate communication, and even token scheduling device trouble only can influence the communication with its corresponding main website, can not have any influence to the bus, has realized the device fault isolation.
Additional aspects and advantages of the invention will be set forth in part in the description which follows and, in part, will be obvious from the description, or may be learned by practice of the invention.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings: MODBUS bus-based multi-master-station token scheduling device, communication method and system
Fig. 1 is a schematic structural diagram of a multi-master-station token scheduling apparatus according to an embodiment of the present invention.
Fig. 2 is a schematic diagram of a system network structure of a MODBUS bus disclosed in an embodiment of the present invention.
Fig. 3 is a schematic step diagram of a MODBUS-bus-based multi-master station communication method according to an embodiment of the present invention.
Fig. 4 is a schematic diagram of power-on operation of the token scheduling apparatus according to an embodiment of the present invention.
Fig. 5 is a schematic diagram of bus snoop status operations of the token scheduling apparatus according to an embodiment of the present invention.
Fig. 6 is a schematic diagram of bus driving state operation of the token scheduling apparatus according to an embodiment of the disclosure.
Fig. 7 is a schematic network structure diagram of a multi-master station communication system according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the drawings of the embodiments of the present invention. It is to be understood that the embodiments described are only a few embodiments of the present invention, and not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the described embodiments of the invention without any inventive step, are within the scope of protection of the invention.
In the present invention, unless otherwise expressly specified or limited, the terms "mounted," "connected," "secured," and the like are to be construed broadly and can, for example, be fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood by those skilled in the art according to specific situations.
In the present invention, unless otherwise expressly stated or limited, "above" or "below" a first feature means that the first and second features are in direct contact, or that the first and second features are not in direct contact but are in contact with each other via another feature therebetween. Also, the first feature being "on," "above" and "over" the second feature includes the first feature being directly on and obliquely above the second feature, or merely indicating that the first feature is at a higher level than the second feature. A first feature being "under," "below," and "beneath" a second feature includes the first feature being directly under and obliquely below the second feature, or simply meaning that the first feature is at a lesser elevation than the second feature.
Unless defined otherwise, technical or scientific terms used herein shall have the ordinary meaning as understood by one of ordinary skill in the art to which this invention belongs. The use of "first," "second," and similar terms in the description and claims of the present application do not denote any order, quantity, or importance, but rather the terms are used to distinguish one element from another. Also, the use of the terms "a" or "an" and the like do not denote a limitation of quantity, but rather denote the presence of at least one.
The MODBUS-RTU bus communication uses a master-slave technology, namely only one master station and a plurality of slave stations are allowed to perform digital communication on one MODBUS-RTU bus, and the master-slave communication protocol of the MODBUS-RTU bus determines that only one master station can perform data acquisition at any time. In practical application of an MODBUS-RTU bus, application requirements of multiple baud rates of multiple master stations are more and more, a communication converter is added to the bus, all master stations access the communication converter through independent MODBUS-RTU interfaces, the communication converter is connected with all slave stations through an MODBUS-RTU interface, and the communication converter realizes communication of the MODBUS-RTU bus and the multiple master stations through unified scheduling. Therefore, in order to further improve the usability, reliability and maintainability of MODBUS-RTU bus multi-master station multi-baud rate communication, the invention discloses a multi-master station token scheduling device based on an MODBUS bus, which well solves the defects in the prior art, wherein the MODBUS bus can be an MODBUS-RTU bus or other MODBUS buses. As shown in fig. 1, the apparatus has a first interface, a second interface and a controller, wherein the first interface is connected with a master station, the second interface is connected with a slave station and other token scheduling apparatuses through a bus, the controller stores a first address information configuration table and a second address information configuration table, the first address information configuration table includes slave station parameters, own protocol addresses and fixed broadcast addresses, and the second address information configuration table includes own protocol addresses of the rest token scheduling apparatuses. The controller is configured to sequentially acquire MODBUS bus control power and communicate with the corresponding master station for communication through a preset token rotation mode. Specifically, the controller is configured to obtain the self-owned protocol address of the token scheduling apparatus for next receiving the token from the second address information configuration table according to a preset token round-robin manner and forward the token. The preset token rotation mode can be rotation from low to high according to the own protocol address of each token scheduling device, or rotation according to other preset rules. This many main website token scheduling device is through the first interface connection main website with it, and the second interface connection slave station realizes having arbitrary M main website, N slave station on the MODBUS-RTU bus to the baud rate of slave station also can not be the same. Each master station is independently provided with a multi-master station token scheduling device, and each multi-master station token scheduling device stores a first address information configuration table and a second address information configuration table, wherein the first address information configuration table and the second address information configuration table can comprise addresses of the device, addresses of other multi-master station token scheduling devices on a bus, addresses of slave stations on the bus and baud rates of slave stations on the bus. And according to the first address information configuration table and the second address information configuration table, multi-baud rate communication of the MODBUS-RTU bus by a token scheduling mechanism in the multi-master-station token scheduling device is realized. Because each multi-master-station token scheduling device is installed nearby on the master station, distributed installation is realized, the workload of wiring is reduced, and the usability of MODBUS-RTU bus multi-master-station multi-baud-rate communication is improved. And each device can be independently installed and configured, other devices on the bus cannot be influenced by addition, reduction, failure and replacement, and the reliability and maintainability of MODBUS-RTU bus multi-master station multi-baud rate communication are improved.
Fig. 2 is a schematic diagram of a network architecture of an MODBUS bus communication system using a multi-master-station token scheduling device, where M1 and M2 … … Mm are masters on a MODBUS-RTU bus, T1 and T2 … … Tm are multi-master-station token scheduling devices, and S1, S2 and S3 … … Sn are slaves on the MODBUS-RTU bus. The internal structure block diagram of the multi-master-station token scheduling device is shown in fig. 1, wherein a first interface and a second interface can adopt COM ports of RS485 or RS232, and the like, the first interface is used for connecting a master station, the second interface is used for connecting a slave station, and a controller MCU is used for realizing token scheduling, data receiving and data forwarding and internally storing a first address information configuration table and a second address information configuration table.
The token scheduling devices of the multiple master stations are supported by a self-contained scheduling protocol and do not conflict with the MODBUS protocol. The address information configuration table comprises a first address information configuration table and a second address information configuration table, wherein the first address information configuration table is a manual configuration table, the interior of the first address information configuration table can comprise baud rate, slave station equipment parameters, device own protocol addresses, fixed broadcast addresses and the like, and all parameter data in the first address information configuration table are set for preset manual input of the multi-master-station token scheduling device. The second address information configuration table is a dynamic configuration table, and can store own protocol addresses of other multi-master station token scheduling devices on the bus, and the parameters in the second address information configuration table can be modified and updated according to the increase and decrease of other multi-master station token scheduling devices in the MODBUS bus communication system.
And the controller is also configured to supplement the own protocol address of the token scheduling device and forward the address through the fixed broadcast address when the second address information configuration table is monitored to have no own protocol address of the token scheduling device. Specifically, the fixed broadcast addresses of all the multi-master token scheduling devices on the MODBUS-RTU bus are the same, each token scheduling device sends the second address information configuration table, i.e. the dynamic configuration table, of the device to the fixed broadcast addresses, and all the token scheduling devices on the bus can receive the dynamic configuration table. When the dynamic configuration table received by one token scheduling device from the fixed broadcast address does not have the own protocol address information of the token scheduling device, the own protocol address of the token scheduling device is added into the dynamic configuration table, and then the dynamic configuration table is rebroadcast through the fixed broadcast address. Therefore, the addresses of other multi-master-station token scheduling devices on the MODBUS-RTU bus are automatically acquired, when the number of the multi-master-station token scheduling devices is increased or decreased on the bus, the protocol addresses of the devices in the second address information configuration table of the other multi-master-station token scheduling devices are automatically updated, other devices on the bus cannot be influenced, and accordingly no disturbance is achieved. And when each multi-master station token scheduling device performs token rotation according to the own protocol address of each device in the second address information configuration table, if the token grant does not receive a response, the own protocol address is regarded as not existed, and the address is deleted in the dynamic configuration table. Finally, even if a certain multi-master-station token scheduling device fails, only the communication with the corresponding master station is affected, no influence is caused on the bus, and automatic isolation of device failures is realized.
Fig. 3 is a diagram illustrating a multi-master-station communication method based on a MODBUS according to an embodiment of the present disclosure, in which a token scheduling apparatus is connected to a master station through a first interface and is connected to the MODBUS through a second interface, and a specific token scheduling apparatus may adopt the multi-master-station token scheduling apparatus disclosed in the foregoing embodiments, and the multi-master-station communication method may specifically include the following steps.
Step S1, parameter configuration parameters are configured according to a first address information configuration table and a second address information configuration table, the first address information configuration table comprises slave station parameters, own protocol addresses and fixed broadcast addresses, and the second address information configuration table comprises own protocol addresses of other token scheduling devices.
The token scheduling devices of the multiple master stations are supported by a self-contained scheduling protocol and do not conflict with the MODBUS protocol. The first address information configuration table is a manual configuration table and can comprise a baud rate, slave station equipment parameters, a device own protocol address, a fixed broadcast address and the like, and all parameter data in the first address information configuration table are set for the manual input preset by the token scheduling device. The second address information configuration table is a dynamic configuration table, self protocol addresses of other token scheduling devices on the bus can be stored, and parameters in the second address information configuration table can be modified and updated according to the increase and decrease of other multi-master station token scheduling devices in the MODBUS bus communication system. The following details may also be included in this step.
Monitoring a second address information configuration table sent from the fixed broadcast address, judging whether the second address information configuration table is successfully acquired, if not, obtaining MODBUS bus driving power after overtime judgment, otherwise, continuing to monitor.
And when the monitored second address information configuration table does not have the own protocol address of the token scheduling device, the own protocol of the token scheduling device is added to the second address information configuration table, and the second address information configuration table is sent to the fixed broadcast address for broadcasting.
And monitoring a second address information configuration table sent from the fixed broadcast address, judging whether an address identical to the self-owned protocol address of the token scheduling device exists in the second address information configuration table, if so, alarming for address conflict, otherwise, continuing to monitor.
All the fixed broadcast addresses of the multi-master station token scheduling devices on the MODBUS-RTU bus are the same, each token scheduling device can send a second address information configuration table, namely a dynamic configuration table, of the device to the fixed broadcast addresses, and all the token scheduling devices on the bus can receive the dynamic configuration table. When the dynamic configuration table received by one token scheduling device from the fixed broadcast address does not have the own protocol address information of the token scheduling device, the own protocol address of the token scheduling device is added into the dynamic configuration table, and then the dynamic configuration table is rebroadcast through the fixed broadcast address. Therefore, the addresses of other multi-master-station token scheduling devices on the MODBUS-RTU bus are automatically acquired, when the number of the multi-master-station token scheduling devices is increased or decreased on the bus, the protocol addresses of the devices in the second address information configuration table of the other multi-master-station token scheduling devices are automatically updated, other devices on the bus cannot be influenced, and accordingly no disturbance is achieved. And when each multi-master station token scheduling device performs token rotation according to the own protocol address of each device in the second address information configuration table, if the token grant does not receive a response, the own protocol address is regarded as not existed, and the address is deleted in the dynamic configuration table. Finally, even if a certain multi-master-station token scheduling device fails, only the communication with the corresponding master station is affected, no influence is caused on the bus, and automatic isolation of device failures is realized.
Fig. 4 is a logic diagram of the steps of the power-on operation of the token scheduling apparatus, specifically, after the token scheduling apparatus completes the manual configuration table, the token scheduling apparatus is powered on, the configuration parameters are initialized according to the first and second address information configuration tables, then the bus dynamic configuration table on the fixed broadcast address, that is, the dynamic configuration table sent by other token scheduling apparatuses on the bus, is monitored, whether the dynamic configuration table is successfully obtained is judged, if the dynamic configuration table is judged to be N, the overtime judgment is entered; and if the judgment result is Y, address conflict detection is carried out. If the dynamic configuration table is judged to be overtime, judging the dynamic configuration table to be N, and re-entering to judge whether the dynamic configuration table is successfully acquired; if Y is judged, the bus driving right is obtained, and the bus driving state is entered. Then, carrying out self-owned protocol address conflict detection, judging the address conflict is N, and entering a bus monitoring state; and judging as Y, and performing address conflict alarm.
And step S2, obtaining MODBUS bus driving right after monitoring the token frame sent according to the own protocol.
Specifically, the specific working logic of the token scheduling apparatus in the bus monitoring state may be as shown in fig. 5, and first determine whether to receive the token frame, whether to enter reception timeout, and if so, whether to enter reception of the dynamic configuration table; if the judgment result is Y, the bus control right is obtained, and the bus driving process is entered. If the dynamic configuration table is not received, re-entering to judge whether a token frame is received or not and whether the receiving is overtime or not; judging as Y, entering a judgment table to judge whether the address of the token scheduling device exists or not, judging as N, adding the address of the token scheduling device and responding to a new dynamic configuration table, re-entering to judge whether a token frame is received or not, and entering to receive overtime or not; if the judgment result is Y, the address is directly saved, and the re-entry is carried out to judge whether the token frame is received or not and whether the entry is overtime or not.
And step S3, judging whether the master station command needs to be forwarded, if so, acquiring the parameters of the required slave station from the first address information configuration table to initialize the second interface and forwarding the second interface to the slave station.
Specifically, the working logic of the token scheduling apparatus in the bus driving process or state can be as shown in fig. 6, and first, it is determined whether the token scheduling apparatus needs to forward its master station command, that is, the first interface receives master station data; and if the judgment result is N, judging whether the token scheduling device needs to broadcast the dynamic configuration table or not. If the token scheduling device judges that the token scheduling device needs to forward the master station command, the token scheduling device acquires the communication parameters of the slave device from the first address information configuration table to initialize the second interface, then forwards the master station command to the slave station, and then judges whether the slave station response data is received or not. Judging whether slave station response data is received or not, if so, judging that the slave station response data does not need to be received, and entering a dynamic configuration table for judging whether the token scheduling device needs to broadcast or not; if Y is judged to be the requirement of receiving the slave station response data, the data is forwarded to the master station from the first interface, and then whether the device needs to broadcast the dynamic configuration table is judged. Judging whether the device needs to broadcast the dynamic configuration table or not, and entering a round robin token if the device judges that N is the condition that the dynamic configuration table does not need to be broadcast; if Y is judged to be needed to broadcast the dynamic configuration table, the dynamic configuration table is broadcast firstly, and then the round robin token is entered. And finally enters a bus snoop state.
And step S4, according to the preset token rotation mode, acquiring the own protocol address of the next token scheduling device from the second address information configuration table, and then performing token rotation. The preset token rotation mode is that the token rotation is performed from large to small according to the own protocol address or the token rotation is performed from small to large according to the own protocol address.
In the MODBUS bus-based multi-master station communication method, any M master stations and N slave stations can be arranged on the MODBUS bus through the MODBUS bus-based multi-master station token scheduling device, and the baud rates of the slave stations can be different. Each master station is independently configured with a multi-master station token scheduling device, and each multi-master station token scheduling device needs an address information configuration table: the address of the device, the addresses of other multi-master station token scheduling devices on the bus, the addresses of slave stations on the bus and the baud rate of the slave stations on the bus. And according to an address information configuration table, multi-baud rate communication of the MODBUS bus by the multi-master station token scheduling mechanism in the multi-master station token scheduling device is realized. Because each multi-master-station token scheduling device is installed nearby on the master station, distributed installation is realized, the workload of wiring is reduced, and the usability of MODBUS bus multi-master-station multi-baud-rate communication is improved. And because every device can all independently install and dispose, the newly-increased, reduction, trouble, change of each main website can not cause the influence to other token scheduling device or main website on the bus, has promoted reliability and maintainability of MODBUS bus many main websites many baud rate communication, and even token scheduling device trouble only can influence the communication with its corresponding main website, can not have any influence to the bus, has realized the device fault isolation. .
Fig. 7 shows a working example of a multi-master token scheduling apparatus, where M1, M2, and M3 are existing masters on a MODBUS-RTU bus, T1, T2, and T3 are existing multi-master token scheduling apparatuses, S1, S2, and S3 are existing slaves on the MODBUS-RTU bus, M4 is a newly added master, and T4 is a newly added multi-master token scheduling apparatus. Manual configuration table of T1: the self-owned protocol address of the device is 200, the fixed broadcast address is 255, the address of the slave station device S1 is 1, the baud rate is 9600, the address of the slave station device S2 is 2, the baud rate is 9600, the address of the slave station device S3 is 3, and the baud rate is 19200; dynamic configuration table: native address 200, T2 address 201, T3 address 202. Manual configuration table of T2: the self-owned protocol address of the device is 201, the fixed broadcast address is 255, the address of the slave station device S1 is 1, the baud rate is 9600, the address of the slave station device S2 is 2, the baud rate is 9600, the address of the slave station device S3 is 3, and the baud rate is 19200; dynamic configuration table: native address 201, T1 address 200, T3 address 202. Manual configuration table of T3: the self-owned protocol address of the device is 202, the fixed broadcast address is 255, the address of the slave station device S1 is 1, the baud rate is 9600, the address of the slave station device S2 is 2, the baud rate is 9600, the address of the slave station device S3 is 3, and the baud rate is 19200; dynamic configuration table: native address 202, T1 address 200, T3 address 203. Manual configuration table of T4: the self-owned protocol address of the device is 203, the fixed broadcast address is 255, the address of the slave station device S1 is 1, the baud rate is 9600, the address of the slave station device S2 is 2, the baud rate is 9600, the address of the slave station device S3 is 3, and the baud rate is 19200; dynamic configuration table: the native address 204.
When three master stations of M1, M2 and M3 work, the token scheduling flow of the T1, T2 and T3 devices is to sequentially rotate tokens T1- > T2- > T3- > T1 … …. T1 judges the bus has no token activity, then obtains the bus control right; the token rotation mode in the MODBUS-RTU bus system is that the token rotation is performed from small to large according to the own protocol address. Therefore, when the power is on at the same time, the low address can obtain the control right of the token preferentially, and the waiting time is shortest. When the M1 has a command to be forwarded, the M1 command is forwarded first, and then the token is sent to T2 according to the address table, and if no command needs to be forwarded, the token is directly sent to T2; at this time, if the command is required to be forwarded by the T2, the command is forwarded first, and then the token is forwarded to the T3, if no command is required to be forwarded, the token is directly sent to the T3; at this time, if the command is required to be forwarded by the T3, the command is forwarded first, and then the token is forwarded to the T1, if no command is required to be forwarded, the token is directly sent to the T1. When a new M4 master station and a T4 multi-master station token scheduling device are added, the dynamic configuration table is broadcasted by the T1 after one round of token scheduling is completed, the T4 receives the dynamic configuration table and finds that no self protocol address exists in the address table, the self protocol address is added into the address table and is broadcasted to respond to a new dynamic configuration table, and other scheduling devices receive the new dynamic configuration table and rotate according to the new dynamic configuration table. The scheme is not limited to realizing the addition of 3 main stations and 1 main station, and can be expanded to the addition and deletion of any main station.
The invention also discloses a multi-master station communication system based on the MODBUS bus, which comprises a plurality of master stations, at least one slave station and a plurality of token scheduling devices in the embodiments, wherein each master station is respectively connected with a corresponding token scheduling device, the token scheduling devices are communicated with the slave station through the MODBUS bus, and the token scheduling devices are communicated with each other through self-protocol. Specific features and advantages thereof may be set forth in the various embodiments described above without departing from the spirit and scope of the present disclosure.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present invention.
In summary, the above-mentioned embodiments are only preferred embodiments of the present invention, and all equivalent changes and modifications made in the claims of the present invention should be covered by the claims of the present invention.

Claims (8)

1. The utility model provides a many main website token scheduling device based on MODBUS bus which characterized in that: the system comprises a first interface, a second interface and a controller, wherein the first interface is connected with a master station, the second interface is connected with slave stations and other token scheduling devices through a bus, communicates with the slave stations through a MODBUS protocol, and communicates with other token scheduling devices through an own protocol which does not conflict with the MODBUS protocol;
the controller stores a first address information configuration table and a second address information configuration table, the first address information configuration table comprises slave station parameters, self-owned protocol addresses and fixed broadcast addresses, and the second address information configuration table comprises self-owned protocol addresses of other token scheduling devices;
the controller is configured to sequentially acquire MODBUS bus control power and communicate with the corresponding master station for communication through a preset token rotation mode; and when the second address information configuration table which is monitored from the fixed broadcast address and sent by other token scheduling devices does not have the own protocol address of the token scheduling device, the own protocol address of the token scheduling device is subjected to supplementary recording and rebroadcast through the fixed broadcast address.
2. The multi-master token scheduler of claim 1, wherein: the controller is configured to acquire the own protocol address of the token scheduling device for next receiving the token from the second address information configuration table according to a preset token rotation mode and forward the token.
3. The multi-master token scheduling apparatus of any one of claims 1-2, wherein: the first interface and the second interface are COM ports.
4. A multi-master station communication method based on MODBUS is used for a token scheduling device, wherein the token scheduling device is connected with a master station through a first interface, is accessed to a bus through a second interface, communicates with slave stations through MODBUS protocols, and communicates with other token scheduling devices through an own protocol which does not conflict with the MODBUS protocols, and the token scheduling device is characterized by comprising the following steps of:
s1, parameter configuration parameters are configured according to a first address information configuration table and a second address information configuration table, the first address information configuration table comprises slave station parameters, own protocol addresses and fixed broadcast addresses, and the second address information configuration table comprises the own protocol addresses of other token scheduling devices;
when the second address information configuration table which is monitored from the fixed broadcast address and sent by other token scheduling devices does not have the own protocol address of the token scheduling device, the own protocol address of the token scheduling device is subjected to supplementary recording and rebroadcast through the fixed broadcast address;
s2, after monitoring the token frame sent according to the own protocol, obtaining the MODBUS bus driving right;
s3, judging whether the master station command needs to be forwarded, if so, acquiring the needed slave station parameters from the first address information configuration table to initialize the second interface and forwarding the second interface to the slave station;
and S4, acquiring the own protocol address of the next token scheduling device from the second address information configuration table according to a preset token rotation mode, and performing token rotation.
5. The multi-master station communication method according to claim 4, wherein:
monitoring a second address information configuration table sent from the fixed broadcast address, judging whether the second address information configuration table is successfully acquired, if not, obtaining MODBUS bus driving power after overtime judgment, otherwise, continuing to monitor.
6. The multi-master station communication method according to claim 5, wherein: the preset token rotation mode is that the token rotation is performed from large to small according to the own protocol address or the token rotation is performed from small to large according to the own protocol address.
7. The multi-master station communication method according to claim 6, wherein: and monitoring a second address information configuration table sent from the fixed broadcast address, judging whether an address identical to the self-owned protocol address of the token scheduling device exists in the second address information configuration table, if so, alarming for address conflict, otherwise, continuing to monitor.
8. The utility model provides a many main website communication system based on MODBUS bus which characterized in that: the system comprises a plurality of master stations, at least one slave station and a plurality of token scheduling devices as claimed in any one of claims 1 to 3, wherein each master station is connected with a corresponding token scheduling device, the token scheduling devices communicate with the slave stations through MODBUS buses, and the token scheduling devices communicate with each other through own protocols.
CN202010160115.2A 2020-03-10 2020-03-10 MODBUS bus-based multi-master-station token scheduling device, communication method and system Active CN111327503B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010160115.2A CN111327503B (en) 2020-03-10 2020-03-10 MODBUS bus-based multi-master-station token scheduling device, communication method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010160115.2A CN111327503B (en) 2020-03-10 2020-03-10 MODBUS bus-based multi-master-station token scheduling device, communication method and system

Publications (2)

Publication Number Publication Date
CN111327503A CN111327503A (en) 2020-06-23
CN111327503B true CN111327503B (en) 2022-03-01

Family

ID=71171430

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010160115.2A Active CN111327503B (en) 2020-03-10 2020-03-10 MODBUS bus-based multi-master-station token scheduling device, communication method and system

Country Status (1)

Country Link
CN (1) CN111327503B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112565039B (en) * 2020-12-11 2022-12-30 杭州和利时自动化有限公司 Communication network architecture
CN113064723A (en) * 2021-03-23 2021-07-02 瀚云科技有限公司 Storage medium, electronic device, bus resource allocation method and device
CN113746712B (en) * 2021-09-01 2023-04-25 蓝思智能机器人(长沙)有限公司 MODBUS_RTU protocol-based one-master-multiple-slave station communication method and system

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1801020A (en) * 2005-12-28 2006-07-12 河北工业大学 Embedded field bus protocol interface device and implementation method
CN101483546A (en) * 2008-12-15 2009-07-15 哈尔滨工业大学 Method for constructing PLC network based on Profibus protocol
CN101789867A (en) * 2010-03-16 2010-07-28 东方电气集团东方电机有限公司 Double-redundancy industrial Ethernet data exchange unit
CN102053935A (en) * 2010-11-25 2011-05-11 广东雅达电子股份有限公司 MODBUS serial communication protocol-based communication method
CN102932222A (en) * 2012-10-15 2013-02-13 南京富岛信息工程有限公司 Communication converter supporting recommended standard (RS) 485 and Modbus multi-master station data acquisition
CN107889550A (en) * 2015-04-17 2018-04-06 飞利浦照明控股有限公司 Master Communication Equipment for token network
CN108737590A (en) * 2018-05-15 2018-11-02 浙江正泰电器股份有限公司 A kind of method that address is distributed automatically, system, Modbus main websites, Modbus slave stations
CN109067630A (en) * 2018-10-16 2018-12-21 苏州琅润达检测科技有限公司 A kind of serial data communication link branch cooperative control device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6792337B2 (en) * 1994-12-30 2004-09-14 Power Measurement Ltd. Method and system for master slave protocol communication in an intelligent electronic device
CN103135483A (en) * 2012-12-31 2013-06-05 人民电器集团有限公司 Protocol conversion module and intelligent circuit breaker of Profibus and Modbus
CN106444657B (en) * 2016-09-14 2019-11-22 长飞光纤光缆股份有限公司 A kind of Modbus main website command processing method and main station controller

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1801020A (en) * 2005-12-28 2006-07-12 河北工业大学 Embedded field bus protocol interface device and implementation method
CN101483546A (en) * 2008-12-15 2009-07-15 哈尔滨工业大学 Method for constructing PLC network based on Profibus protocol
CN101789867A (en) * 2010-03-16 2010-07-28 东方电气集团东方电机有限公司 Double-redundancy industrial Ethernet data exchange unit
CN102053935A (en) * 2010-11-25 2011-05-11 广东雅达电子股份有限公司 MODBUS serial communication protocol-based communication method
CN102932222A (en) * 2012-10-15 2013-02-13 南京富岛信息工程有限公司 Communication converter supporting recommended standard (RS) 485 and Modbus multi-master station data acquisition
CN107889550A (en) * 2015-04-17 2018-04-06 飞利浦照明控股有限公司 Master Communication Equipment for token network
CN108737590A (en) * 2018-05-15 2018-11-02 浙江正泰电器股份有限公司 A kind of method that address is distributed automatically, system, Modbus main websites, Modbus slave stations
CN109067630A (en) * 2018-10-16 2018-12-21 苏州琅润达检测科技有限公司 A kind of serial data communication link branch cooperative control device

Also Published As

Publication number Publication date
CN111327503A (en) 2020-06-23

Similar Documents

Publication Publication Date Title
CN111327503B (en) MODBUS bus-based multi-master-station token scheduling device, communication method and system
JP5301032B2 (en) Method, apparatus and system for controlling access point
US20190104399A1 (en) System, Method and Apparatus for Building Operations Management
CN109450704A (en) A kind of plug and play intelligence distribution transformer terminals and power dispatching data communication system
JP2523882B2 (en) Data transmission equipment
CN202737890U (en) Low-cost on-site measurement and control gateway module of wired and wireless hot standby redundancy communication
JPH09181737A (en) Communication method for small scale network
CN111030867B (en) Communication acquisition device based on dial switch and communication protocol configuration-free method
US9325567B2 (en) Communication system, method for operating such a communication system, and communication module
CN111324503B (en) Machine frame management device, method and computer readable storage medium
CN104683126A (en) Network managing method based on CAN bus
CN210781189U (en) Hardware equipment for collecting load identification data of user electric meter
CN115189985B (en) Modbus multi-master-station data planning and forwarding device
CN112433504A (en) Combined type BACnet controller
JP3380957B2 (en) Redundant communication controller
KR101593338B1 (en) Apparatus for lin communication of vehicle and control method thereof
JP2013250732A (en) Blade server system
CN115766906B (en) Multi-protocol fusion communication detection system of single hardware platform
JP3294256B2 (en) Data communication method and device
CN215956109U (en) State determining system of backup power supply
US20230147005A1 (en) Onboard device and sleep control method
CN117319185A (en) Multi-equipment master-slave communication system based on CAN communication and addressing and monitoring method
Jian-hua et al. Research on local area network of marine gas turbine distributed control system
JPH11282780A (en) Fa network system
CN113495522A (en) Method and device for determining on-duty state of PLC in environment and equipment monitoring system

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
CB02 Change of applicant information

Address after: 310056 room 1701, 17th floor, building 3, No. 316, Jianghong South Road, Changhe street, Binjiang District, Hangzhou, Zhejiang

Applicant after: Mingdu Zhiyun (Zhejiang) Technology Co.,Ltd.

Address before: 310000 1, 3 building, No. 316 Jianghong Road, Changhe street, Binjiang District, Hangzhou, Zhejiang.

Applicant before: ZHEJIANG MINGDU INTELLIGENT CONTROL TECHNOLOGY Co.,Ltd.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant