CN101989932B - RS485-based automatic error detection method - Google Patents

RS485-based automatic error detection method Download PDF

Info

Publication number
CN101989932B
CN101989932B CN 200910056041 CN200910056041A CN101989932B CN 101989932 B CN101989932 B CN 101989932B CN 200910056041 CN200910056041 CN 200910056041 CN 200910056041 A CN200910056041 A CN 200910056041A CN 101989932 B CN101989932 B CN 101989932B
Authority
CN
China
Prior art keywords
equipment
controller
fault
moment
broadcasting signal
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
CN 200910056041
Other languages
Chinese (zh)
Other versions
CN101989932A (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.)
Giant (Kunshan) photoelectric lighting Co., Ltd.
Juer (Shanghai) Photoelectric Lighting Co., Ltd.
Original Assignee
JUER (SHANGHAI) PHOTOELECTRIC LIGHTING 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 JUER (SHANGHAI) PHOTOELECTRIC LIGHTING CO Ltd filed Critical JUER (SHANGHAI) PHOTOELECTRIC LIGHTING CO Ltd
Priority to CN 200910056041 priority Critical patent/CN101989932B/en
Publication of CN101989932A publication Critical patent/CN101989932A/en
Application granted granted Critical
Publication of CN101989932B publication Critical patent/CN101989932B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention relates to a RS485-based automatic error detection method, which aims to solve the problems that the fault of a node can lead to the paralysis of the whole system or part of the system generally because an interlinking method of adopting a bus to serially connect nodes by a RS485 is adopted, and because multiple of nodes exist and the action of judging which node makes errors is difficult, in common solutions, the device which causes the errors can be known only through artificially disconnecting devices from the bus one by one, therefore, the detection on the errors needs to spend considerable labor powers and times. In the invention, through the method of sequential detection, whether a device is a failure device is judged by detecting whether the device has a feedback response signal.

Description

The automatic debugging method of RS485
Technical field
The present invention relates to communication technique field, particularly relate to a kind of automatic debugging method to the RS485 communication.
Background technology
RS485 sends standard by a kind of balanced type data that the EIA of EIA (Electronic Industries Association) proposed in nineteen eighty-three, and the transceiver that satisfies this standard adopts balance to send and the differential received working method.In fact, RS485 (TIA/EIA-485) is counted as a kind of expansion of TIA/EIA-422 standard usually.Owing to support multinode (32 or more nodes), remote (maximum 4000 feet) and receive high sensitivity (200mV); When constituting communication network, only need a pair of twisted-pair feeder to make transmission line, therefore with low cost; Equipment is simple, under multistation, telecommunication environment, has obtained extensive use.
At present, RS-232 is arranged, RS-422, several kinds of interface standards of RS-485 are used for serial communication.RS-232 is a serial interface standard the earliest, short distance (<15M), obtained extensive use in the middle of the low baud rate serial communication.Thereafter short to the communication distance of RS-232 interface standard, the situation that baud rate is lower has proposed the RS-422 interface standard again on the basis of RS-232 interface standard, and the RS-485 interface standard overcomes these defectives.
RS-232 serial ports standard is kind of a single-ended standard that in the low rate serial communication, increases communication distance.RS-232 takes uneven transmission means, i.e. single-ended communication.The data-signal of its sending and receiving end is all with respect to earth signal.So its common mode inhibition capacity is poor, add the distributed capacitance of twisted-pair feeder, its transmission range maximum is about 15M, and flank speed is 20KBPS, and it can only the support point point to-point communication.
To the limitation of RS-232 serial ports standard, people have proposed RS-422 again, the RS-485 interface standard.RS-485/422 adopts balance to send with the differential received mode and realizes communication: transmitting terminal becomes differential signal A with the Transistor-Transistor Logic level conversion of signals of serial port, and the output of B two-way is reduced into Transistor-Transistor Logic level signal at receiving terminal with differential signal through after the cable transmission.Because transmission line uses twisted-pair feeder usually, is again differential transfer, so the ability of extremely strong again anti-common mode disturbances, bus transceiver sensitivity is very high, can detect to be low to moderate 200mV voltage.So transmission signals all is to recover outside km.The maximum communication distance of RS-485/422 is about 1219M, and peak transfer rate is 10Mb/S, and transmission rate and transmission range are inversely proportional to; Under the transmission rate of 100Kb/S; Just can reach maximum communication distance,, need add 485 repeaters if need the longer distance of transmission.RS-485 adopts half-duplex operation, supports multipoint data communication.The general bus type structure that adopts the terminal coupling of RS-485 bus network topology.Promptly adopt a bus that each node is connected in series, do not support annular or Star Network.Use hub-and-spoke configuration if desired, just must use 485 repeaters or 485 hubs just can.General maximum 32 nodes of supporting of RS-485/422 bus if use 485 special chips, can reach 128 or 256 nodes, and maximum can support 400 nodes.
Because it is more flexible that RS485 has long transmission distance, good in anti-interference performance, networking; Advantages such as support node is many; In in the past 20 years, RS485 is used in many different fields as a kind of electrical code of multiple spot differential data transmission; But be based on the characteristics that a main frame can only be arranged on the RS485 bus-bar, it often is applied between centralized control hinge and the decentralized control unit (as shown in Figure 1).
Because many limitation that RS485 bus-bar itself exists; Along with development of science and technology; Shortcomings such as the node application that the bus-bar efficient of RS485 reliability low, communication is low, multiple undesirable, the single bus-bar of transmission range of later maintenance cost network engineering application can articulate is dumb slowly come out, because RS485 adopts the link method that bus is connected in series each node, have a node to break down usually and can cause the paralysis of entire system or part; And; Because node is many, being difficult to again judge is that which node is made mistakes, and common solution is artificial with equipment disconnection detection on the bus one by one; Can know that just which equipment fault causes, maintenance need expend suitable manpower and time like this.
The present invention is just based in order to overcome above-mentioned defective; Invented the automatic debug technology of a kind of RS485 bus; Utilize the open and close of switch, reached the cooperation of software, realized the purpose of automatic debug; And need not increase additional apparatus, economical and easy overcome the problem that exists in the prior art.
Summary of the invention
Technical problem to be solved by this invention provides a kind of automatic debugging method based on RS485.To solve the problem that exists in the prior art, technical scheme provided by the invention is following:
A kind of automatic debugging method based on RS485 is characterized in that comprising the steps:
Step 1, during system boot, in debug work a period of time before, all devices D 1, D 2D iD nReceive ON-and OFF-command, with those equipment D 1, D 2D iD nCorresponding switch S 1, S 2S iS nAll be in off-state, at this moment, controller does not send communication signal, and wherein n is a natural number, 2≤i≤n-1;
Step 2, controller are issued orders and are let the equipment D of system to being connected 1, D 2D iD nDo debug action, controller is seen a broadcasting signal earlier off, lets all devices D on this bus 1, D 2D iD nAction, but, have only equipment D1 to move owing to all switches are broken off earlier in the step 1; And all the other equipment all are failure to actuate, at this moment, if equipment D1 does not have fault; It can see a broadcasting signal off to controller, does not have fault so that this equipment to be described, and execution in step three; If equipment D1 does not have broadcasting signal to see off, then devices illustrated D1 is a faulty equipment, and debug finishes;
Step 3, controller is given an order, equipment D I-1Switch S I-1The broadcasting signal that closure, controller are sent is delivered to equipment D 1, D 2D i, and because the equipment D of back I+1, D I+2D nSwitch remain open mode, so can not receive this broadcasting signal, can not move, and this moment equipment D 1, D 2D I-1Moved, so can not move again after receiving broadcasting signal, at this moment, if equipment D iDo not have fault, it can see a broadcasting signal off to controller, so that this equipment D to be described iThere is not fault, i+1 then, and repeat step 3; If equipment D iThere is not broadcasting signal to see off, then devices illustrated D iBe faulty equipment, debug finishes;
Step 4, if preceding n-1 platform equipment does not all break down, then faulty equipment is D n
In the above-mentioned embodiment, equipment D 1, D 2D iD nCan be light fixture, each light fixture can be set bright various colors, thereby can come the position of failure judgement equipment according to the color of lamp.
Wherein n can get any natural number in principle, but gets 32,128,256,400 etc. usually.
Description of drawings
Fig. 1 is a typical R S485 system schematic.
Fig. 2 is a RS485 debugging system sketch map before the present invention starts shooting.
Fig. 3 is the RS485 debugging system sketch map that the present invention detects first equipment.
Fig. 4 is the RS485 debugging system sketch map that the present invention detects second equipment.
Fig. 5 is the RS485 debugging system sketch map that the present invention detects the 3rd equipment.
Fig. 6 is the RS485 debugging system sketch map that the present invention detects the 4th equipment.
Embodiment
Below in conjunction with accompanying drawing and embodiment the present invention is specified.
After coming out, RS485 RCA slave controller connect n (n is a natural number) platform equipment; N gets 32,128,256,400 etc. usually; Present embodiment n gets 5, and the signal front end of each equipment has a switch to control corresponding apparatus more, and inside is then accepted and control appliance by single-chip microcomputer.
Suppose that the 4th equipment is out of order, judge that then it is that the faulty equipment method is following:
During system boot, in a period of time, all devices D1-D5 receives ON-and OFF-command, and is as shown in Figure 2 before debug work, and switch S 1-S5 all is in off-state, and at this moment, controller does not send communication signal;
Then, controller is issued orders and is let system that the equipment that is connected is done the debug action, and once instruction control unit can be seen a broadcasting signal earlier off; Let all devices action on this bus, but since before all switches are broken off earlier, have only equipment D1 to move; And all the other equipment all are failure to actuate, at this moment, because equipment D1 does not have fault; It can see a broadcasting signal off to controller, does not have fault so that this equipment to be described, and is as shown in Figure 3.
Simultaneously, switch S 1 closure of equipment D1, the broadcasting signal that controller sends is delivered to equipment D1 and D2; And because the switch of the equipment D3-D5 of back remains closed condition, so can not receive this broadcasting signal, can not move; And this moment, equipment D1 moved, so can not move after receiving broadcasting signal again, had only equipment D2 can receive signal and action; Seeing a broadcasting signal off does not have fault to controller so that this equipment to be described, as shown in Figure 4.
Simultaneously, switch S 2 closures of equipment D2, the broadcasting signal that controller sends is delivered to equipment D1-D3; And because the equipment D4 of back and the switch of D5 remain closed condition, so can not receive this broadcasting signal, can not move; And this moment, equipment D1 and D2 moved, and can not move after therefore receiving broadcasting signal again, had only equipment D3 can receive signal and moved; Seeing a broadcasting signal off does not have fault to controller so that this equipment to be described, as shown in Figure 5.
Simultaneously, switch S 3 closures of equipment D3, the broadcasting signal that controller sends is delivered to equipment D1-D4; And because the switch of the equipment D5 of back remains closed condition, so can not receive this broadcasting signal, can not move; And this moment, equipment D1-D3 moved, so can not move after receiving broadcasting signal again, had only equipment D4 can receive signal; And because equipment D4 has fault, when switch S 3 one closures of equipment D3, signal will be disturbed; Promptly this equipment D4 can not respond this broadcasting signal and move, and just can learn that equipment D4 is a fault equipment this moment, as shown in Figure 6.
Equipment in this execution mode can be light fixture equipment, and each light fixture can be set bright various colors, thereby can come the position of failure judgement equipment according to the color of lamp.
Through the method for above-mentioned automatic debug, can fast and easily judge the faulty equipment in the bus, saved great amount of manpower and material resources, remedied the deficiency in the RS485 communication, for further extensive use RS485 application power has had large increase.
Though the present invention explains that hereinbefore this does not represent that protection scope of the present invention is confined to above-mentioned structure according to preferred embodiment of the present invention, if by structure that claim of the present invention covered all within protection range.The technical staff in present technique field can be developed the equivalent substitution structure that at an easy rate after reading above-mentioned explanation, and these equivalent alternative structure also are within the scope that this case requires.

Claims (3)

1. the automatic debugging method based on RS485 is characterized in that comprising the steps:
Step 1, during system boot, in debug work a period of time before, all devices D 1, D 2D iD nReceive ON-and OFF-command, with those equipment D 1, D 2D iD nCorresponding switch S 1, S 2S iS nAll be in off-state, at this moment, controller does not send communication signal, 2≤i≤n-1 wherein, and n is a natural number;
Step 2, controller are issued orders and are let the equipment D of system to being connected 1, D 2D iD nDo debug action, controller is seen a communication signal earlier off, lets all devices D on the bus 1, D 2D iD nAction, but, have only equipment D1 to move owing to all switches are broken off earlier in the step 1; And all the other equipment all are failure to actuate, at this moment, if equipment D1 does not have fault; It can see a broadcasting signal off to controller, does not have fault so that this equipment D1 to be described, and execution in step three; If equipment D1 does not have broadcasting signal to see off, then devices illustrated D1 is a faulty equipment, and debug finishes;
Step 3, controller is given an order, equipment D I-1Switch S I-1The communication signal that closure, controller are sent is delivered to equipment D 1, D 2D i, and because the equipment D of back I+1, D I+2D nSwitch remain open mode, so can not receive this communication signal, can not move, and this moment equipment D 1, D 2D I-1Moved, so can not move again after receiving this communication signal, at this moment, if equipment D iDo not have fault, it can see a broadcasting signal off to controller, so that this equipment D to be described iThere is not fault, i+1 then, and repeat step 3; If equipment D iThere is not broadcasting signal to see off, then devices illustrated D iBe faulty equipment, debug finishes;
Step 4, if preceding n-1 platform equipment does not all break down, then faulty equipment is D n
2. the automatic debugging method of RS485 as claimed in claim 1, wherein equipment D 1, D 2D iD nCan be light fixture, each light fixture can be set bright various colors, thereby can come the position of failure judgement equipment according to the color of lamp.
3. the automatic debugging method of RS485 as claimed in claim 2, wherein n≤32.
CN 200910056041 2009-08-07 2009-08-07 RS485-based automatic error detection method Active CN101989932B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN 200910056041 CN101989932B (en) 2009-08-07 2009-08-07 RS485-based automatic error detection method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN 200910056041 CN101989932B (en) 2009-08-07 2009-08-07 RS485-based automatic error detection method

Publications (2)

Publication Number Publication Date
CN101989932A CN101989932A (en) 2011-03-23
CN101989932B true CN101989932B (en) 2012-12-12

Family

ID=43746290

Family Applications (1)

Application Number Title Priority Date Filing Date
CN 200910056041 Active CN101989932B (en) 2009-08-07 2009-08-07 RS485-based automatic error detection method

Country Status (1)

Country Link
CN (1) CN101989932B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102223275B (en) * 2011-06-24 2014-05-07 浙江亚卫通科技有限公司 Long-distance communication bus
CN104104542B (en) * 2014-07-16 2017-11-03 深圳市海亿达能源科技股份有限公司 A kind of real-time intelligent troubleshooting method based on RS485
CN105099506A (en) * 2015-08-21 2015-11-25 江阴长仪集团有限公司 Electric energy meter RS485 communication failure detecting and self-healing device and method
JP6600333B2 (en) 2017-05-31 2019-10-30 キヤノン株式会社 Electronic device, control method thereof, and program
CN108508876B (en) * 2018-05-17 2021-08-20 合肥威迪变色玻璃有限公司 Daisy chain RS485 control circuit and short circuit solving method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2410650Y (en) * 1999-09-02 2000-12-13 李志文 In-phase high voltage measuring device with wire-connecting function
CN201051760Y (en) * 2007-03-30 2008-04-23 南京汉德森科技股份有限公司 LED digital intelligent lighting control system
CN101420813A (en) * 2008-11-21 2009-04-29 浙江大学 Digital addressable illumination control system and method thereof
CN101989941A (en) * 2009-08-07 2011-03-23 巨尔(上海)光电照明有限公司 RS485 bus addressing method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2410650Y (en) * 1999-09-02 2000-12-13 李志文 In-phase high voltage measuring device with wire-connecting function
CN201051760Y (en) * 2007-03-30 2008-04-23 南京汉德森科技股份有限公司 LED digital intelligent lighting control system
CN101420813A (en) * 2008-11-21 2009-04-29 浙江大学 Digital addressable illumination control system and method thereof
CN101989941A (en) * 2009-08-07 2011-03-23 巨尔(上海)光电照明有限公司 RS485 bus addressing method

Also Published As

Publication number Publication date
CN101989932A (en) 2011-03-23

Similar Documents

Publication Publication Date Title
CN101989932B (en) RS485-based automatic error detection method
CN102053935A (en) MODBUS serial communication protocol-based communication method
CN105207785A (en) PoE system
CN101547526B (en) Fault handling method, wireless device and communication system
CN207939513U (en) A kind of optic fiber converter having ring redundancy networking capability
CN104795803A (en) Regional selective interlocking device
CN105162514A (en) Optical fiber ring network communication system and method
CN105099506A (en) Electric energy meter RS485 communication failure detecting and self-healing device and method
CN102970078A (en) Optical fiber network system and method for performing asynchronous communication data transmission by system
CN201690444U (en) Optical fiber bypass protecting device
CN203502802U (en) Converter module control system
KR19980036224A (en) Control method of 1 + 1 bidirectional line switching using power failure indication signal
US7944157B2 (en) Dual ring dedicated drive control system for medium voltage variable frequency drives
CN109802877A (en) A kind of CAN bus based Communication System Design
CN109088753B (en) Circuit and method for automatically detecting RS485 communication fault
CN205139637U (en) Multi -functional energy consumption data acquisition controller based on MBUS
CN103227636A (en) High-isolation direct splicing half-duplex communication interface module for interconnection of multiple controllers
CN201435848Y (en) Underground parking LED intelligent light
CN105044477A (en) Motor phase failure on-line detection early warning device
CN102413020A (en) Method, device and system for detecting link state
CN104753598A (en) Communication method for passive beam splitting RS-485 optical fiber bus
CN204065259U (en) A kind of Ethernet transmitting device of lightning arrester on-line monitoring equipment
CN101989941A (en) RS485 bus addressing method
CN205336273U (en) Electric energy meter RS485 communication fault detects device of self -healing
CN201039214Y (en) RS232 remote driver

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20170822

Address after: 201108, No. 7, gate 1, 1128 Jin Du Road, Shanghai, Minhang District

Co-patentee after: Giant (Kunshan) photoelectric lighting Co., Ltd.

Patentee after: Juer (Shanghai) Photoelectric Lighting Co., Ltd.

Address before: 201108, 7 floor, building 1128, 3 Jin Du Road, Shanghai, Minhang District

Patentee before: Juer (Shanghai) Photoelectric Lighting Co., Ltd.

TR01 Transfer of patent right