Method and system for automatic addressing of 485 bus communication devices

By using CRC checksums as addressing identifiers and dividing number segments in the RS-485 bus network, automatic addressing is achieved, solving the problems of address conflicts and forgetting, improving address lookup efficiency and reducing maintenance costs.

CN120091008BActive Publication Date: 2025-11-25SHANDONG RENKE MEASUREMENT & CONTROL TECH CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510573106.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-05-06
Publication Date
2025-11-25
Estimated Expiration
2045-05-06

AI Technical Summary

Technical Problem

In RS-485 bus networks, device address management suffers from problems such as address conflicts, address forgetting, and high maintenance costs, leading to bus signal superposition and communication interruptions. Traditional protocols cannot actively detect conflicts and cannot read storage addresses non-intrusively.

Method used

The CRC checksum of the functional device is used as the addressing identifier and is divided into multiple segments. The 485 bus master device broadcasts the query sequentially. The functional device of each segment replies with an existence command. The functional device feeds back the address information within a specified time slot. The master device performs the address query to avoid bus signal superposition.

Benefits of technology

It improves the efficiency of address lookup for functional devices, saves query time, avoids bus signal superposition, and is suitable for explosion-proof and high-risk environments without the need for physical contact to modify addresses.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120091008B_ABST
    Figure CN120091008B_ABST
Patent Text Reader

Abstract

The application provides a method and system for automatically addressing 485 bus communication equipment, comprising the following steps: calculating a CRC check value of a functional equipment and configuring the CRC check value as an addressing identifier; evenly dividing the addressing identifier into a plurality of number segments; sequentially broadcasting a query for each number segment by a 485 bus host equipment, and if the queried number segment has a functional equipment, the functional equipment replies an existing instruction, otherwise, it does not reply; the 485 bus host equipment queries the address of the number segment from which the functional equipment feeds back an existing instruction; and after receiving the address query instruction, the functional equipment feeds back address information to the 485 bus host equipment within a specified time slot. Compared with the address global polling method in the prior art, the 485 bus equipment automatic addressing method greatly improves the address searching efficiency of the functional equipment and saves the address query time.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of device communication methods, and in particular to a method and system for automatic addressing of 485 bus communication devices. Background Technology

[0002] In an RS-485 bus network, all devices share a communication channel and achieve master-slave or peer-to-peer communication through a unique address. However, device address management suffers from problems such as address conflicts, address forgetting, and high maintenance costs. Specifically, devices have a unified default address at the factory (e.g., 0x01). If they are connected to the bus without manual modification, multiple devices responding to the same command can cause bus signal superposition (waveform distortion) and communication interruption. When engineers configure addresses on-site using DIP switches or software tools, duplicate addresses are prone to occur (especially in large-scale networks), and traditional protocols cannot actively detect conflicts. In addition, if a device address is forgotten, the current address cannot be obtained through software, and the stored address cannot be read non-intrusively. Summary of the Invention

[0003] This application provides a method and system for automatic addressing of 485 bus communication devices, used to address functional devices set on the 485 bus.

[0004] This application provides a method for automatic addressing of 485 bus communication devices, including:

[0005] Calculate the CRC check value of the functional device, and configure the CRC check value as the addressing identifier;

[0006] The addressing identifier is divided into multiple number segments on an even basis;

[0007] The 485 bus master device broadcasts a query for each number segment in sequence. If a functional device exists in the queried number segment, the functional device will reply with a presence command; otherwise, it will not respond.

[0008] The 485 bus host device performs address lookup for the number segment where the functional device reports an instruction;

[0009] After receiving the address query command, the functional device sends the address information back to the 485 bus host device within a specified time slot.

[0010] In one feasible implementation, if the 485 bus host does not receive an existence instruction from the functional device, it queries the next number segment.

[0011] In one feasible implementation, the addressing identifier is divided into 256 segments on average.

[0012] In one feasible implementation, the time slot is calculated by taking the remainder of 256 based on the addressing identifier.

[0013] In one feasible implementation, the time slot is obtained by taking the remainder of 256 based on the addressing identifier and multiplying the remainder by 26ms.

[0014] In one feasible implementation, the CRC check value of the functional device is calculated based on the ID identifier of the functional device.

[0015] In one feasible implementation, the address information includes an addressing identifier and a 485 address.

[0016] In one feasible implementation, after the functional device feeds back address information to the 485 bus host device within a specified time slot, the 485 bus host device sends an address modification instruction to the 485 address fed back by the functional device.

[0017] Secondly, embodiments of this application provide a system using 485 bus communication, including a host device and a functional device, wherein the host device obtains the address of the functional device according to the 485 bus communication device automatic addressing method described in any one of the first aspects.

[0018] This automatic addressing method for 485 bus communication devices configures the CRC checksum of functional devices as the addressing identifier and divides it into multiple segments to quickly determine the range of functional device addresses. Then, the 485 bus master device queries the address range where functional devices have returned instructions. The functional devices then return address information to the 485 bus master device within a specified time slot, ensuring time-sharing responses from all functional devices within the same segment and avoiding bus signal overlap. Compared to the existing global address polling method, this automatic addressing method for 485 bus devices significantly improves the efficiency of functional device address lookup and saves address lookup time.

[0019] In a system using 485 bus communication, the host device obtains the address of the functional device according to the above-mentioned method of automatic addressing of 485 bus communication devices, thus possessing all the beneficial effects of the method of automatic addressing of 485 bus communication devices of any of the above technical solutions, which will not be elaborated here. Attached Figure Description

[0020] The accompanying drawings, which are provided to further illustrate the invention and constitute a part of this invention, are illustrative embodiments of the invention and their descriptions are used to explain this application and do not constitute an undue limitation of the invention.

[0021] In the attached diagram:

[0022] Figure 1 This is a flowchart of a method for automatic addressing of 485 bus devices provided in an embodiment of this application. Detailed Implementation

[0023] To enable those skilled in the art to better understand the technical solutions in this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments in this application, all other embodiments obtained by those of ordinary skill in the art without creative effort should fall within the scope of protection of this application.

[0024] In the description of the embodiments of this application, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "multiple" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0025] In this application, unless otherwise expressly specified and limited, the terms "installation," "connection," "joining," and "fixing," etc., should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral part; they can refer to a mechanical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication of two components or the interaction between two components, unless otherwise expressly limited. Those skilled in the art can understand the specific meaning of the above terms in this application according to the specific circumstances.

[0026] In this application, unless otherwise expressly specified and limited, "above" or "below" the second feature can mean that the first feature is in direct contact with the second feature, or that the first feature is in indirect contact with the second feature through an intermediate medium. Furthermore, "above," "over," and "on top" of the second feature can mean that the first feature is directly above or diagonally above the second feature, or simply that the first feature is at a higher horizontal level than the second feature. "Below," "below," and "under" the second feature can mean that the first feature is directly below or diagonally below the second feature, or simply that the first feature is at a lower horizontal level than the second feature.

[0027] In an RS-485 bus network, all devices share a communication channel and achieve master-slave or peer-to-peer communication through a unique address. However, device address management suffers from problems such as address conflicts, address forgetting, and high maintenance costs. Specifically, devices have a unified default address at the factory (e.g., 0x01). If they are connected to the bus without manual modification, multiple devices responding to the same command can cause bus signal superposition (waveform distortion) and communication interruption. When engineers configure addresses on-site using DIP switches or software tools, duplicate addresses are prone to occur (especially in large-scale networks), and traditional protocols cannot actively detect conflicts. In addition, if a device address is forgotten, the current address cannot be obtained through software, and the stored address cannot be read non-intrusively.

[0028] In related technologies, manual polling, broadcast reset, and physical signal detection are used to solve the above problems. However, manual polling involves powering down and isolating each functional device individually, locating the conflict through elimination, which is extremely time-consuming (N devices require N tests), and involves a huge workload. Furthermore, complex on-site situations may arise where power disconnection or disconnection is not possible. Broadcast reset requires sending a global reset command to reset the addresses of all devices. This method requires devices to support reset responses and may cause secondary conflicts (multiple devices resetting simultaneously may still result in the same address). Physical signal detection detects conflicts by monitoring abnormal bus levels; however, it can only detect the existence of a conflict, not locate the conflicting device, resulting in a high false alarm rate (electromagnetic interference can also cause abnormal levels).

[0029] To address the above problems, this application provides a method and system for automatic addressing of 485 bus communication devices.

[0030] Figure 1 This is a flowchart of a method for automatic addressing of 485 bus devices provided in an embodiment of this application.

[0031] Reference Figure 1 As shown in the figure, this application provides a method for automatic addressing of a 485 bus communication device, including:

[0032] S100: Calculate the CRC check value of the functional device and configure the CRC check value as the addressing identifier.

[0033] For example, the entire 485 communication bus includes a 485 bus master device and functional devices. The 485 bus master device communicates with and controls the functional devices. Each functional device has a unique ID. For example, this ID can be the factory-installed ID of the microcontroller within the functional device. A CRC checksum is calculated based on the ID of each functional device. The CRC checksum range is 0-65535, and this CRC checksum is configured as an addressing identifier, also ranging from 0 to 65535. It should be noted that the method of calculating the CRC checksum based on the microcontroller ID is existing technology and will not be elaborated upon here. It is understood that the 485 bus master device can be a controller, and the functional devices can be detection components equipped with a microcontroller system.

[0034] S200: Divide the addressing identifier into multiple number segments on an average basis.

[0035] For example, the addressing identifier can be divided into 256 consecutive number segments, each with 256 values, such as 0-255, 256-511, ... 65280-65535.

[0036] S300: The 485 bus master device broadcasts a query for each number segment in sequence. If a functional device exists in the queried number segment, the functional device will reply with a presence command; otherwise, it will not respond.

[0037] For example, the 485 bus master device broadcasts a query for each number segment sequentially. If the addressing identifier of a functional device is within the queried number segment, the functional device replies with a presence command to the 485 bus master. If the addressing identifier of the functional device is not within the queried number segment, the functional device does not respond. For example, number 00 represents the first number segment, including 0-255; number 01 represents the second number segment, including 256-511; and so on for all number segments. The addressing identifier of a certain device is 5. When the 485 bus master device broadcasts a query for the number segment labeled 00, the device determines that its addressing identifier 5 is within the first number segment (0-255), and then responds to the 485 bus master device with a presence command. For example, the presence command can be identified by a single byte 5A.

[0038] After broadcasting a query for a specific number segment, the 485 bus master device waits 40ms to ensure that all functional devices within that segment have responded. If the 485 bus master receives a presence command from a functional device, it determines that a functional device exists in the queried number segment and then performs an address lookup for that segment. After the address lookup is complete, it broadcasts a query for the next number segment. If the 485 bus master does not receive a presence command from a functional device, it continues broadcasting a query for the next number segment.

[0039] S400: The 485 bus host device performs an address lookup for the number segment where the functional device reports an instruction.

[0040] S500: After receiving the address query command, the functional device sends the address information back to the 485 bus host device within a specified time slot. The address information includes the addressing identifier and the 485 address.

[0041] For example, the time slot corresponding to a functional device can be calculated based on the addressing identifier. Specifically, the addressing identifier is modulo 256 to obtain the remainder, which is then multiplied by 26ms to obtain the time slot. After receiving an address query from the 485 bus master device specifying the instruction segment's address, the functional device sends the address information to the 485 bus master device after the calculated time slot. For example, if the addressing identifier of a functional device is 258, then the functional device will send the address information back to the 485 bus master device after 2*26=52ms. It can be understood that by sending the address information back to the 485 bus master device within the specified time slot, the functional device ensures that all functional devices within the same segment respond in a time-division manner, avoiding bus signal overlap.

[0042] When the 485 bus master device receives a response from a functional device, determines that a functional device exists in a certain number segment, and sends an address query command for that number segment, it needs to wait 6700ms before querying the next number segment.

[0043] The time calculation is based on a 4800 baud rate as an example. Other baud rates are calculated proportionally. At 4800 baud rate, one byte takes approximately 2ms, and judging one frame of data (3.5 bytes) takes approximately 7ms. 26ms is the calculated response time and fault tolerance time for the measurement point at 4800 baud rate.

[0044] In other examples, after the functional device feeds back address information to the 485 bus master device within a specified time slot, the 485 bus master device sends an address modification command to the 485 address fed back by the functional device. It is understandable that using a unique addressing identifier to bind the functional device and directly modifying the address via broadcast commands, without physical contact or disassembly, is particularly suitable for explosion-proof and high-risk environments.

[0045] Secondly, embodiments of this application provide a system using 485 bus communication, including a host device and a functional device. The host device obtains the address of the functional device according to the 485 bus communication device automatic addressing method described in any of the first aspects. This includes the 485 bus communication device automatic addressing method in any of the above-described technical solutions, and therefore possesses all the beneficial effects of the 485 bus communication device automatic addressing method in any of the above-described technical solutions, which will not be elaborated further here.

[0046] It is readily understood that, based on the several embodiments provided in this application, those skilled in the art can combine, split, or reorganize the embodiments of this application to obtain other embodiments, none of which exceed the protection scope of this application.

[0047] The above detailed embodiments further illustrate the purpose, technical solution, and beneficial effects of the embodiments of this application. It should be understood that the above are merely specific embodiments of the embodiments of this application and are not intended to limit the protection scope of the embodiments of this application. Any modifications, equivalent substitutions, improvements, etc., made on the basis of the technical solutions of the embodiments of this application should be included within the protection scope of the embodiments of this application.

Claims

1. A method for automatic addressing of 485 bus communication devices, characterized in that, The method comprises the following steps: calculating the CRC check value of the functional device and configuring the CRC check value as an addressing identifier; dividing the addressing identifier into multiple number segments averagely; the 485 bus host device broadcasts a query for each number segment in turn, if the queried number segment has a functional device, the functional device replies with an existing instruction, otherwise it does not reply; the 485 bus host device queries the address of the number segment from which the functional device feeds back the existing instruction; after receiving the address query instruction, the functional device feeds back the address information to the 485 bus host device within a specified time slot; dividing the addressing identifier into 256 number segments averagely; calculating the time slot according to the addressing identifier modulo 256; calculating the time slot according to the addressing identifier modulo 256, and multiplying the remainder by 26 ms to obtain the time slot; calculating the CRC check value of the functional device according to the ID identifier of the functional device.

2. The method for automatic addressing of 485 bus communication devices according to claim 1, characterized in that, If the 485 bus host does not receive the existing instruction fed back by the functional device, it queries the next number segment.

3. The method for automatic addressing of 485 bus communication devices according to claim 1, wherein, The address information comprises the addressing identifier and the 485 address.

4. The method for automatic addressing of a 485 bus communication device according to claim 3, characterized in that, After the functional device feeds back the address information to the 485 bus host device within a specified time slot, the 485 bus host device sends an address modification instruction to the 485 address fed back by the functional device.

5. A system employing 485 bus communication, characterized by, The method comprises a host device and a functional device, the host device obtains the address of the functional device according to the automatic addressing method of the 485 bus communication device of any one of claims 1-4.

Citation Information

Patent Citations

  • Automatic equipment adding method and system

    CN113949628A

  • Equipment physical address quick retrieval method based on universal address bus

    CN114448943A