The content of the invention
Based on this, it is necessary to provide a kind of device address collocation method in communication system, device and system, can realize
Efficiently slave unit is configured in communication system.
A kind of device address collocation method in communication system, including:
Whether current device has equipment access according to signal detection in place;
When having detected equipment access, address is distributed for the equipment of access;
The address information of distribution is sent to the equipment of access, and by the access information and ground of the equipment of access
Location information reporting is to monitoring main equipment.
It is in one of the embodiments, described when having detected equipment access if current device is monitoring main equipment,
The step of distributing address for the equipment of access includes:
When having detected equipment access, the address for the equipment distribution of access is complete zero.
In one of the embodiments, it is described to have detected equipment access if current device is non-supervised main equipment
When, the step of distributing address for the equipment of access includes:
When having detected equipment access, address is distributed for the equipment of access according to the address of current device itself.
In one of the embodiments, the address distributed for the equipment of access is the Self address+1 of current device.
In one of the embodiments, in addition to:
Whether removed according to the equipment that signal detection in place is accessed;
When the equipment for detecting access is removed, information reporting will be removed to monitoring main equipment;The removal information includes
The address information of the equipment of removal.
A kind of device address configuration device in communication system, including:
Detection module, for whether having equipment access according to signal detection in place;
Distribute module, for when the detection module has detected equipment access, address to be distributed for the equipment of access;
Communication module, for the address information of distribution to be sent to the equipment of access, and by the equipment of access
Access information and address information report to monitoring main equipment.
In one of the embodiments, in addition to monitoring module,
The monitoring module, is monitored for the equipment at different levels to access;
The distribute module, when the detection module has detected equipment access, for the address of the equipment distribution of access
For complete zero.
In one of the embodiments, the distribute module, when the detection module has detected equipment access, according to
Address is distributed in the address of current device itself for the equipment of access.
In one of the embodiments, the detection module, be additionally operable to according to signal detection in place access equipment whether
Remove;
The communication module, is additionally operable to, when the equipment that the detection module detects access is removed, to remove in information
Report extremely monitoring main equipment;It is described to remove the address information that information includes the equipment of removal.
A kind of device address configuration system in communication system, including:Monitor main equipment, slave unit and bridge joint cable, prison
Control main equipment and slave unit at different levels are connected by bridging cable using star-like or daisy chain type;
The monitoring main equipment, for when having detected slave unit access, the slave unit to access to distribute address, and will
The address information of distribution is sent to the slave unit of access;
The slave unit, for when detected next stage slave unit access when, according to the address of itself be next stage from
Equipment distributes address, and the address information of distribution is sent to next stage slave unit, is additionally operable to the access of next stage slave unit
State and address information report to monitoring main equipment.
Device address collocation method in above-mentioned communication system, because the address of slave unit is in access current device
Afterwards, address is distributed to the equipment of access by current device, can realizes in communication system to be automatically slave unit distribution address, and nothing
Need to manually it be pre-configured with, efficiency high.
Embodiment
System is configured there is provided the device address in a kind of communication system in one embodiment, as shown in figure 1, including prison
Control main equipment 102, slave unit 104 and bridge joint cable, monitoring main equipment and slave unit at different levels by bridge cable using star-like or
Daisy chain type is connected.Data/address bus in one embodiment can use RS485 buses.
The monitoring main equipment 102, for when having detected slave unit access, to the slave unit distribution address of access,
And send the address information of distribution to the slave unit of access.
The slave unit 104, for being next stage according to the address of itself when having detected the access of next stage slave unit
Slave unit distributes address, and the address information of distribution is sent to next stage slave unit, is additionally operable to connecing next stage slave unit
Enter state and address information reports to monitoring main equipment 102.
As shown in figure 1, monitoring main equipment has subtending port (Next), slave unit has subtending port (Next) and resource
Interface (Source).Monitoring main equipment subtending port be connected by bus with the resource interface of first order slave unit, N grades from
The subtending port of equipment is connected by bus with the resource interface of N+1 grades of slave units.It should be appreciated that in a communication system
In system, monitoring main equipment it is identical with resource interface with the subtending port of slave units at different levels, i.e., in communication system monitor main equipment and
The interface of slave unit is unified, between each slave unit it is alternative can cross-reference, consequently facilitating equipment development and engineering maintenance.
Meanwhile, in view of the requirement of cable versatility, in a particular embodiment, data/address bus may be selected the most commonly used
Straight-through network cables realize that engineering practicability is strong, and each subtending port and resource interface are accordingly communication from Ethernet interface
Interface, because controlling bus traffic rate is relatively low, and intersystem communications distance will not be too remote, it is therefore proposed that selection becomes without isolation
The Ethernet interface of depressor.Star-like or daisy chain type may be selected in the access way of monitoring main equipment and slave unit.
In one embodiment, monitoring main equipment and each interface of slave unit are unified, including address wire pin ADDR1 and
ADDR2, detection pin DI in place.In a kind of specific embodiment, the line sequence definition such as table 1 of the bus for connecting each interface
It is shown.
The line sequence definition of the bus of table 1
Line sequence |
Definition |
Explanation |
1 |
RM_A |
Slave unit 485A |
2 |
RM_B |
Slave unit 485B |
3 |
N/A |
It is reserved |
4 |
GND |
Publicly |
5 |
SLAVE_ADDR2 |
Slave unit address 2 |
6 |
N/A |
It is reserved |
7 |
SLAVE_DI |
Slave unit is detected in place |
8 |
SLAVE_ADDR1 |
Slave unit address 1 |
Wherein, the line of each sequence number of bus and each pin of interface are corresponding, and line 1 and line 2 can constitute twisted-pair feeder and do independent
RS485 buses, are used as master-slave equipment communication bus.Line 3 and line 6 are used as reserving, available for equipment remote communication bus or expansion
Slave unit address bit etc..The joint of bridge joint cable corresponding with Bus Wire sequence also requires that unification.In a specific embodiment
In, cable connector is RJ-45 connectors, i.e. " crystal head ".Cable can carry out length adjustment according to the practical engineering application of equipment,
Engineer applied is convenient and swift, stability is high.
In one embodiment, the structural representation for monitoring the subtending port of main equipment is as shown in Figure 2.Monitor the level of main equipment
The address wire pin of connecting port is by pull down resistor, and acquiescence level is low level.Specifically, real by 56 Europe resistance strong pull-downs
It is existing.Detection pin in place is defaulted as high level by pull-up resistor, specifically, being realized by the resistance weak pull-up of 10K Europe.
In one embodiment, the structural representation of the subtending port of slave unit is as shown in Figure 3.The subtending port of slave unit
Address wire pin and detection pin in place are pulled up by resistance, and acquiescence level is high level.Specifically, weak by 10K Europe resistance
Pull-up is realized.
In one embodiment, the structural representation of the resource interface of slave unit is as shown in figure 4, the resource interface of slave unit
Address wire pin and detection pin in place by resistive pull-downs, acquiescence level is low level.Wherein, address wire pin passes through
The resistance weak pull-down of 10K Europe realizes that detection pin in place is realized by 56 Europe resistance strong pull-downs.
When slave unit access monitoring main equipment, low level 0 is provided by the detection pin in place of its resource interface, monitored
The level signal of the detection pin in place of the subtending port of main equipment switchs to low level by the high level given tacit consent to, and monitors main equipment root
Change according to the level signal of the detection pin in place of its subtending port judges whether to have accessed slave unit.When next stage slave unit
When accessing upper level slave unit, low level 0, the cascade of upper level slave unit are provided by the detection pin in place of its resource interface
The level signal of the detection pin in place of interface switchs to low level by the high level given tacit consent to, and upper level slave unit couples according to its level
The change of the level signal of the detection pin in place of mouth judges whether to have accessed slave unit.
It is access from setting by the address wire pin of its subtending port when monitoring main equipment detection and having slave unit access
The address that back-up is matched somebody with somebody is complete zero, for example, address the wire pin ADDR1 and ADDR2 of subtending port are passed through hardware by monitoring main equipment
Circuit directly controls to be low level.Slave unit receives corresponding level signal by the address wire of its resource interface, and acquisition is divided
The address information matched somebody with somebody.
It should be appreciated that when the detection pin in place that slave unit detects its subtending port is high level, illustrating it
For the afterbody of link, behind be not connected to next stage slave unit.When the detection in place that slave unit detects its subtending port is drawn
When pin switchs to high level by low level, illustrate that next stage slave unit is removed, then will remove information reporting to main equipment is monitored, remove
Information includes the address information of next stage slave unit, and monitoring main equipment removes the control to the slave unit, it is ensured that system it is complete
Property.
It is access by the address wire pin of its subtending port when slave unit has detected the access of next stage slave unit
The address of next stage slave unit distribution is Self address+1.For example, first order slave unit has detected the access of next stage slave unit
When, it is 0,1 by two address wire pin ADDR1 and ADDR2 difference set of its subtending port.Second level slave unit has been detected
It is 1,0 by two address wire pin ADDR1 and ADDR2 difference set of its subtending port when next stage slave unit is accessed.It is other
The rest may be inferred for the address wire pin of interface.
Device address configuration system in above-mentioned communication system, because the address of slave unit is to monitor main equipment in access
Or after access upper level slave unit, distributed by monitoring main equipment or distributed according to the address of upper level slave unit, can be realized logical
Address, without being manually pre-configured with, efficiency high are distributed in letter system automatically for slave unit.Meanwhile, monitoring main equipment and from setting
The standby and communication mode between slave unit and next stage slave unit is simple, and monitoring main equipment is merely responsible for matching somebody with somebody for first order slave unit
Situation detection is put, the configuring condition detection of next stage slave unit is also merely responsible for per one-level slave unit, testing result is set by principal and subordinate
Standby communication interaction is influenceed smaller during configuring to main equipment, networking is monitored by environmental factor, and stability is high.
In one embodiment there is provided the device address collocation method in a kind of communication system, the monitoring master in Fig. 5 is applied
In equipment 102 or slave unit.As shown in fig. 6, this method comprises the following steps:
S502:Whether current device has equipment access according to signal detection in place.
Specifically, monitoring main equipment or slave unit detect that the level signal of pin is determined whether in place according to subtending port
Equipment is accessed.After slave unit accesses upper level equipment, low level signal is sent by the detection pin in place of its resource interface
To the detection pin in place of the subtending port of monitoring main equipment, the detection pin in place of upper level equipment switchs to low electricity by high level
It is flat.Upper level equipment can be monitoring main equipment, or slave unit.
S504:When having detected equipment access, address is distributed for the equipment of access.
If current device is monitoring main equipment, when having detected equipment access, the address for the equipment distribution of access is
Complete zero.Specifically, when having detected equipment access, address the wire pin ADDR1 and ADDR2 of its subtending port are set to initially
Level 0,0, and level signal is sent to the address wire pin of the resource interface of slave unit 1 by data/address bus.Specifically
Location is relevant with the address wire pin of interface.For example, when using address wire pin for two, the address of first order slave unit is
0.0, when using address wire pin for four, the address of first order slave unit is 0.0.0.0.
It is access according to the address of current device itself if current device is slave unit, when having detected equipment access
Equipment distribution address, specifically, when having detected equipment access, the address wire pin of its subtending port is set to corresponding
Level thinks the slave unit distribution address of access.Specifically, the address for being the equipment distribution of access is itself ground of current device
Location+1.For example, the address of first order slave unit is 0.0, then the address distributed for second level slave unit is 0.1.In another example, first
The address of level slave unit is 0.0.0.0, then the address distributed for second level slave unit is 0.0.0.1, other grades of slave unit
The rest may be inferred for address.
S506:The address information of distribution is sent to the equipment of access, and by the access shape of the equipment of access
State and address information report to monitoring main equipment.In the present embodiment, when the next stage slave unit that slave unit detects access is removed
When, information reporting will be removed to main equipment is monitored, the control to the slave unit of removal is got rid of by monitoring main equipment, it is ensured that system
Integrality.
Device address collocation method in above-mentioned communication system, because the address of slave unit is in access current device
Afterwards, address is distributed to the equipment of access by current device, can realizes in communication system to be automatically slave unit distribution address, and nothing
Need to manually it be pre-configured with, efficiency high.Meanwhile, the communication mode of monitoring main equipment and slave unit is simple, and monitoring main equipment is merely responsible for
The configuring condition detection of first order slave unit, the configuring condition detection of next stage slave unit, inspection are also merely responsible for per one-level slave unit
Survey result is influenceed smaller during configuring to main equipment, networking is monitored by master-slave equipment communication interaction by environmental factor,
Stability is high.
In one embodiment there is provided the device address configuration device in a kind of communication system, as shown in fig. 6, including:
Detection module 602, for whether having equipment access according to signal detection in place.
Distribute module 604, for when the detection module has detected equipment access, for access equipment distributively
Location.
Communication module 606, for the address information of distribution to be sent to the equipment of access, and will set described in access
Standby access state and address information reports to monitoring main equipment.
In another embodiment, in addition to monitoring module, it is monitored for the equipment at different levels to access.
The distribute module 604, when the detection module has detected equipment access, for the ground of the equipment distribution of access
Location is complete zero.
Device address configuration device in communication system in the embodiment, is arranged in monitoring main equipment.
In another embodiment, the distribute module 604, when the detection module has detected equipment access, root
According to the address of current device itself address is distributed for the equipment of access.Specifically, being that the address of the equipment distribution of access is current
The Self address+1 of equipment.Device address configuration device in communication system in the embodiment, equipment is in slave unit.
In yet another embodiment, the detection module 602, be additionally operable to according to signal detection in place access equipment whether
Remove.The communication module 606, is additionally operable to, when the equipment that the detection module detects access is removed, to remove in information
Report extremely monitoring main equipment;It is described to remove the address information that information includes the equipment of removal.
Device address configuration device in above-mentioned communication system, because the address of slave unit is in access current device
Afterwards, address is distributed to the equipment of access by current device, can realizes in communication system to be automatically slave unit distribution address, and nothing
Need to manually it be pre-configured with, efficiency high.Meanwhile, the communication mode of monitoring main equipment and slave unit is simple, and monitoring main equipment is merely responsible for
The configuring condition detection of first order slave unit, the configuring condition detection of next stage slave unit, inspection are also merely responsible for per one-level slave unit
Survey result is influenceed smaller during configuring to main equipment, networking is monitored by master-slave equipment communication interaction by environmental factor,
Stability is high.
In one embodiment there is provided a kind of communication system for monitoring main equipment and slave unit, as shown in fig. 7, the system
Including the monitoring main equipment by using the connection of star-like or daisy chain type, slave unit 1 to slave unit 4.Its course of work is as follows:
Step 1:The detection pin high level in place for monitoring the subtending port of main equipment is converted to low level, detects access
Slave unit 1, original levels 0,0 are set to by address the wire pin ADDR1 and ADDR2 of its subtending port.
Specifically, during the access monitoring main equipment of slave unit 1, low level is sent by the detection pin in place of its resource interface
Signal extremely monitors the detection pin in place of the subtending port of main equipment, and the detection pin in place of monitoring main equipment is switched to by high level
Low level.Meanwhile, address the wire pin ADDR1 and ADDR2 of its subtending port are set to original levels 0 by monitoring main equipment, and 0, and
Level signal is sent to the address wire pin of the resource interface of slave unit 1 by bridging cable.
Step 2:Slave unit 1 receives allocated address information by the address wire pin of its resource interface.Slave unit 1
The detection pin in place of subtending port is converted to low level by high level, access slave unit 2 is detected, by the ground of its subtending port
Wire pin ADDR1 and ADDR2 are set to 0,1 for location.
Step 3:Slave unit 2 receives allocated address information by the address wire pin of its resource interface.Slave unit 2
The detection pin in place of subtending port is converted to low level by high level, access slave unit 3 is detected, by the ground of its subtending port
Wire pin ADDR1 and ADDR2 are set to 1,0 for location.
Step 4:Slave unit 3 receives allocated address information by the address wire pin of its resource interface.Slave unit 3
The detection pin in place of subtending port is converted to low level by high level, access slave unit 4 is detected, by the ground of its subtending port
Wire pin ADDR1 and ADDR2 are set to 1,1 for location.
Step 5:Slave unit 4 receives allocated address information by the address wire pin of its resource interface.Slave unit 4
The detection pin in place of subtending port be high level, illustrate its be link afterbody, behind do not access other slave units.
In one embodiment there is provided a kind of communication system for monitoring main equipment and slave unit, as shown in figure 8, the system
Including the monitoring main equipment using the connection of star-like or daisy chain type, slave unit 1 to slave unit 16.The present embodiment and a upper embodiment
Difference be that in the present embodiment, the address wire pin of each interface includes 4, be ADDR1 to ADDR4, corresponding data/address bus
In address wire have 4, the address wire pin of interface has 4.In the present embodiment, monitoring main equipment is what slave unit 1 was distributed
Address is 0,0,0,0, and slave unit 1 is that the address that slave unit 2 is distributed is 0,0,0,1, and slave unit 2 is the address that slave unit 3 is distributed
For 0,0,1,0, the rest may be inferred for the address distribution of other slave units, no longer points out one by one herein.In the present embodiment, each interface has
4 address wire pins, the tandem node maximum of slave unit is up to 16 grades.
Each technical characteristic of embodiment described above can be combined arbitrarily, to make description succinct, not to above-mentioned reality
Apply all possible combination of each technical characteristic in example to be all described, as long as however, the combination of these technical characteristics is not deposited
In contradiction, the scope of this specification record is all considered to be.
Embodiment described above only expresses the several embodiments of the present invention, and it describes more specific and detailed, but simultaneously
Can not therefore it be construed as limiting the scope of the patent.It should be pointed out that coming for one of ordinary skill in the art
Say, without departing from the inventive concept of the premise, various modifications and improvements can be made, these belong to the protection of the present invention
Scope.Therefore, the protection domain of patent of the present invention should be determined by the appended claims.