Method of implementing embedded device address installation by RS 485 bus competition

A technology of embedded devices and device addresses, applied in the bus network, data exchange through path configuration, etc., can solve the problems of high anti-interference, loss of versatility, unsuitable for application, etc., to improve the degree of intelligence and high reliability Effect

Active Publication Date: 2008-04-16
ZTE CORP
0 Cites 33 Cited by

AI-Extracted Technical Summary

Problems solved by technology

The method is relatively simple, but the signal line is added, the versatility is lost, and the advantages of RS485 ar...
the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Method used

[0107] In summary, the present invention uses conflict detection to solve the problem of bus contention, and uses...
the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
View more

Abstract

The invention discloses a method for RS485 bus contention competition realizing an embedded equipment address setting. The object of the invention is to realize that the identifying and resetting of every equipment address can be finished under the premise that no signal transmission line is added. The invention comprises the steps as follows: (1) a monitoring host computer is cooperated with the equipment to identify whether the equipment address is abnormal; if so, the step (2) is switched to; if not, the step is over; (2) every equipment is noticed to enter the state of address reset by the monitoring host computer; (3) the monitoring host computer sends the order of setting equipment address to every equipment, and every equipment answer according current situation and resets address. The invention solves the problem that in the RS485 and other master-slave mode bus monitoring network, equipment causes bus conflict or incapable visit because of address losing. And the identifying and resetting of every equipment address can be finished under the premise that no signal transmission line is added. The advantage of high reliability of the RS485 is ensured.

Application Domain

Technology Topic

Bus contentionRS-485 +2

Image

  • Method of implementing embedded device address installation by RS 485 bus competition
  • Method of implementing embedded device address installation by RS 485 bus competition
  • Method of implementing embedded device address installation by RS 485 bus competition

Examples

  • Experimental program(1)

Example Embodiment

[0057] Example one
[0058] A company has produced a certain type of embedded power system, which is widely used by various telecommunication equipment manufacturers and operators across the country. The power system consists of AC power distribution, DC power distribution, up to 10 rectifiers and monitoring units. Due to power density requirements and cost pressure, the rectifier does not have any human-computer interaction equipment except an alarm indicator and RS485 interface. Therefore, the monitoring unit needs to be connected to the 10 rectifiers through the RS485 bus, and through a simple communication protocol, polling to obtain the data and alarm information of each rectifier, and to control the operating status of the rectifier.
[0059] image 3 It is a hardware schematic diagram of the first embodiment of the present invention. As shown in the figure, due to the need for bus competition, the RS485 hardware control signal is slightly changed from the current common practice. The receiving control signal RE is always valid and does not need to be controlled by the single-chip microcomputer.
[0060] In most cases, users do not need up to 10 rectifiers, but according to the actual power consumption, configure about 4 rectifiers, but must have the ability to expand; in the future, they may only need to purchase the rectifiers separately, plug and play . There are saved address parameters inside the rectifier, and the addresses from 1 to 10 are valid. When interference or other events occur, such as rectifier failure, replacement, expansion increase, it is easy to cause the loss of address parameters, address conflicts, address overflow, etc.; after the occurrence, the address cannot be reset by the rectifier itself, only by The monitoring unit is set via RS485 bus. A specific description will be given below.
[0061] Assuming that the system is equipped with 6 rectifiers, the RS485 communication rate is 9600bps. The address of the rectifier recognized by the monitoring unit is 1, 2, 3, 4, 5, 6. In reality, there are 7 rectifiers, marked as A, B, C, D, E, F, and G. The internally set addresses are 1, 1, 4, 6, 6, 8, and 0 respectively.
[0062] As shown in Table 1:
[0063] A B C D E F G
[0064] 1
[0065] Table 1
[0066] Address 8 indicates that the rectifier F may be newly added; address 0 indicates that the address parameter of the rectifier G is missing. Obviously, when the monitoring unit polls each rectifier at this time, the following situations will occur:
[0067] (1) When polling No. 1 and No. 6 rectifiers, two rectifiers A/B and D/E respond respectively, and the bus data conflicts;
[0068] (2) When polling No. 2, 3, and 5 rectifiers, there is no rectifier response;
[0069] (3) Polling No. 4 rectifier, C rectifier responds normally;
[0070] (4) The F and G rectifiers cannot be accessed.
[0071] Next, we will realize the address recognition and setting of the rectifier.
[0072] In the first step, the monitoring unit and the device cooperate to identify the conflict or overflow of the address.
[0073] The monitoring unit periodically broadcasts and sends current system configuration information to each rectifier, notifying that the current configuration number of the rectifier is 6, and the communication wave speed is 9600bps, 8 data bits, 1 start bit, and 1 stop bit. Obviously, all rectifiers with matched wave speeds can receive the configuration information, while rectifiers with unmatched wave speeds will receive the information incorrectly. When a period of time, if the configuration information cannot be received correctly, the rectifier can actively send the "configuration information request" message frame to the monitoring unit multiple times. The message frame interfered with the data bus many times, and was finally recognized by the monitoring unit, and the address needs to be reset.
[0074] Even if the wave speeds of the rectifiers are matched, the F and G rectifiers cannot be accessed due to the mismatch between the addresses and the configuration in the monitoring unit, and they need to actively send multiple "request configuration information" message frames, or deliberately interfere with the data bus; When the monitoring unit polls No. 2, 3, and No. 5 rectifiers, there is no rectifier response; when polling No. 1, No. 6 rectifiers, there are two rectifiers A/B and D/E respond respectively, and the bus data conflicts; in this case, no matter what It can be recognized whether it is the monitoring unit or the rectifier that sends the response information (the sending and receiving data is inconsistent); after multiple confirmations, the monitoring unit can determine that the address needs to be reset.
[0075] The second step is that the monitoring host informs each device to enter the address reset state at 9600bps. This step is very simple, just issue a broadcast command. If there are rectifiers with different communication wave speed configurations, the monitoring host needs to broadcast the commands under various wave speeds to ensure that all rectifiers can receive it.
[0076] In the third step, the monitoring host issues the device address setting commands one by one, and each device responds and resets the address according to the current address situation; this completes the address setting of all devices.
[0077] a. Determine the basic time unit of bus competition t0=2×(8+1+1)/9600=2ms; here, the K value is 2, taking into account the delay of sending data and receiving interruption in the actual system;
[0078] b. The number of devices configured is M=10. Considering the low real-time requirements of the system and the possibility of reducing the number of conflicts, the value of N is larger, 64, then the total time of each competition is T=t0×4×N =512ms;
[0079] c. The time period in each priority level is T′=T/4=128ms, and the maximum number of conflicts is C=log 2 64-1=5 times; when any one rectifier conflicts more than 5 times, it will reset to zero and restart counting;
[0080] d. such as Figure 4 As shown, the following four priority time periods are determined. When the rectifier address matches the setting address, the rectifier must send an address response message within 128ms to respond to the setting command of the monitoring unit; the rectifier with a missing address will respond between 128ms and 256ms The rectifier with an address overflow responds between 256ms and 384ms; the address contains a response between 384ms and 512ms; if there is no rectifier response beyond 512ms, the monitoring unit can consider that all actual rectifiers have set addresses; the back-off time t=t0 in each time period ×(2 i +rand(N/2)-1)=2×(2 i +rand(32)-1)ms;
[0081] e. The monitoring unit first sends the "Set rectifier No. 1 address" command;
[0082] f. Obviously, the A and B rectifier addresses of address No. 1 match, and both respond to commands within 128ms; other rectifiers may respond only after 128ms. The number of conflicts i at the beginning of A and B are both 0, so the back-off time is t=(rand(32)-1)×2ms; suppose that the A rectifier gets t=10ms, and B gets t=24ms;
[0083] Therefore, during 0-10ms, the A rectifier detects that there is no data on the RS485 bus, that is, there is no address conflict, and sends a response message (such as a single-byte response code 0xa5) in the 10th ms;
[0084] g. At the same time, the A rectifier will receive the same response information from the bus, which is also 0xa5. At this time, A will compete for the successful bus right; other rectifiers, including B, will also receive 0xa5 at the same time, and the other rectifiers will wait for the next set address Command, that is, the command at address 2;
[0085] h. The monitoring unit receives the response message at the same time, which is also 0xa5, indicating that the rectifier competition is successful; the monitoring unit repeatedly issues the "set rectifier No. 1 address" command, and waits for A to respond with the response message 0xa5 again; after confirming the successful response, the monitoring unit sends " "No. 1 rectifier exits the competition" command frame, after the A rectifier sets its address to 1, it exits the competition;
[0086] i. If the backoff time of A and B is the same, 0xa5 will be issued by A and B at the same time, and there will be two situations:
[0087] (i1) The data on the bus is exactly 0xa5; this situation can be solved by repeating step h;
[0088] (i2) The data on the bus is not 0xa5, and there is a bus conflict; A and B both fail to compete; the number of conflicts between A and B each increase by one; wait for the monitoring unit to send the "set rectifier No. 1 address" command to compete again;
[0089] j. Assuming that A is finally set to address 1 successfully, B will change to the "address loss" state; wait for the next round of address competition;
[0090] k. The monitoring unit sends the "set rectifier No. 2 address" command;
[0091] l. The G and B rectifiers with missing addresses start the bus competition again; other rectifiers have lower priority and will respond after at least 256ms;
[0092] m.G and B rectifiers always have a competitive success. Since B has failed in competition with A, the number of conflicts is large, and the backoff time may be large. Therefore, it is very likely that B will fail again, and the G rectifier will successfully set the No. 2 address;
[0093] n. The monitoring unit sends the command "set rectifier No. 3 address";
[0094] p. Among the remaining rectifiers, the B with the missing address has the highest priority. Therefore, the smooth competition succeeds and the No. 3 address is successfully set;
[0095] q. The monitoring unit sends the "set rectifier No. 4 address" command;
[0096] r. The C rectifier with the only matching address is undoubtedly successfully set to the 4th address;
[0097] s. The monitoring unit sends the "set rectifier No. 5 address" command;
[0098] t. The F rectifier with address overflow has the highest priority, and the No. 5 address is successfully set;
[0099] u. The monitoring unit sends the "set rectifier No. 6 address" command;
[0100] v. D and E rectifiers, like A and B, start the competition for address matching; suppose that finally D is successfully set to address No. 6;
[0101] w. The monitoring unit tentatively sends the "set rectifier No. 7 address" command to check if there are other unset rectifiers;
[0102] x. The remaining E rectifiers have the highest priority and the No. 7 address is successfully set;
[0103] y. The monitoring unit tentatively sends the "Set Rectifier No. 8 Address" command to check if there are other unset rectifiers;
[0104] z. All 7 rectifiers have been set up, and there is no rectifier response within 512ms. The monitoring unit modifies its configuration to 7 rectifiers;
[0105] z1. The monitoring unit broadcasts and issues the "all rectifiers exit setting state" command, then all rectifiers exit the setting state and switch to normal polling.
[0106] The above is just a special example of address conflict or loss of multiple rectifiers, but it also clearly shows that after bus contention and address setting, after adopting this better priority algorithm, the addresses of the three rectifiers A, C, and D are still The original address number configuration is maintained to ensure the matching and completeness of the historical data and fault records of each rectifier as much as possible, which facilitates maintenance.
[0107] In summary, the present invention uses conflict detection to solve the problem of bus contention, and uses optimization algorithms to ensure that as many devices as possible remain unchanged.
the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

PUM

no PUM

Description & Claims & Application Information

We can also present the details of the Description, Claims and Application information to help users get a comprehensive understanding of the technical details of the patent, such as background art, summary of invention, brief description of drawings, description of embodiments, and other original content. On the other hand, users can also determine the specific scope of protection of the technology through the list of claims; as well as understand the changes in the life cycle of the technology with the presentation of the patent timeline. Login to view more.
the structure of the environmentally friendly knitted fabric provided by the present invention; figure 2 Flow chart of the yarn wrapping machine for environmentally friendly knitted fabrics and storage devices; image 3 Is the parameter map of the yarn covering machine
Login to view more

Similar technology patents

Classification and recommendation of technical efficacy words

  • High degree of intelligence
  • Improve reliability

Arc-shaped cutting anastomat

ActiveCN101912284AGood assembly firmnessImprove reliabilitySurgical staplesDistal anastomosisEngineering
Owner:CHANGZHOU JIANRUIBAO MEDICAL DEVICES

Distributed power harvesting systems using DC power sources

ActiveUS20080143188A1Improve reliabilitySafe operating voltageDc network circuit arrangementsBatteries circuit arrangementsTransverterVoltage variation
Owner:SOLAREDGE TECH LTD
Who we serve
  • R&D Engineer
  • R&D Manager
  • IP Professional
Why Eureka
  • Industry Leading Data Capabilities
  • Powerful AI technology
  • Patent DNA Extraction
Social media
Try Eureka
PatSnap group products