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

RS485-based automatic error detection method Download PDF

Info

Publication number
CN101989932A
CN101989932A CN2009100560411A CN200910056041A CN101989932A CN 101989932 A CN101989932 A CN 101989932A CN 2009100560411 A CN2009100560411 A CN 2009100560411A CN 200910056041 A CN200910056041 A CN 200910056041A CN 101989932 A CN101989932 A CN 101989932A
Authority
CN
China
Prior art keywords
equipment
controller
fault
send
moment
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.)
Granted
Application number
CN2009100560411A
Other languages
Chinese (zh)
Other versions
CN101989932B (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

Images

Landscapes

  • Small-Scale Networks (AREA)

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 at the RS485 communication.
Background technology
RS485 sends standard by a kind of balanced type data that the EIA of EIA (Electronic IndustriesAssociation) 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, has obtained extensive use under multistation, telecommunication environment.
At present, RS-232 is arranged, RS-422, several 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 at 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 increases communication distance in the low rate serial communication.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.
At 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 communication distance of RS-485/422 maximum 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 as a kind of electrical code of multiple spot differential data transmission, be used in many different fields, 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, the bus-bar efficient of RS485 is low, the reliability of communication is low, it is undesirable that the later maintenance cost network engineering is used multiple transmission range, shortcomings such as the node application that single bus-bar can articulate is dumb slowly come out, because RS485 adopts the link method that bus is connected in series each node, usually there is a node to break down and causes entire system or local paralysis, and, because node is many, being difficult to again judge is which node is made mistakes, common solution is manually 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, the open and close of switch have been utilized, and the cooperation of software, realize the purpose of automatic debug, and do not need to increase extra equipment, economical and easy overcome problems of 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 problems of the prior art, technical scheme provided by the invention is as follows:
A kind of automatic debugging method based on RS485 is characterized in that comprising the steps:
Step 1, during system boot, before debug work in a period of time, all devices D 1-D nReceive ON-and OFF-command, with those equipment D 1-D nCorresponding switch S 1-S nAll be in off-state, at this moment, controller does not send communication signal, and wherein n is a natural number;
Step 2, controller are issued orders and are allowed the equipment D of system to being connected 1-D nDo debug action, controller is sent a broadcasting signal earlier, allows all devices D on this bus 1-D nAction, but, have only equipment D1 to move owing to all switches are disconnected 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 send a broadcasting signal 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 send, 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 i, and because the equipment D of back I+1The switch of-Dn remains open mode, so can not receive this broadcasting signal, can not move, and this moment equipment D 1-D I-1Moved, so can not move again after receiving broadcasting signal, at this moment, if equipment D iDo not have fault, it can send a broadcasting signal 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 send, then devices illustrated D iBe faulty equipment, debug finishes, wherein 2≤i≤n-1;
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 nCan be light fixture, each light fixture can be set bright different color, 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 schematic diagram before the present invention starts shooting.
Fig. 3 is the RS485 debugging system schematic diagram that the present invention detects first equipment.
Fig. 4 is the RS485 debugging system schematic diagram that the present invention detects second equipment.
Fig. 5 is the RS485 debugging system schematic diagram that the present invention detects the 3rd equipment.
Fig. 6 is the RS485 debugging system schematic diagram that the present invention detects the 4th equipment.
Embodiment
Below in conjunction with drawings and Examples the present invention is described in detail.
After coming out, RS485 signal line 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 as follows:
During system boot, in a period of time, all devices D1-D5 receives ON-and OFF-command before debug work, and as shown in Figure 2, 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 allowed system that the equipment that is connected is done debug action, and once instruction control unit can be sent a broadcasting signal earlier, allows all devices action on this bus, but owing to all switches are disconnected earlier before, 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 send a broadcasting signal to controller, does not have fault so that this equipment to be described, 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, sending a broadcasting signal 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 action, sending a broadcasting signal 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, and promptly this equipment D4 can not respond this broadcasting signal and move, just can learn that equipment D4 is a fault equipment this moment, as shown in Figure 6.
Equipment in the present embodiment can be light fixture equipment, and each light fixture can be set bright different color, thereby can come the position of failure judgement equipment according to the color of lamp.
By 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 is illustrated hereinbefore according to preferred embodiment of the present invention, this does not represent that protection scope of the present invention is confined to above-mentioned structure, if by structure that claim of the present invention covered all within protection range.Those skilled in the art 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, before debug work in a period of time, all devices D 1-D nReceive ON-and OFF-command, with those equipment D 1-D nCorresponding switch S 1-S nAll be in off-state, at this moment, controller does not send communication signal, and wherein n is a natural number;
Step 2, controller are issued orders and are allowed the equipment D of system to being connected 1-D nDo debug action, controller is sent a communication signal earlier, allows all devices D on the bus 1-D nAction, but, have only equipment D1 to move owing to all switches are disconnected 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 send a broadcasting signal 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 send, 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 i, and because the equipment D of back I+1The switch of-Dn remains open mode, so can not receive this communication signal, can not move, and this moment equipment D 1-D I-1Moved, so can not move again after receiving this communication signal, at this moment, if equipment D iDo not have fault, it can send a broadcasting signal 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 send, then devices illustrated D iBe faulty equipment, debug finishes, wherein 2≤i≤n-1;
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 nCan be light fixture, each light fixture can be set bright different color, 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 true CN101989932A (en) 2011-03-23
CN101989932B 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)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102223275A (en) * 2011-06-24 2011-10-19 浙江亚卫通科技有限公司 Long-distance communication bus
CN104104542A (en) * 2014-07-16 2014-10-15 深圳市海亿达能源科技股份有限公司 Real-time intelligent debugging 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
CN108508876A (en) * 2018-05-17 2018-09-07 合肥威迪变色玻璃有限公司 A kind of improved daisy chain RS485 control circuits and short-circuit solution
US10782760B2 (en) 2017-05-31 2020-09-22 Canon Kabushiki Kaisha Electronic device and method of controlling the same

Family Cites Families (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

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102223275A (en) * 2011-06-24 2011-10-19 浙江亚卫通科技有限公司 Long-distance communication bus
CN102223275B (en) * 2011-06-24 2014-05-07 浙江亚卫通科技有限公司 Long-distance communication bus
CN104104542A (en) * 2014-07-16 2014-10-15 深圳市海亿达能源科技股份有限公司 Real-time intelligent debugging method based on RS485
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
US10782760B2 (en) 2017-05-31 2020-09-22 Canon Kabushiki Kaisha Electronic device and method of controlling the same
CN108508876A (en) * 2018-05-17 2018-09-07 合肥威迪变色玻璃有限公司 A kind of improved daisy chain RS485 control circuits and short-circuit solution

Also Published As

Publication number Publication date
CN101989932B (en) 2012-12-12

Similar Documents

Publication Publication Date Title
AU600577B2 (en) Lan communication system and medium adapter for use therewith
CN101989932B (en) RS485-based automatic error detection method
CN106658565B (en) Multilink preferred transmission method and device for wireless communication of rail transit train-ground
US5038140A (en) Supervisory system in communication system
CN102752145B (en) Novel detecting and isolating system for fault of RS-485 port and method thereof
CN102053935A (en) MODBUS serial communication protocol-based communication method
CN207939513U (en) A kind of optic fiber converter having ring redundancy networking capability
CN105099506A (en) Electric energy meter RS485 communication failure detecting and self-healing device and method
CN105162514B (en) Optical fiber ring network communication system and method
CN101547526B (en) Fault handling method, wireless device and communication system
CN201732158U (en) Self-checking device
CN103227636A (en) High-isolation direct splicing half-duplex communication interface module for interconnection of multiple controllers
CN102407868A (en) Hot-standby dual-connection method suitable for communication protocol of modern monitoring system of rail transit
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
CN102387059A (en) Method and device for carrying out automatic matching on field bus terminals
CN109088753B (en) Circuit and method for automatically detecting RS485 communication fault
CN104753598A (en) Communication method for passive beam splitting RS-485 optical fiber bus
CN104135411A (en) Device and method of implementing multi-node communication based on RS232 interface
CN202904869U (en) RS485 bus interface with relay function
CN112947288A (en) PLC multi-module extension device and identification enumeration method
CN108508876B (en) Daisy chain RS485 control circuit and short circuit solving method
CN101989941A (en) RS485 bus addressing method
CN204065259U (en) A kind of Ethernet transmitting device of lightning arrester on-line monitoring equipment
Kirkham et al. Design considerations for a fiber optic communications network for power systems

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
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.