CN102331762B - Control method for master station write-in of address codes by RS-485 buses - Google Patents

Control method for master station write-in of address codes by RS-485 buses Download PDF

Info

Publication number
CN102331762B
CN102331762B CN2011102035406A CN201110203540A CN102331762B CN 102331762 B CN102331762 B CN 102331762B CN 2011102035406 A CN2011102035406 A CN 2011102035406A CN 201110203540 A CN201110203540 A CN 201110203540A CN 102331762 B CN102331762 B CN 102331762B
Authority
CN
China
Prior art keywords
address code
extension set
exchange
extension
bus
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.)
Expired - Fee Related
Application number
CN2011102035406A
Other languages
Chinese (zh)
Other versions
CN102331762A (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.)
Sichuan Jiuzhou Electronic Technology Co Ltd
Sichuan Jiuzhou Optoelectronics Technology Co Ltd
Original Assignee
Sichuan Jiuzhou Optoelectronics Technology 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 Sichuan Jiuzhou Optoelectronics Technology Co Ltd filed Critical Sichuan Jiuzhou Optoelectronics Technology Co Ltd
Priority to CN2011102035406A priority Critical patent/CN102331762B/en
Publication of CN102331762A publication Critical patent/CN102331762A/en
Application granted granted Critical
Publication of CN102331762B publication Critical patent/CN102331762B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Exchange Systems With Centralized Control (AREA)

Abstract

The invention discloses a control system implemented by a mode that a master station writes in addresses by RS-485 buses and a write-in method thereof. The control system comprises a master station and a plurality of extended stations, wherein the master station is connected with the plurality of extended stations by RS-485 buses, the master station is directly connected with one of the plurality of extended stations, a branch line between the master station and each extended station in a control circuit is provided with a relay, and the master station can emit commands to the extended stations by the RS-485 buses, so that each extended station controls the disconnection and connection of the relay thereof. Through enabling the branch line of each extended station in the controller system to be connected in series with a relay, according to the method disclosed by the invention, the master station in the control system can automatically write addresses into the extended stations just by using the existing RS-485 buses under the condition of not separately arranging an address line on each extended station, and can carry out modification on the control system by using the existing RS-485 buses; and the method is simple in operation, and can be widely popularized and used in the control field of RS-485 buses.

Description

Exchange writes the control method of address code through the RS-485 bus
Technical field
The present invention relates to the total line traffic control of RS-485 field, a kind of exchange of saying so more specifically writes the control system and the wiring method thereof of address through the RS-485 bus.
Background technology
In the total line traffic control of RS-485 field, when the main frame in the control system will be given the extension set transmitting control commands, need to write fixing address code to extension set earlier; Extension set could be discerned main frame and issue its instruction like this, link to each other with exchange and all be equipped with many extension sets in the general RS-485 bus control system, and every extension set all need write address code respectively and can not repeat; Therefore too much like the extension set in the control system; Main frame need expend the too much time when extension set writes address code, and the method that the most often adopts in the present total line traffic control of the RS-485 field is that manual work writes one by one, promptly with writing address code after writing yard device and extension set being connected through connecting line more one by one; Concrete method is earlier to set address code writing on yard device; Through connecting line address code is written to extension set again and is deposited in by the storer of extension set, or on extension set, adorn button, artificial touching the button writes address code; Yet aforesaid two kinds of methods all bother in practical application; And when work high above the ground, should not use more, and extension set need draw an address wire separately, also increased the complicacy of RS-485 bus control system.
Summary of the invention
The objective of the invention is to solve above-mentioned deficiency, a kind of exchange that provides exchange in a kind of RS-485 of making control system to write address code from the trend extension set writes the control system and the wiring method thereof of address through the RS-485 bus.
For solving above-mentioned technical matters, the present invention adopts following technical scheme:
A kind of RS-485 bus control system provided by the present invention; Comprise an exchange and many extension sets; Described exchange links to each other with many extension sets through the RS-485 bus; Wherein one of described exchange and many extension sets directly links to each other, and the branch line in the described control system between exchange and every the extension set is provided with a relay, and exchange can send instruction through the RS-485 bus breaks off with closed himself relay of extension set control.
The present invention also provides a kind of exchange to write the method for address code automatically to extension set through the RS-485 bus; This method is used for writing address code at an exchange to many extension sets; Exchange is connected to form control system through RS-485 bus and many extension sets, and described method is operated according to following steps:
Step 1, at first add a relay on the branch line before every extension set, and make all relays all be in closure state;
Step 2, after system powers on; Exchange sends the order that a preparation writes address code through the RS-485 bus to all extension sets; Extension set breaks off self affiliated relay after receiving this order, have only this moment an extension set to be connected with exchange through the RS-485 bus;
Step 3, exchange send the address code write command through the RS-485 bus to this extension set; Address code is preserved after writing and accomplishing, and through software control it is no longer changed, meanwhile; The relay closes of all extension sets is no longer broken off after writing the relay closes of extension set of address code;
Step 4, exchange send the order that a preparation writes address code through the RS-485 bus to all extension sets again; This moment is not except that the relay of the extension set that writes address code breaks off; The relay of all the other extension sets breaks off, this moment 1+N platform extension set through before write address code extension set be connected with exchange;
Step 5, exchange send the address code write command through the RS-485 bus to 1+N platform extension set; Address code is preserved after writing and accomplishing; And it is no longer changed through software control; Meanwhile, the relay closes of all extension sets, and no longer break off after writing the relay closes of the 1+N platform extension set after the address code.
Above-mentioned technical scheme further is: it is when system switches on that the address code that the software control exchange writes extension set no longer changes, and a zone bit is all arranged in the master routine in the system, and zone bit all is 0 when switching at every turn; This value can change through the data that serial ports is received, if serial ports is received the order of preparing to write address code, after program is judged; To become 1 to zone bit by 0; Get into and prepare the write address state,, then forbid writing the address if zone bit is 0.
Compared with prior art; The invention has the beneficial effects as follows: through serial connection one relay on every in the controller system extension set branch line, can make the exchange existing RS-485 bus capable of using in the control system, need not to be equipped with under the situation of address wire separately on the extension set through this method; Exchange just can write the address to extension set automatically; And existing RS-485 bus control system capable of using is reequiped, and method is simple to operate, can in the total line traffic control of RS-485 field, extensively promote the use of.
Description of drawings
Fig. 1 is the RS-485 control system figure of the embodiment of the invention 1;
Fig. 2 is the operating process block diagram of the embodiment of the invention 2.
Embodiment
Below in conjunction with accompanying drawing the present invention is done further elaboration.
Embodiment one
The first embodiment of the present invention is a kind of RS-485 bus control system; It comprises an exchange and many extension sets, and is as shown in Figure 1, and described exchange links to each other with many extension sets through the RS-485 bus; Wherein one of described exchange and many extension sets directly links to each other; And this extension set is connected with the form that other extension set is series connection, and the branch line in the described control circuit between exchange and every the extension set is provided with a relay, and exchange can send instruction through the RS-485 bus breaks off with closed himself relay of extension set control; And write the address to each extension set successively, write the relay under it of extension set behind the address and be kept closed.
Embodiment two
It among this embodiment of the present invention a kind of exchange writes address code automatically to extension set through the RS-485 bus method; This method is used for writing address code at an exchange to many extension sets; Exchange is connected to form control system through RS-485 bus and many extension sets, and described method is operated according to following steps:
Step 1, at first add a relay on the branch line before every extension set, and make all relays all be in closure state;
Step 2, after system powers on; Exchange sends the order that a preparation writes address code through the RS-485 bus to all extension sets; Extension set breaks off self affiliated relay after receiving this order, have only this moment an extension set to be connected with exchange through the RS-485 bus;
Step 3, exchange send the address code write command through the RS-485 bus to this extension set; Address code is preserved after writing and accomplishing, and through software control it is no longer changed, meanwhile; The relay closes of all extension sets is no longer broken off after writing the relay closes of extension set of address code;
Step 4, exchange send the order that a preparation writes address code through the RS-485 bus to all extension sets again; This moment is not except that the relay of the extension set that writes address code breaks off; The relay of all the other extension sets breaks off, this moment 1+N platform extension set through before write address code extension set be connected with exchange;
Step 5, exchange send the address code write command through the RS-485 bus to 1+N platform extension set; Address code is preserved after writing and accomplishing; And it is no longer changed through software control; Meanwhile, the relay closes of all extension sets, and no longer break off after writing the relay closes of the 1+N platform extension set after the address code.
Above-mentioned pass through the address code that the software control exchange writes extension set and no longer change, preferentially adopt following scheme to realize: when system powered on, the extension set in the system all had a zone bit; And all be 0 when zone bit powers at every turn, this value can change through the data that serial ports is received, if serial ports is received the order of preparing to write address code; Program will become 1 to zone bit by 0 after judging, get into the write address state of preparing; If zone bit is 0, then forbid writing the address.
As shown in Figure 2; The immovable detailed process of extension address is: because after system powers on; Exchange begins that each extension set all hangs on the bus when extension set writes the address; Received the preparation writing address signal simultaneously,, got into the write address state of preparing so the zone bit of every extension set has all become 1 by 0 at this moment.When exchange sent the address code of first extension set through the RS-485 bus, this moment, first extension set received address code by serial ports, and whether the zone bit of single-chip microcomputer determining program the inside is 1 simultaneously; If be 1; Then deposit the address in EEROM, if be 0, address data not then.Will deposit the address code that serial ports is received in the EEROM the inside because the zone bit of extension set has been 1 after program is judged this moment, and and then program has changed the extension set zone bit into 0.And with the cut-off of this extension set, being connected this moment just has first and second two extension sets on the bus.When exchange sends address signal for the second time, owing to hang over first and second two extension sets that have on the bus, so two extension sets are received address signal simultaneously; When first extension set received address signal; Whether program judgement symbol position is 1, at this moment, because exchange sends address code for the first time and writes the address and accomplishes; The zone bit of first extension set has also changed 0 into, so program will not deposit address code in EEROM.At this moment because second extension set also received address signal; And judge whether this machine address code is 1, because second extension set zone bit has been 1, program will deposit address code in EEROM; And then also change this machine zone bit into 0 by program; Promptly accomplished first address and write work, then to the 3rd extension set, the 4th extension set, up to N platform extension set being write also principle completion thus of address with second extension set.Owing to be that the zone bit of N-1 platform all is 0 at every turn, so the extension address that is written into the address will can not change with the change of later address code to N platform extension set write address.

Claims (2)

1. an exchange writes the method for address code automatically to extension set through the RS-485 bus; This method is used for writing address code at an exchange to many extension sets; Exchange is connected to form control system through RS-485 bus and many extension sets, it is characterized in that: described method is operated according to following steps:
Step 1, at first add a relay on the branch line before every extension set, and make all relays all be in closure state;
Step 2, after system powers on; Exchange sends the order that a preparation writes address code through the RS-485 bus to all extension sets; Extension set breaks off self affiliated relay after receiving this order, have only this moment an extension set to be connected with exchange through the RS-485 bus;
Step 3, exchange send the address code write command through the RS-485 bus to this extension set; Address code is preserved after writing and accomplishing, and through software control it is no longer changed, meanwhile; The relay closes of all extension sets is no longer broken off after writing the relay closes of extension set of address code;
Step 4, exchange send the order that a preparation writes address code through the RS-485 bus to all extension sets again; This moment is not except that the relay of the extension set that writes address code breaks off; The relay of all the other extension sets breaks off, this moment 1+N platform extension set through before write address code extension set be connected with exchange;
Step 5, exchange send the address code write command through the RS-485 bus to 1+N platform extension set; Address code is preserved after writing and accomplishing; And it is no longer changed through software control; Meanwhile, the relay closes of all extension sets, and no longer break off after writing the relay closes of the 1+N platform extension set after the address code.
2. exchange according to claim 1 writes the method for address code through the RS-485 bus to extension set automatically, it is characterized in that: it is when system powers on that the address code that the software control exchange writes extension set no longer changes, and a zone bit is all arranged in the master routine in the system; And all be 0 when zone bit powers at every turn; This value can change through the data that serial ports is received, if serial ports is received the order of preparing to write address code, after program is judged; To become 1 to zone bit by 0; Get into and prepare the write address state,, then forbid writing the address if zone bit is 0.
CN2011102035406A 2011-07-20 2011-07-20 Control method for master station write-in of address codes by RS-485 buses Expired - Fee Related CN102331762B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN2011102035406A CN102331762B (en) 2011-07-20 2011-07-20 Control method for master station write-in of address codes by RS-485 buses

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN2011102035406A CN102331762B (en) 2011-07-20 2011-07-20 Control method for master station write-in of address codes by RS-485 buses

Publications (2)

Publication Number Publication Date
CN102331762A CN102331762A (en) 2012-01-25
CN102331762B true CN102331762B (en) 2012-12-05

Family

ID=45483567

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2011102035406A Expired - Fee Related CN102331762B (en) 2011-07-20 2011-07-20 Control method for master station write-in of address codes by RS-485 buses

Country Status (1)

Country Link
CN (1) CN102331762B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109756588A (en) * 2018-12-05 2019-05-14 国家电网有限公司 A kind of automatic distribution address system and method for RS485 communication
CN109800205B (en) * 2019-01-25 2023-02-03 北京鼎汉技术集团股份有限公司 System and method for automatically setting ID number of subway platform door
CN116132218A (en) * 2023-03-30 2023-05-16 杭州协能科技股份有限公司 Communication system of master machine and multi-slave machine and communication method thereof

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101021728A (en) * 2006-04-30 2007-08-22 上海复展照明科技有限公司 Automatic addressing method for distributing multi processor light-emitting diode control system
KR20090099892A (en) * 2008-03-19 2009-09-23 최종술 Control system of guard lamp
CN201789667U (en) * 2010-09-06 2011-04-06 杭州罗莱迪思照明系统有限公司 Intelligent light-emitting diode (LED) lamp controller

Also Published As

Publication number Publication date
CN102331762A (en) 2012-01-25

Similar Documents

Publication Publication Date Title
CN102331762B (en) Control method for master station write-in of address codes by RS-485 buses
CA3068713C (en) System and method for remotely locating communication error support for hydraulic supports
CN101170859A (en) A control method for cross-linked radio relay delivery road lamp
CN108468543B (en) Cooperative control method and system for fully-mechanized mining face and two-lane equipment
CN102501862B (en) Network with vehicle-mounted display screen as core
CN104954046B (en) A kind of transmission method and device based on power line communication
WO2022000969A1 (en) Link device and link device communication address configuration method
CN202583779U (en) Embedded automatic switching control device
CN104291197B (en) Knapsack elevator switch accelerator control system and method
CN105978718A (en) Refrigerator and signal connection error report method and system of WiFi refrigerator
CN203241812U (en) Configurable switch
CN102739489A (en) Method for quickly querying equipment state of synchronous bus
CN105187274A (en) Method for judging port state and selecting good port communication
CN202073565U (en) Mine-used integral solenoid valve
CN204290960U (en) Based on a pair multiple spot full-duplex communication device of RS-232C agreement
CN109839862B (en) Ocean nuclear power platform electromagnetic valve control circuit, control device and control method
CN205638881U (en) Water supply control ware based on CAN bus
CN106413027B (en) Wireless networking method for primary relay
CN111092799A (en) Automatic ID setting method applied to battery management system BMS
CN109671256A (en) A kind of general AGV control handle
CN110390823A (en) A kind of semaphore and Signalized control method
CN103996275A (en) Communication device and method based on streetlamp control system
CN106054800A (en) PLC remote monitoring system
CN104932290A (en) Sheet production machine control system and control method
CN103605481B (en) Magnetic disc control method, device and equipment

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
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20121205

Termination date: 20150720

EXPY Termination of patent right or utility model