CN114257468A - System and method for realizing address distribution to slave equipment through RS-485 bus - Google Patents
System and method for realizing address distribution to slave equipment through RS-485 bus Download PDFInfo
- Publication number
- CN114257468A CN114257468A CN202111507595.6A CN202111507595A CN114257468A CN 114257468 A CN114257468 A CN 114257468A CN 202111507595 A CN202111507595 A CN 202111507595A CN 114257468 A CN114257468 A CN 114257468A
- Authority
- CN
- China
- Prior art keywords
- slave
- bus
- address
- addresses
- host
- 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.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 23
- 238000004891 communication Methods 0.000 description 16
- 230000007547 defect Effects 0.000 description 4
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 238000005259 measurement Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000006855 networking Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L12/40006—Architecture of a communication node
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Small-Scale Networks (AREA)
Abstract
The invention discloses a system and a method for realizing address distribution to slave equipment through an RS-485 bus, belonging to the technical field of RS-485 bus control, wherein a plurality of slave machines form an array with M rows and N columns, the buses A in the RS-485 buses of the N slave machines in each row are mutually connected, each row of slave machines are connected with the bus A of the RS-485 bus of a host machine through an opposite-open point of a relay, the buses B in the RS-485 buses of the M slave machines in each column are mutually connected, and each column of slave machines are connected with the bus B of the RS-485 bus of the host machine through an opposite-open point of a relay. In the invention, the address can be written into the slave machine only by attracting the relays of the rows and the columns where the slave machine needing to be written into the address is positioned, thereby realizing the sequential address writing of each slave machine, therefore, the invention can conveniently realize the address writing of a plurality of slave machines, has simple operation, high efficiency, lower working strength and lower cost, and is suitable for all systems with RS-485 buses.
Description
Technical Field
The invention relates to the technical field of RS-485 bus control, in particular to a system and a method for realizing address allocation to slave equipment through an RS-485 bus.
Background
At present, a master-slave communication mode is generally adopted in a measurement and control system formed by an RS-485 bus, namely, a master computer (generally called an upper computer) and a plurality of slave computers (less than 254) (generally called lower computers) communicate through the RS-485 bus. The master-slave communication mode always uses the host to initiate communication, after the slave receives the command, it obtains the bus control right, and then sends the information to the bus, after the transmission is finished, the bus control right is returned to the host. When the master machine communicates with each slave machine through the RS-485 bus, each slave machine needs to be distinguished through a device identifier, and the simplest method is to distinguish each slave machine by adopting an address.
Therefore, when all the slave devices access the RS-485 bus, communication addresses need to be allocated in advance, and it is ensured that the addresses of all the slave devices are not repeated, otherwise, the entire network communication fails.
Up to now, there are two main methods for setting addresses for slave devices, one is to install a multi-bit dial switch on the device, and the device determines its own address by reading in the code of the dial switch. The method has large workload when setting a large number of slave machine addresses, and is easy to make mistakes by manual operation. In another method, an upper computer is connected with slave equipment through an RS-485 bus, and special address writing software is used for writing addresses into the slave equipment, but the method can only write the addresses one by one manually, and is troublesome in practical application, low in address programming efficiency and large in workload of manual operation.
In order to solve the above problems, various methods have been proposed by the skilled person to improve the prior art.
In the first patent, publication No. CN102331762A, a master is directly connected to one of a plurality of slaves, a relay is disposed on a branch line between the master and each slave, and the master can send a command via an RS-485 bus to control the slave to open and close its own relay. The relay connected in series on each slave branch line can enable the master machine to utilize the existing RS-485 bus, and the slave machine can automatically write the address without independently configuring an address line.
In patent two, publication No. CN104516851A, an arbitration line is added on the basis of the original RS-485 network connection, and a slave device is selected through the arbitration line and then assigned with an address.
Patent III, publication No. CN 111654557A discloses an automatic distribution method of RS-485 addresses, which does not need to distribute RS-485 communication addresses of access devices during first networking, and does not need to know the RS-485 communication addresses of replaced devices and set the RS-485 communication addresses of new devices during subsequent maintenance and replacement of the access devices.
However, the above-mentioned patent still has many problems, such as the method adopted in the first patent, which adds a branch line and a relay to each slave, makes the system more complex, and increases the cost of the system; the method adopted in the second patent enables each slave to be additionally provided with an arbitration line, and the complexity and the cost of the system are increased; in the third patent, when a slave in the third patent fails and needs to be reassigned, addresses assigned twice before and after are likely to be inconsistent, which is not allowed in some applications.
Therefore, the invention aims to provide a system capable of solving the existing communication address setting defect of the RS-485 bus.
Disclosure of Invention
The invention aims to provide a system and a method for realizing address allocation to slave equipment through an RS-485 bus, which aim to solve the technical problem of the communication address setting defect of the RS-485 bus in the prior art.
The invention provides a system and method for distributing addresses to slave devices through RS-485 buses, which comprises a host and a plurality of slave devices, wherein the host and the slave devices comprise RS-485 interfaces and communicate through the RS-485 buses, and the system is characterized in that: the plurality of the slave machines form an array with M rows and N columns, buses A in the RS-485 buses of the N slave machines in each row are mutually connected, the slave machines in each row are connected with the bus A of the RS-485 bus of the main machine through a pair of open points of a relay, buses B in the RS-485 buses of the M slave machines in each column are mutually connected, the slave machines in each column are connected with the bus B of the RS-485 bus of the main machine through a pair of open points of a relay, and addresses are sequentially distributed according to the positions of the selected slave machines in the rows and the columns of the M and N columns of the array.
Further, address allocation software is arranged in the host, and the host allocates addresses for all the slaves through the address allocation software.
An implementation method for distributing addresses to slave devices through an RS-485 bus comprises the following steps:
sp 1: opening address allocation software on the host;
sp 2: after the system is powered on, selecting one slave from an M-row and N-column slave array displayed in an interface of address allocation software, and inputting an address to be written into the slave;
sp 3: the host controls relays on corresponding rows and columns to be attracted according to the horizontal and vertical positions of the selected slave in the slave array, a bus A and a bus B of the host are respectively and correspondingly communicated with a bus A and a bus B of the only slave, and the host sends an address to be written to the selected slave through an RS-485 bus;
sp 4: according to the sequence, a plurality of slaves in the slave array are selected on an interface of the address allocation software, addresses to be written by each slave are sequentially input, and the master writes the addresses into the corresponding slaves sequentially by the Sp3 method.
Compared with the prior art, the invention has the beneficial effects that:
firstly, in the prior art, when the slave is accessed to the RS-485 bus, communication addresses need to be allocated in advance, and the addresses of all the slaves are ensured not to be repeated, otherwise, the whole network communication fails, and when the slave is allocated with the addresses, the problems of large workload, low coding efficiency and easy error operation exist, therefore, the invention provides a system capable of solving the existing RS-485 bus communication address setting defects, a plurality of slaves form an M-row and N-column slave array, the buses A of each row of slaves are all connected together and are connected with the bus A of a host through a relay, the bus B of each column of slaves are all connected together and are connected with the bus B of the host through a relay, and the addresses can be written into the slaves only by sucking the relays of the rows and the columns where the slaves to be written into the addresses are located, therefore, the invention can conveniently realize the address writing of a plurality of slave devices, has simple operation and high efficiency, can reduce the working intensity and has lower cost.
Secondly, the address distribution system in the invention can be suitable for all systems with RS-485 buses, only the master device and the slave device are required to be ensured to contain RS-485 interface modules, and the slave device is connected with the master device through the RS-485 bus, so that the applicability is strong.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
FIG. 1 is a schematic diagram of a connection mode between a master and a slave according to the present invention;
FIG. 2 is a flow chart of the present invention.
Reference numerals:
1. a host; 2. a slave; 3. a relay.
Detailed Description
The technical solutions of the present invention will be described clearly and completely with reference to the accompanying drawings, and it should be understood that the described embodiments are some, but not all embodiments of the present invention.
The components of embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present invention, presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention.
All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, and are only for convenience of description and simplicity of description, but do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus, should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
In the description of the present invention, it should be noted that, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; 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 in specific cases to those skilled in the art.
Specific example 1:
as shown in fig. 1, an embodiment 1 of the present invention provides a system for allocating addresses to slave devices through an RS-485 bus, including a master 1 and a plurality of slaves 2, where the master and the slaves 2 both include RS-485 interfaces and communicate through the RS-485 bus, and the system is characterized in that: the plurality of the slave machines 2 form an array with M rows and N columns, buses A in RS-485 buses of the N slave machines 2 in each row are connected with each other, the slave machines 2 in each row are connected with the bus A in the RS-485 bus of the master machine 1 through an opening point of a relay 3, buses B in the RS-485 buses of the M slave machines 2 in each column are connected with each other, the slave machines 2 in each column are connected with the bus B in the RS-485 bus of the master machine 1 through an opening point of a relay 3, and addresses are sequentially distributed according to the positions of the selected slave machines 2 in the rows and the columns of the M rows and the N columns of the array. In the prior art, when the slave 2 is accessed to the RS-485 bus, communication addresses need to be allocated in advance, and the addresses of all the slaves 2 are ensured not to be repeated, otherwise, the whole network communication fails, and when the slaves 2 are allocated with addresses, the problems of large workload, low coding efficiency and easy error operation exist, therefore, the invention provides a system capable of solving the existing RS-485 bus communication address setting defects, which is characterized in that a plurality of slaves 2 form an M-row and N-column slave 2 array, the buses A of each row of slaves 2 are all connected together and are connected with the bus A of the host 1 through a relay 3, the buses B of each column of slaves 2 are all connected together and are connected with the bus B of the host 1 through a relay 3, only the relays 3 of the rows and columns where the slaves 2 to be written with addresses are located are sucked, the address can be written into the slave machines 2, so that the sequential address writing of each slave machine 2 is realized, therefore, the invention can conveniently realize the address writing of a plurality of slave devices, has simple operation and high efficiency, can reduce the working strength, has lower cost and is suitable for all systems with RS-485 buses.
Specifically, address allocation software is arranged in the master 1, and the master 1 allocates addresses to all the slaves 2 through the address allocation software.
Specific example 2:
referring to fig. 2, embodiment 2 of the present invention provides an implementation method for allocating an address to a slave device through an RS-485 bus, including the following steps:
sp 1: opening address allocation software on the host 1;
sp 2: after the system is powered on, one slave machine 2 is selected from an M-row and N-column slave machine 2 array displayed in an interface of address allocation software, and an address to be written into the slave machine 2 is input;
sp 3: the method comprises the following steps that a host 1 controls relays 3 on corresponding rows and columns to suck according to horizontal and vertical positions of a selected slave 2 in a slave 2 array, a bus A and a bus B of the host 1 are respectively and correspondingly communicated with a bus A and a bus B of a unique slave 2, and the host 1 sends an address to be written to the selected slave 2 through an RS-485 bus;
sp 4: according to the order, a plurality of slaves 2 in the slave 2 array are selected on the interface of the address assignment software, the addresses to be written by each slave 2 are sequentially input, and the master 1 sequentially writes the addresses into the corresponding slaves 2 by the Sp3 method.
The address distribution system and the method of the invention are applicable to all systems with RS-485 buses, and only the master equipment and the slave equipment are required to be ensured to contain RS-485 interface modules, and the slave equipment is connected with the master equipment through the RS-485 bus, so that the applicability is strong.
Finally, it should be noted that: the above embodiments are only used to illustrate the technical solution of the present invention, and not to limit the same; while the invention has been described in detail and with reference to the foregoing embodiments, it will be understood by those skilled in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the 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.
Claims (3)
1. A realization system for distributing addresses to slave devices through an RS-485 bus comprises a host (1) and a plurality of slave devices (2), wherein the host and the slave devices (2) both comprise RS-485 interfaces and communicate through the RS-485 bus, and the realization system is characterized in that: the plurality of the slave machines (2) form an array with M rows and N columns, buses A in RS-485 buses of the N slave machines (2) in each row are connected with each other, the slave machines (2) in each row are connected with the bus A in the RS-485 bus of the main machine (1) through an open point of a relay (3), buses B in the RS-485 buses of the M slave machines (2) in each column are connected with each other, the slave machines (2) in each column are connected with the bus B in the RS-485 bus of the main machine (1) through an open point of a relay (3), and addresses are sequentially distributed according to the positions of the selected slave machines (2) in the rows and the columns of the M rows and the N columns of the array.
2. An implementation system for assigning addresses to slave devices via an RS-485 bus as claimed in claim 1, wherein: address distribution software is arranged in the host (1), and the host (1) distributes addresses for all the slaves (2) through the address distribution software.
3. An implementation method for allocating addresses to slave devices through an RS-485 bus is characterized in that: comprises the following steps:
sp 1: opening address allocation software on the host (1);
sp 2: after the system is powered on, selecting one slave (2) from an array of M rows and N columns of slave (2) displayed in an interface of address allocation software, and inputting an address to be written into the slave (2);
sp 3: the host (1) controls relays (3) on corresponding rows and columns to suck according to the horizontal and vertical positions of the selected slave (2) in the slave (2) array, a bus A and a bus B of the host (1) are respectively and correspondingly communicated with a bus A and a bus B of the only slave (2), and the host (1) sends an address to be written to the selected slave (2) through an RS-485 bus;
sp 4: according to the sequence, a plurality of slave machines (2) in the slave machine (2) array are selected on the interface of the address allocation software, the addresses to be written by each slave machine (2) are sequentially input, and the master machine (1) sequentially writes the addresses into the corresponding slave machines (2) by the method of Sp 3.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111507595.6A CN114257468A (en) | 2021-12-10 | 2021-12-10 | System and method for realizing address distribution to slave equipment through RS-485 bus |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202111507595.6A CN114257468A (en) | 2021-12-10 | 2021-12-10 | System and method for realizing address distribution to slave equipment through RS-485 bus |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114257468A true CN114257468A (en) | 2022-03-29 |
Family
ID=80794667
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202111507595.6A Pending CN114257468A (en) | 2021-12-10 | 2021-12-10 | System and method for realizing address distribution to slave equipment through RS-485 bus |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114257468A (en) |
Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2000165421A (en) * | 1998-11-25 | 2000-06-16 | Nec Kofu Ltd | Multi-slave bus line system and serial transfer method |
CN101635637A (en) * | 2008-07-21 | 2010-01-27 | 江森自控楼宇设备科技(无锡)有限公司 | Method and system for distributing intelligent addresses based on serial bus |
US20110202698A1 (en) * | 2010-01-20 | 2011-08-18 | Texas Instruments Deutschland Gmbh | Apparatus and method for increased address range of an i2c or i2c compatible bus |
CN105049551A (en) * | 2015-08-27 | 2015-11-11 | 赵忠义 | System and method for automatically distributing address via bus |
CN111147619A (en) * | 2019-12-20 | 2020-05-12 | 海丰通航科技有限公司 | Method and system for realizing automatic address allocation of RS485 slave equipment locally |
WO2020239944A1 (en) * | 2019-05-31 | 2020-12-03 | Ams International Ag | An inter-integrated circuit (i2c) apparatus |
CN216599654U (en) * | 2021-12-10 | 2022-05-24 | 湖北迅迪科技有限公司 | System for realizing address distribution to slave equipment through RS-485 bus |
-
2021
- 2021-12-10 CN CN202111507595.6A patent/CN114257468A/en active Pending
Patent Citations (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP2000165421A (en) * | 1998-11-25 | 2000-06-16 | Nec Kofu Ltd | Multi-slave bus line system and serial transfer method |
CN101635637A (en) * | 2008-07-21 | 2010-01-27 | 江森自控楼宇设备科技(无锡)有限公司 | Method and system for distributing intelligent addresses based on serial bus |
US20110202698A1 (en) * | 2010-01-20 | 2011-08-18 | Texas Instruments Deutschland Gmbh | Apparatus and method for increased address range of an i2c or i2c compatible bus |
CN105049551A (en) * | 2015-08-27 | 2015-11-11 | 赵忠义 | System and method for automatically distributing address via bus |
WO2020239944A1 (en) * | 2019-05-31 | 2020-12-03 | Ams International Ag | An inter-integrated circuit (i2c) apparatus |
CN111147619A (en) * | 2019-12-20 | 2020-05-12 | 海丰通航科技有限公司 | Method and system for realizing automatic address allocation of RS485 slave equipment locally |
CN216599654U (en) * | 2021-12-10 | 2022-05-24 | 湖北迅迪科技有限公司 | System for realizing address distribution to slave equipment through RS-485 bus |
Non-Patent Citations (2)
Title |
---|
"Optical Cache Memory Peripheral Circuitry: Row and Column Address Selectors for Optical Strtic RAM Banks", JOURNAL OF LIGHTWAVE TECHNOLOGY, vol. 31, no. 24, 21 October 2013 (2013-10-21) * |
胡忠林;赵晓冬;吴夕科;: "智能电容器自动分配通讯地址的设计与实现", 电力电容器与无功补偿, no. 01, 25 February 2020 (2020-02-25) * |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111147619B (en) | Method and system for realizing automatic address allocation of RS485 slave equipment locally | |
WO2014061841A1 (en) | Method of allocating unique identifier and battery management system using same | |
CN106101299B (en) | Method for assigning address to indoor unit and multi-line system | |
US20150239406A1 (en) | Method for configuring a control unit, control unit and vehicle | |
CN216599654U (en) | System for realizing address distribution to slave equipment through RS-485 bus | |
US8588943B2 (en) | Method for parameterizing operating means | |
CN114500472B (en) | Method for automatically distributing RS485 communication address | |
CN105745584A (en) | Automation system | |
CN114257468A (en) | System and method for realizing address distribution to slave equipment through RS-485 bus | |
CN109889421B (en) | Router management method, device, terminal, system and storage medium | |
CN116366437A (en) | Plug-and-play intra-cabinet networking strategy | |
CN107135120B (en) | Automatic test method and device for HPC cluster | |
CN109684138A (en) | A kind of visualization hard disk automatic test approach, device, terminal and storage medium | |
KR20130009277A (en) | Communications network structure for display module aging system | |
EP3839717B1 (en) | High bandwidth memory system with crossbar switch for dynamically programmable distribution scheme | |
CN115079622B (en) | Multi-servo debugging ID configuration system, method, electronic equipment and storage medium | |
CN114039950B (en) | Method for automatically distributing address of RS485 bus slave device | |
CN112990451A (en) | High bandwidth memory system with dynamically programmable allocation scheme | |
CN114884770B (en) | Multi-machine communication system and communication method based on system bus | |
CN105120013A (en) | Method and system for distributing network addresses of probe and central station | |
CN114826489B (en) | Link error correction method, system, storage medium and equipment | |
CN117544596B (en) | Automatic address allocation method for telemetry system, telemetry system and storage medium | |
CN117614940B (en) | Method and system for automatic configuration of serial communication equipment address | |
CN116132482A (en) | Internet of vehicles platform capable of automatically distributing equipment access ports and management method | |
EP1359511B1 (en) | Apparatus and method for addressing modules connected to a VME-bus |
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 |