WO2012167736A1 - 主从式现场总线中从机地址顺序识别的方法及系统 - Google Patents
主从式现场总线中从机地址顺序识别的方法及系统 Download PDFInfo
- Publication number
- WO2012167736A1 WO2012167736A1 PCT/CN2012/076591 CN2012076591W WO2012167736A1 WO 2012167736 A1 WO2012167736 A1 WO 2012167736A1 CN 2012076591 W CN2012076591 W CN 2012076591W WO 2012167736 A1 WO2012167736 A1 WO 2012167736A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- slave
- bus
- voltage
- voltage value
- address
- 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.)
- Ceased
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/50—Address allocation
- H04L61/5038—Address allocation for local use, e.g. in LAN or USB networks, or in a controller area network [CAN]
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L61/00—Network arrangements, protocols or services for addressing or naming
- H04L61/50—Address allocation
- H04L61/5046—Resolving address allocation conflicts; Testing of addresses
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/28—Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
- H04L12/40—Bus networks
- H04L2012/40208—Bus networks characterized by the use of a particular bus standard
- H04L2012/40215—Controller Area Network CAN
Definitions
- Microprocessor-based embedded systems are increasingly widely used.
- On-site networking and management of devices has also become a focus of embedded applications. Users can configure, manage, and monitor the intelligent interfaces provided by the device, such as serial ports, parallel ports, and Ethernet ports.
- the high-speed Ethernet interface based on the complex TCP/IP protocol is the future development direction, and realizes rich monitoring and management functions.
- most embedded devices currently use an 8-, 16- or 32-bit MCU to form an inexpensive system.
- the fieldbus such as RS485 bus, CAN bus, etc., is used to implement the site.
- Device level LAN communication Most of them are managed by a master-slave fieldbus, that is, an embedded device (called a host) can monitor other embedded devices (called slaves).
- Chip select signal line set the address for each slave through the host. For example, the host first enables the chip selection of the first slave, and sets the slave's address to 1 (other slaves do not respond to the setup command because the chip select signal is invalid), and then set the addresses of other slaves in turn.
- This method is relatively simple, but it is necessary to add a plurality of signal lines, especially when there are many devices in the network, and there are many signal lines to be added, which is not applicable in many occasions.
- a more feasible method is to add a pair of signal lines, each of which is cascaded by a controllable connection device, such as a DSDT (double-pole double-throw) switch or relay.
- a controllable connection device such as a DSDT (double-pole double-throw) switch or relay.
- DSDT double-pole double-throw
- the reliability is not high, and the entire serial loop is broken, and the addresses can only be sequentially identified. It is not known about the vacancy slot (the slave is not in position). Summary of the invention
- the master control slave outputs a preset voltage to the SVB bus, and resets the address of each slave by detecting the voltage value of each slave:
- the slave that specifies any voltage value of 0 outputs the preset voltage to the SVB bus and returns to step (c).
- the slave that specifies the ID outputs the preset voltage to the SVB bus, including: sending, by using a field communication bus, a control signal to a control switch of the slave corresponding to the any ID, by using the control switch Pass the voltage output of the slave to the SVB bus.
- the voltage value of the detecting local end is:
- the voltage value of the local terminal is detected by the A/D detection circuit.
- the obtaining, according to the voltage value and the ID, the correspondence between the ID and the address of the slave whose voltage value is not 0, and obtaining the address of the slave includes:
- the present invention also provides a system for sequentially identifying slave addresses in a master-slave field bus, including a host, at least one slave, and an S VB bus, wherein
- the S VB bus is set as: a serial master and a slave, and each of the slaves is connected in series with at least one diode through the S VB bus;
- the host is set to: when the slave address conflicts or the new slave joins, the slave slave outputs a preset voltage to the SVB bus, and resets the address of each slave by detecting the voltage value of each slave.
- the host includes:
- Get the ID module set to: Get the IDs of all the slaves;
- Specify a module set to: specify the slave of any ID to output the preset voltage to the SVB bus;
- the loop module is set to: when there is a slave with a voltage value of 0, the slave that specifies any voltage value of 0 outputs the preset voltage to the SVB bus, and returns to the detection module to detect the voltage value of the local end, and simultaneously The voltage value and ID of each slave detected and reported by each slave are received.
- the specifying module is set to: A control signal is sent through the field communication bus to a control switch of the slave corresponding to any one of the IDs, and the voltage output terminal of the slave and the SVB bus are turned on by the control switch.
- the detecting module is configured to:
- the voltage value of the local terminal is detected by the A/D detection circuit.
- the acquiring an address module includes:
- the calculation unit is configured to: respectively calculate a voltage difference between the voltage value of the host and the voltage value of each slave; the determining unit is configured to: determine the slot number of each slave according to the voltage difference and the voltage drop of the diode ;
- the method and system for sequentially identifying the slave address in the master-slave field bus solves the problem of bus conflict or identification error caused by the address loss in the field bus network, and only two are added. In the case of a root transmission signal line and a small amount of hardware, the resetting and identification of each slave address is completed, and the normal communication of the field bus is ensured. In addition, it can also realize free expansion of the machine, automatic identification when input, and improve the intelligence of the monitoring system.
- FIG. 1 is a schematic flowchart of a method for sequentially identifying a slave address in a master-slave field bus according to the present invention
- FIG. 2 is a schematic diagram of a method for sequentially identifying a slave address in a master-slave field bus according to the present invention - a flow chart of a step of setting a slave address by a host in an embodiment;
- FIG. 3 is a schematic diagram of a method for sequentially identifying a slave address in a master-slave field bus according to the present invention - a flow chart of obtaining an address in an embodiment
- FIG. 5 is a method for sequentially identifying a slave address in a master-slave field bus according to the present invention - a field bus layout diagram of a rectifier in an embodiment
- FIG. 8 is a schematic structural diagram of obtaining an address module in an embodiment of a system for sequentially identifying slave addresses in a master-slave field bus of the present invention.
- Step S10 setting a Socket Voltage Bus (SVB) bus for serially connecting the master and the slave, and connecting at least one diode in series through the S VB bus between the slaves;
- SVB Socket Voltage Bus
- the slaves are connected in series by diodes.
- the host finds that the slave address conflicts or the slave address needs to be reset, the host notifies a specified slave through the field bus to output voltage on the SVB bus; due to the diode single-pass and forward voltage drop fixed characteristics, all The slaves in different slots detect a specific, different voltage amplitude from the SVB to distinguish the slot and reset the slave address.
- Step S1 l when the slave address conflicts or the new slave joins, the host controls the slave to output a preset voltage to the SVB bus, and resets the address of each slave by detecting the voltage value of each slave.
- step S11 further includes:
- Step S114 Obtain a correspondence between an ID and an address of a slave whose voltage value is not 0 according to the voltage values of the master and the slave, to obtain an address of the slave;
- Step S115 When there is a slave whose voltage value is 0, the slave that specifies any voltage value of 0 outputs the preset voltage to the SVB bus, and returns to step S113, otherwise, the flow ends.
- the host also detects the voltage value on the SVB bus through the A/D detection circuit.
- the host can determine the slot number of each slave.
- the host informs the slave to exit the "slot identification" state via the field communication bus, and the slave turns off the output voltage to the SVB bus.
- the host can obtain the slot of each slave according to the detected SVB voltage value reported by the slaves of each ID number.
- the first slave detects the SVB voltage value. It should be the same as the voltage detected by the host; the second slave detects that the SVB voltage drops by about 0.7V (silicon tube, ⁇ tube is about 0.3V), and so on.
- the host sets the address and slot number of each slave to match the order of the addresses.
- the characteristics of the unidirectional conduction and the forward voltage drop of the diode are applied, and the serial identification of the slots is skillfully realized by connecting the diodes in series, thereby solving the phenomenon that the slot and the address are not matched, and facilitating on-site maintenance and overhaul. , completely solved the defect of the random change of the address caused by the automatic competition of the slave.
- the address setting is implemented. This embodiment implements full automatic setting, which does not require manual participation, and avoids common problems such as address duplication and address/slot mismatch caused by manual negligence.
- this embodiment is low in cost and easy to implement.
- the standard RJ45, RJ11 and other connectors can be used, which is low in cost.
- the slave only adds one or more diodes on the backplane (such as the commonly used IN4002), a controllable device.
- a voltage detection circuit of the SVB bus the controllable device can use commonly used relays, thyristors, BJTs, MOSFETs, IGBTs, etc., and the voltage detection circuit usually has A/D function due to the slave, therefore, it is only necessary to reuse the A /D can be.
- the embodiment is highly adaptable.
- the diode on each SVB bus has a typical voltage drop of 0.7V (silicon tube).
- the rectifier output voltage is increased to 56.4V or the other diodes with a low forward voltage drop (0.3V), it can support a larger capacity (more nodes) power supply system with better scalability.
- the power system consists of AC power distribution, DC power distribution, up to 40 rectifiers (as slaves) and one monitoring unit (as a host). Due to power density requirements, cost pressure, and plug-and-play requirements for rectifiers, there are no other human-machine interaction devices other than the alarm indicator and CAN interface. Therefore, the monitoring unit needs to communicate with the 40 rectifiers through the CAN bus, and distinguish and identify each rectifier by address, so that the monitoring unit polls and acquires the data of each rectifier and reports Alarm information, and control the operating state of the rectifier.
- Each rectifier has a 53.5V DC output, and a relay is added to control the enable output to the SVB-V line.
- an A/D detection circuit is added to detect the voltage amplitude on the SVB-V line.
- the A/D detection circuit can be conditioned by an op amp and sent to the A/D detection circuit that is included in the rectifier.
- the monitoring unit adds an A/D detection circuit to detect the A/D detection circuit of the band on the SVB-V line, and uses the resistance of the conditioning circuit to form an SVB circuit. Select the appropriate conditioning circuit resistor to ensure that all diodes are conductive throughout the full voltage range. Assuming that the diode is fully energized with a minimum current of 5 mA and the system is configured with a maximum of 40 rectifiers, the resistance is less than (53.5-0.7 x 39)/5, which is 5.2 ⁇ . Of course, the smaller the resistance selection, the larger the current flowing through the diode, but the more power consumption of the loss system. Therefore, it is recommended to select the upper limit of the resistance value, such as 5 ⁇ .
- the monitoring unit or rectifier recognizes that there is a rectifier address conflict on the CAN bus, or there is a new rectifier input, and the process of restarting the rectifier address is as follows:
- the monitoring unit receives the IDs of all rectifier responses, and thereby knows the number of rectifiers in the current network; (4) The monitoring unit issues an instruction through the CAN bus, and specifies that the rectifier of any ID number enters the "slot identification"state;
- the rectifier of this ID enters the "slot identification" state, and outputs a voltage value of 53.5V to the SVB bus;
- the SVB bus 30 is used for connecting the host 10 and the slave 20, and each of the slaves 20 is connected in series with at least one diode through the SVB bus 30;
- the specifying module 12 is configured to specify the slave device 20 of any ID to output the preset voltage to the SVB bus 30;
- the detecting module 13 is configured to detect the voltage value of the local end, and simultaneously receive the voltage value and ID of each slave 20 detected and reported by each slave 20;
- the loop module 15 is configured to: when there is a slave 20 having a voltage value of 0, the slave 20 that specifies any voltage value of 0 outputs the preset voltage to the SVB bus 30, and returns to detect the voltage of the local terminal through the detecting module. The value simultaneously receives the voltage value and ID of each slave 20 detected and reported by each slave 20.
- a control signal is sent through the field communication bus to a control switch of the slave 20 corresponding to any of the IDs, and the voltage output of the slave 20 and the SVB bus 30 are turned on by the control switch.
- the detecting module 13 is specifically configured to:
- the voltage value of the local terminal is detected by the A/D detection circuit.
- the obtaining address module 14 includes:
- the calculating unit 141 is configured to separately calculate a voltage difference between the voltage value of the host 10 and the voltage value of each slave 20;
- the determining unit 142 is configured to determine, according to the voltage difference and the voltage drop of the diode, the slot number of each of the slaves 20;
- the setting unit 143 is configured to set the slot number to correspond to the address of the slave 20.
- Fieldbus communication cables are generally available with twisted pair cables.
- a pair of cables for convenience, referred to as SVB bus
- the cable can be a normal cable or a twisted pair cable. If the fieldbus uses RS485 bus or CAN bus, it needs to use at least 4-wire (2 pairs) twisted pair cable; if you use RS422 bus, you need to use at least 6-wire (3 pairs) twisted pair cable.
- the field bus wiring can use the serial address allocation mode.
- the host 10 is located at one end of the field communication bus.
- the slave 20 that is closest to the host 10 is the first slot, and is connected in sequence.
- the slave 20 slot farthest from the host 10 is located.
- the number is the largest, connected in series at the end of the bus.
- the method of using the field communication bus is not changed, and is used for normal communication between the host 10 and the slave 20 to implement system monitoring.
- a new SVB bus 30 is provided for serially connecting the host 10 and the slave 20, and the pair of SVB buses 30 are defined as a common ground line SVB-G and a voltage signal line SVB-V.
- Each of the slaves 20 needs to be connected in series with the SVB-V.
- the number of diodes is set to one or more as needed. After the voltage is passed through the diode, a stable voltage drop is obtained to ensure the slave position in each slot.
- the machine 20 can detect different voltage values, thereby determining different slot numbers by different voltage values, and then setting the slot number where the slave 20 is located to the address of the slave 20, and the SVB bus 30 forms a loop through the host 10. .
- the acquisition ID module 11 issues an instruction through an existing field communication bus, such as a CAN bus, an RS485 bus, an RS422 bus, etc., and requires all slaves 20 to report the unique identification ID of the machine.
- an existing field communication bus such as a CAN bus, an RS485 bus, an RS422 bus, etc.
- Each slave 20 informs the acquisition ID module 11 of the ID of the slave 20 via the field communication bus.
- the acquisition ID module 11 For the CAN network, it can implement collision detection itself. Therefore, it is notified that the ID will not have any problem.
- networks such as RS485 and RS422 it is also possible to inform the acquisition ID module 11 by a simple time avoidance algorithm by using different ID numbers. ID.
- the acquisition ID module 11 receives all the IDs fed back from the slave 20, and thereby knows the number of slaves 20 in the current network.
- the slave 20 entering the "slot identification" state outputs a certain voltage to the control terminal.
- All slaves 20 detect the voltage value on the SVB bus 30 through the A/D detection circuit, which also includes the slave 20 that enters the "slot identification" state and outputs the voltage.
- the detection module 13 also detects the voltage value on the SVB bus 30 through the A/D detection circuit. (7) All slaves 20 sequentially send the detected voltage values on the SVB bus 30 to the detection module 13 via the field communication bus.
- the acquisition address module 14 can determine the slot number of each slave 20.
- the loop module 15 If the loop module 15 detects that there is a reported slave 20 that detects that the SVB bus 30 has a voltage value of 0, then the slave 20 that specifies any ID number with a voltage value of 0 enters the "slot identification" through the field communication bus. status. And returning to the detection module 13 to detect the voltage value of the SVB bus, and receiving the voltage value and ID detected and reported by each slave 20 until the voltage value of the detected SVB bus 30 reported by all the slaves 20 is not zero.
- the slot of each slave 20 is obtained.
- the first slave 20 detects that the SVB voltage value should be the same as the voltage detected by the host 10;
- the second slave 20 detects that the SVB voltage value drops by about 0.7 V (silicon tube, xenon tube about 0.3 V), and so on.
- the communication cable can use at least 4-wire (2 pairs) twisted pair cable, such as the universal 10/100BASE-Ethernet cable T568A/B (the cable contains 4 pairs of color-coded twisted pairs, and can also be expanded. ), the connector uses the matching RJ45.
- the monitoring unit adds an A/D detection circuit to detect the A/D detection circuit of the band on the SVB-V line, and uses the resistance of the conditioning circuit to form an SVB circuit. Select the appropriate conditioning circuit resistor to ensure that all diodes are conductive throughout the full voltage range. Assuming that the diode is fully energized with a minimum current of 5 mA and the system is configured with a maximum of 40 rectifiers, the resistance is less than (53.5-0.7 x 39)/5, which is 5.2 ⁇ . Of course, the smaller the resistance selection, the larger the current flowing through the diode, but the more power consumption of the loss system. Therefore, it is recommended to select the upper limit of the resistance value, such as 5 ⁇ .
- the monitoring unit also passes the voltage value on the A/D detection circuit SVB;
- the monitoring unit processes the voltage value of the SVB bus 30 reported by all the rectifiers. If a voltage value of 0 is found, an instruction is issued through the CAN bus, and another rectifier of a different ID whose voltage value is not 0 is entered into the slot identification state; Returning to step (5) until the voltage values of the detected SVB bus 30 reported by all the rectifiers are not 0;
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Small-Scale Networks (AREA)
Abstract
一种主从式现场总线中从机地址顺序识别的方法,包括:设置一槽位电压(SVB)总线,用于串联主机和从机,各从机之间通过SVB总线串联至少一二极管;当从机的地址冲突或新的从机加入时,所述主机控制从机输出一预设的电压至SVB总线,并通过检测各从机的电压值重新设置各从机的地址。本申请还提出了对应的系统。上述主从式现场总线中从机地址顺序识别的方法及系统,实现主从式现场总线中从机地址的自动顺序识别。
Description
主从式现场总线中从机地址顺序识别的方法及系统
技术领域
本发明涉及到通信领域, 特别涉及到一种主从式现场总线中从机地址顺 序识别的方法及系统。
背景技术
随着技术的发展和生活水平的提高, 越来越多的工业控制、 医疗、 通讯、 消费等电子产品日趋智能化, 以微处理器为核心的嵌入式系统得到日益广泛 的应用, 对这些智能化设备进行现场组网和管理也成为嵌入式应用的一个重 点。 用户可以通过设备提供的智能接口如串口、 并口、 以太网口等, 对其进 行配置、 管理和监控。 基于复杂的 TCP/IP协议的高速以太网接口是未来发展 方向, 实现丰富的监控管理功能。 但是, 目前多数的嵌入式设备, 釆用 8、 16 或 32位的 MCU组成廉价系统, 出于简单、 方便、 低成本的考虑, 还是釆用现 场总线, 如 RS485总线、 CAN总线等, 实现现场设备级的局域网通讯。 其中, 大部分应用了主从式现场总线进行管理, 即一个嵌入式设备(称为主机)可 监控其他嵌入式设备(称为从机) 。
通过主从式现场总线组成现场局域网时, 需要通过设备标识来区分各个 从机, 最简单的办法是釆用设备地址来区分。每个从机都有独一无二的地址, 避免总线冲突。 但当出现某些从机出现故障, 丟失了配置地址, 或者多个从 机位置随意更换, 造成地址冲突, 或者某些从机并非连续进行配置, 中间有 些空的槽位。对于上述情况此时必须重新设置从机的地址, 保证正常的通讯。 如果从机有拨码开关或者其他人机交互设备如键盘、 显示屏等, 是可以设置 地址的。 但 4艮多情况下, 出于成本和空间的考虑, 从机并没有这些交互设备。 这就带来了实际的难题: 如何方便的设置从机的地址? 如何快速定位从机位 置?
最简单的方法是按现场总线的连接顺序或者按照从机处于的槽位顺序, 依次设置从机的地址。 但无法解决中间某些从机被拔出, 出现空的槽位的情 况。
另一个可行的方法是每个从机额外增加一个输入信号线: 片选信号线, 通过主机对每个从机设置地址。 例如主机首先使能第一个从机的片选, 设置 该从机的地址为 1 (其他从机因片选信号无效, 不予响应设置命令), 依次设 置其他从机的地址即可。 该方法比较简单, 但要增加多个信号线, 尤其当组 网的设备非常多时, 需要增加的信号线就很多, 这在很多场合是不适用的。
还有一种可行的方法是, 增加一对信号线, 各个从机信号间通过可控的 连接器件级联, 比如 DSDT (双刀双掷)开关或继电器。 通过令牌环的方式, 可 以实现各个从机的顺序识别。 但是, 该方法成本较高, 且对于控制信号连接 的 DSDT (双刀双掷)开关或继电器等器件来说, 可靠性不高, 出现故障整个串 行环路断开, 只能顺序识别地址, 对于空缺槽位(从机不在位) 的情况无法 获悉。 发明内容
本发明的主要目的为提供一种主从式现场总线中从机地址顺序识别的方 法及系统, 实现主从式现场总线中从机地址的自动顺序识别。
本发明提出一种主从式现场总线中从机地址顺序识别的方法, 包括: 设置一 S VB总线, 用于串联主机和从机, 各从机之间通过 S VB总线串 联至少一二极管;
当从机的地址冲突或新的从机加入时, 所述主机控制从机输出一预设的 电压至 SVB总线, 并通过检测各从机的电压值重新设置各从机的地址。
优选地, 所述主机控制从机输出一预设的电压至 SVB总线, 并通过检测 各从机的电压值重新设置各从机的地址:
( a )所述主机获取所有从机的 ID;
( b )指定任一 ID的从机输出所述预设的电压至 SVB总线;
( c )检测本端的电压值, 同时接收各从机检测并上^艮的各从机的电压值 和 ID;
( d )根据所述主机和从机的电压值, 获取电压值非 0的从机的 ID和地 址的对应关系, 得到从机的地址;
( e )当存在电压值为 0的从机时, 指定任一电压值为 0的从机输出所述 预设的电压至 SVB总线, 并返回步骤(c ) 。
优选地,所述指定任一 ID的从机输出所述预设的电压至 SVB总线包括: 通过现场通信总线发送控制信号至对应所述任一 ID的从机的控制开关, 通过该控制开关导通所述从机的电压输出端与 SVB总线。
优选地, 所述检测本端的电压值为:
通过 A/D检测电路检测本端的电压值。
优选地, 所述根据电压值和 ID, 获取电压值非 0的从机的 ID和地址的 对应关系, 得到从机的地址包括:
分别计算主机的电压值与各从机的电压值的电压差;
据所述电压差和二极管的压降, 判断所述各从机所属槽位号;
将所述槽位号设置为对应从机的地址。 本发明还提出一种主从式现场总线中从机地址顺序识别的系统, 包括主 机、 至少一从机和一 S VB总线, 其中,
所述 S VB总线设置为: 串联主机和从机, 各从机之间通过 S VB总线串 联至少一二极管;
所述主机设置为: 当从机的地址冲突或新的从机加入时, 控制从机输出 一预设的电压至 SVB总线,并通过检测各从机的电压值重新设置各从机的地 址。
优选地, 所述主机包括:
获取 ID模块, 设置为: 获取所有从机的 ID;
指定模块, 设置为: 指定任一 ID的从机输出所述预设的电压至 SVB总 线;
检测模块, 设置为: 检测本端的电压值, 同时接收各从机检测并上报的 各从机的电压值和 ID;
获取地址模块, 设置为: 根据所述主机和从机的电压值, 获取电压值非
0的从机的 ID和地址的对应关系, 得到从机的地址;
循环模块, 设置为: 当存在电压值为 0的从机时, 指定任一电压值为 0 的从机输出所述预设的电压至 SVB总线,并返回通过检测模块检测本端的电 压值 , 同时接收各从机检测并上报的各从机的电压值和 ID。
优选地, 所述指定模块设置为:
通过现场通信总线发送控制信号至对应所述任一 ID的从机的控制开关, 通过该控制开关导通所述从机的电压输出端与 SVB总线。
优选地, 所述检测模块设置为:
通过 A/D检测电路检测本端的电压值。
优选地, 所述获取地址模块包括:
计算单元,设置为: 分别计算主机的电压值与各从机的电压值的电压差; 判断单元, 设置为: 据所述电压差和二极管的压降, 判断所述各从机所 属槽位号;
设置单元, 设置为: 将所述槽位号设置为对应从机的地址。 本发明实施例提出的一种主从式现场总线中从机地址顺序识别的方法及 系统, 解决了在现场总线网络中, 从机由于地址丟失导致总线冲突或者标识 错误的难题, 在仅增加两根传输信号线和少量硬件的情况下, 完成各个从机 地址的重新设置和识别, 保证了现场总线的正常通讯。 另外, 还可以实现从 机自由扩展, 投入时自动识别, 提高监控系统的智能化程度。
附图概述
图 1 为本发明主从式现场总线中从机地址顺序识别的方法- 实施例的流 程示意图;
图 2 为本发明主从式现场总线中从机地址顺序识别的方法- 实施例中主 机设置从机地址步骤的流程示意图;
图 3 为本发明主从式现场总线中从机地址顺序识别的方法- 实施例中获 取地址步骤的流程示意图;
图 4 为本发明主从式现场总线中从机地址顺序识别的方法- 实施例中的 现场总线布局图;
图 5 为本发明主从式现场总线中从机地址顺序识别的方法- 实施例中整 流器的现场总线布局图;
图 6 为本发明主从式现场总线中从机地址顺序识别的系统- 实施例的结 构示意图;
图 7 为本发明主从式现场总线中从机地址顺序识别的系统- 实施例中主
机的结构示意图;
图 8 为本发明主从式现场总线中从机地址顺序识别的系统一实施例中获 取地址模块的结构示意图。 本发明目的的实现、 功能特点及优点将结合实施例, 参照附图做进一步 说明。 本发明的较佳实施方式
应当理解, 此处所描述的具体实施例仅仅用以解释本发明, 并不用于限 定本发明。 参照图 1 ,提出本发明主从式现场总线中从机地址顺序识别的方法一实施 例, 包括:
步骤 S10、 设置一槽位电压(Socket Voltage Bus, SVB )总线, 用于串联 主机和从机 , 各从机之间通过 S VB总线串联至少一二极管;
在 SVB总线上, 各从机间以二极管串连。 主机发现从机地址冲突或者从 机地址需要重置时, 主机通过现场总线, 通知某个指定的从机, 在 SVB总线 上输出电压; 由于二极管单向导通、 正向压降固定的特点, 所有不同槽位的 从机都从 SVB上检测到特定的、 不同电压幅值, 从而区分槽位、 以及重置该 从机地址。
步骤 Sl l、 当从机的地址冲突或新的从机加入时, 所述主机控制从机输 出一预设的电压至 SVB总线,并通过检测各从机的电压值重新设置各从机的 地址。
参照图 2, 步骤 S11进一步包括:
步骤 Sl l l、 所述主机获取所有从机的 ID;
步骤 S112、 指定任一 ID的从机输出所述预设的电压至 SVB总线; 步骤 S113、 检测本端的电压值, 同时接收各从机检测并上报的各从机的 电压值和 ID;
步骤 S114、根据所述主机和从机的电压值, 获取电压值非 0的从机的 ID 和地址的对应关系, 得到从机的地址;
步骤 S115、 当存在电压值为 0的从机时, 指定任一电压值为 0的从机输 出所述预设的电压至 SVB总线, 并返回步骤 S113 , 否则, 结束流程。
在上述实施例中, 步骤 S112具体包括:
通过现场通信总线发送控制信号至对应所述任一 ID的从机的控制开关, 通过该控制开关导通所述从机的电压输出端与 SVB总线。
参照图 3 , 在上述实施例中, 步骤 S114具体包括:
步骤 S1141、 分别计算主机的电压值与各从机的电压值的电压差; 步骤 S1142、 根据所述电压差和二极管的压降, 判断所述各从机所属槽 位号;
步骤 S1143、 将所述槽位号设置为对应从机的地址。
参照图 4, 下面结合附图对本实施例的技术方案作进一步的详细描述: 首先构建现场总线网络, 包括选用电缆、 选用器件、 设计电路、 工程应 用等。 现场总线的通讯线缆一般情况下可釆用双绞线缆。 本实施例中, 釆用 的双绞线缆除用于保障现场通信总线的物理连接外, 还需要 1对线缆(为方便 阐述, 称为 SVB总线)用于传送槽位电压信号, 这 1对线缆可以为普通线缆, 也可用双绞线。 如现场总线釆用 RS485总线或 CAN总线, 需要釆用至少 4线制 ( 2对)双绞线缆; 而如果釆用 RS422总线, 需要釆用至少 6线制 (3对)双绞 线缆。
现场总线配线可釆用串联地址分配方式,主机位于现场通信总线的一端, 离主机最近的为一号槽位的从机,依次连接, 离主机最远的从机槽位号最大, 串联在总线末端。 现场通信总线使用方法不作任何改变, 用于主机与从机间 正常的通讯, 实现系统的监控,
新增的 SVB总线, 用于串连主机和从机, 这一对 SVB总线定义为公共地 线 SVB-G、 电压信号线 SVB-V。 各个从机间需要在 SVB-V串连单向导通的二 极管, 二极管的数量根据需要设置一或多个, 电压通过二极管后, 得到稳定 的电压压降, 以确保每个槽位上的从机, 能检测到不同的电压值, 从而通过 不同的电压值确定不同的槽位号, 然后将从机所在的槽位号设置为从机的地 址, SVB总线通过主机构成回路。 主机和各个从机需要增加一检测电压的装 置如 A/D检测电路,用于检测本槽位上 SVB-V线上电压值,主机可在 SVB总线 末端, 增加电阻回路, 用于保障各串连二极管导通的最小电流, 也可以借用
A/D检测电路的输入阻抗电路来实现。
当主机识别现场通信总线上有从机的地址冲突, 或有新的从机投入时, 启动重新设置从机的地址的流程:
( 1 )主机通过已有的现场通信总线, 如 CAN总线、 RS485总线、 RS422 总线等, 发出指令, 要求所有从机上报该机器的唯一标识 ID,
( 2 )各从机分别通过现场通信总线, 向主机告知该从机的 ID。对于 CAN 网络,其本身能够实现冲突检测, 因此,告知 ID不会有任何问题,对于 RS485、 RS422等网络, 也可以籍由不同 ID号, 通过简单的时间避退算法, 向主机告 知 ID。 主机接收到所有从机反馈的 ID, 据此获知当前网络中从机的数量。
( 3 )主机通过现场通信总线, 指定某一 ID号的从机进入 "槽位识别"状 态即输出电压到 SVB总线。
( 4 )进入"槽位识别"状态的从机,通过控制端,输出一定的电压到 SVB 总线上,控制端可用常用的可控器件实现如继电器、 晶闸管、 BJT、 MOSFET、 IGBT等。
( 5 )所有从机通过 A/D检测电路检测 SVB总线上的电压值, 其中也包括 进入 "槽位识别" 状态、 输出电压的从机。
( 6 )主机也通过 A/D检测电路检测 SVB总线上的电压值。
( 7 )所有从机把检测到的 SVB总线上的电压值, 依次通过现场通信总线 送给主机。
( 8 )由于各个槽位的 SVB总线上的电压值不同, 因此主机能够判断出各 个从机的槽位号。
( 9 )由于 SVB总线上串连的二极管单向导通, 所有槽位在该处于槽位识 别状态之后的从机, 没有构成电流回路, 检测到的 SVB总线上电压值均为 0, 而由于二极管正向压降固定的特点, 所有槽位在该处于槽位识别状态之前的 从机,检测到的 SVB总线上的电压值, 以一个二极管为例,依次会下降约 0.7V (硅管、 锗管约 0.3 V ) ,
( 10 )主机通过现场通信总线, 通知此从机退出 "槽位识别" 状态, 该 从机关闭输出电压到 SVB总线。
( 11 )主机如发现有上报的检测 SVB总线电压值为 0的从机, 则通过现场 通信总线, 指定电压值为 0的任一个 ID号的从机进入 "槽位识别"状态。 返回
步骤(4 ) , 直到所有从机上报的检测 SVB总线的电压值都不为 0。
( 12 )主机根据各个 ID号的从机上报的检测 SVB电压值, 即可得到各个 从机的槽位,当槽位号根据与主机距离远近依次递减时,第一个从机检测 SVB 电压值应该和主机检测至的电压值相同; 第二个从机检测 SVB电压值依次下 降约 0.7V (硅管、 锗管约 0.3V ) , 依次类推。
( 13 )主机根据各个槽位号, 设置各个从机的地址和槽位号一致, 以实 现地址的顺序识别。
本实施例中, 应用二极管单向导电、 正向压降的特点, 通过将各个二极 管串连, 巧妙实现了槽位的顺序识别, 解决了槽位和地址不匹配的现象, 方 便现场维护和检修, 彻底解决了从机自动竟争导致的地址随意变更的缺陷。 比较通过拨码开关等硬件配置方式实现地址设置, 本实施例实现全自动化设 置, 不需要人工参与, 避免了人工疏忽导致的地址重复、 地址 /槽位不匹配等 常见问题。
优选地, 本实施例成本低、 实现容易。 总线系统中, 只需要增加一对 SVB 总线, 可使用标准的 RJ45、 RJ11等连接器, 成本低廉, 从机仅仅在背板上增 加一或多个二极管 (如常用的 IN4002 ) 、 一个可控器件和一个 SVB总线的电 压检测电路, 可控器件可以用常用的继电器、 晶闸管、 BJT、 MOSFET、 IGBT 等, 而电压检测电路由于从机通常都有 A/D功能, 因此,只需复用该 A/D即可。
优选地,本实施例适用性强。如每个 SVB总线上的二极管典型压降为 0.7V (硅管), 当从机为整流器时, 其正常输出电压为 53.5V。 因此, 可以适用于 53.5/0.7=76个整流器组成的超大容量通信直流电源系统中, 适用性非常广。 如果提高整流器输出电压到均充点 56.4V、或者选择正向压降较低的其他二极 管(锗管 0.3V ) , 则能够支持更大容量(更多节点)的电源系统, 扩展性好。
参照图 5, 以整流器为例对上述实施例作进一步说明:
某公司生产某种型号的通信基站电源系统, 广泛应用于全国各个电信设 备制造商和运营商。该电源系统由交流配电、直流配电、最多 40个整流器(作 为从机)和一个监控单元(作为主机)组成。 整流器由于功率密度的要求、 成本压力、 即插即用的要求, 除了告警指示灯和 CAN接口外, 没有其他人机 交互设备。 因此, 需要监控单元通过 CAN总线和这 40个整流器通讯, 通过地 址来区分和识别各个整流器, 以便监控单元轮询获取各个整流器的数据和告
警信息, 并且控制整流器的运行状态。
第一步、 硬件实现:
选择线缆。 由于主从机间釆用 CAN总线, 因此只需要一对线缆即可, 再 增加一对线缆作为 SVB总线。 通讯电缆可以釆用至少 4线制(2对)双绞线缆, 比如通用的 10/100BASE-以太网线缆 T568A/B (该线缆内包含 4对色标双绞线, 还可以扩充备用) , 连接器选用配套的 RJ45。
网络连接。 为了连接监控单元和各个整流器, 以及分配各个整流器地址, 需要通过以太网线缆顺序串连。 在配线上, 保证监控单元位于一端, 其他各 个整流器依次串连, 最远槽位的整流器位于网线的末端。 各个整流器插入的 背板, 需要有两个 RJ45连接器, 其中 CAN总线的两线(CAN-H、 CAN-L )在 背板直接短路。 SVB的一线 (SVB-G ) 直接短路, 另外一线(SVB-V ) 间串 连一个二极管 (如常用的 IN4002 ) 。 监控单元背板上也需要类似变更, 但可 以省去二极管。
整改整流器电路。 各个整流器本身都有 53.5V直流电压输出, 增加一个继 电器以控制使能输出到 SVB-V线上。 同时, 增加一个 A/D检测电路, 以检测 SVB-V线上的电压幅值。该 A/D检测电路可以是先通过运放进行调理后送到整 流器自带的 A/D检测电路中。
整改监控单元。 监控单元增加一个 A/D检测电路, 以检测 SVB-V线上的 带的 A/D检测电路中,借用调理电路的电阻构成 SVB回路。选择合适调理电路 的电阻, 保证在全电压范围内所有二极管能导通。 假设该二极管完全导通电 流最小 5mA, 系统配置整流器的数量最大 40, 则该电阻小于 (53.5-0.7 x 39)/5, 即 5.2ΚΩ即可。 当然电阻选择越小, 二极管上流经的电流会越大, 但损耗系 统较多的功耗, 因此, 建议尽量选择该电阻值的上限, 如 5ΚΩ即可。
监控单元或者整流器识别 CAN总线上有整流器地址冲突, 或有新整流器 投入, 启动重新设置整流器地址的流程如下:
( 1 )监控单元通过 CAN总线发出指令,要求所有整流器上报唯一标识 ID; ( 2 )所有整流器通过 CAN总线回应监控主机对应的 ID;
( 3 )监控单元接收到所有整流器回应的 ID,据此获知当前网络中整流器 的数量;
( 4 )监控单元通过 CAN总线发出指令, 指定任一 ID号的整流器进入 "槽 位识别" 状态;
( 5 )此 ID的整流器进入 "槽位识别" 状态, 输出 53.5V的电压值到 SVB 总线上;
( 6 )所有整流器通过 A/D检测电路 SVB总线上的电压值;
( 7 )监控单元也通过 A/D检测电路 SVB上的电压值;
( 8 )所有整流器通过 CAN总线上报检测到的 SVB上的电压值, 上报给监 控单元;
( 9 )由于各个槽位的 SVB总线上的电压值不同, 因此监控单元能够判断 出各个整流器的槽位号;
( 10 )监控单元通过 CAN总线发出指令, 通知此 ID整流器退出 "槽位识 另 J " 状态, 该整流器关闭输出电压到 SVB总线, 此时的 SVB总线上电压为 0;
( 11 )监控单元处理所有整流器上报的 SVB总线的电压值, 如发现有电 压值为 0, 通过 CAN总线发出指令, 指定电压值非 0的另外一个不同 ID的整流 器进入槽位识别状态; 并返回步骤(5 )直到所有整流器上报的检测 SVB总线 的电压值均不为 0;
( 12 )监控单元根据各个 ID的整流器上报的检测 SVB总线的电压值, 即 可得到各个整流器的槽位号, 如第一个整流器检测 SVB总线的电压值应该和 监控单元检测的 SVB总线的电压值相同, 第二个整流器检测的 SVB总线的电 压值依次下降约 0.7V (硅管、 锗管约 0.3V ) , 依次类推;
( 13 )监控单元根据各个槽位号, 设置各个整流器从机的地址和槽位号 一致, 以实现地址的顺序设置和识别。 参照图 6, 提出主从式现场总线中从机地址顺序识别的系统一实施例, 包括主机 10、 至少一从机 20和一 SVB总线 30, 其中,
所述 SVB总线 30,用于串联主机 10和从机 20,各从机 20之间通过 SVB 总线 30串联至少一二极管;
所述主机 10, 当从机 20地址冲突或新的从机 20加入时, 所述主机 10 控制从机 20输出一预设的电压至 SVB总线 30,并通过检测各从机 20的电压 值重新设置各从机的地址。
参照图 7, 在一实施例中, 主机 10包括:
获取 ID模块 11 , 用于获取所有从机 20的 ID;
指定模块 12, 用于指定任一 ID的从机 20输出所述预设的电压至 SVB 总线 30;
检测模块 13 , 用于检测本端的电压值, 同时接收各从机 20检测并上报 的各从机 20的电压值和 ID;
获取地址模块 14, 用于根据所述主机 10和从机 20的电压值, 获取电压 值非 0的从机 20的 ID和地址的对应关系, 得到从机 20的地址;
循环模块 15, 用于当存在电压值为 0的从机 20时, 指定任一电压值为 0 的从机 20输出所述预设的电压至 SVB总线 30, 并返回通过检测模块检测本 端的电压值, 同时接收各从机 20检测并上报的各从机 20的电压值和 ID。
在上述实施例中, 指定模块 12具体用于:
通过现场通信总线发送控制信号至对应所述任一 ID的从机 20的控制开 关, 通过该控制开关导通所述从机 20的电压输出端与 SVB总线 30。
在上述实施例中, 检测模块 13具体用于:
通过 A/D检测电路检测本端的电压值。
参照图 8, 在上述实施例中, 获取地址模块 14包括:
计算单元 141 , 用于分别计算主机 10的电压值与各从机 20的电压值的 电压差;
判断单元 142, 用于据所述电压差和二极管的压降, 判断所述各从机 20 所属槽位号;
设置单元 143 , 用于将所述槽位号设置为对应从机 20的地址。
下面结合附图对本实施例的技术方案作进一步的详细描述:
首先构建现场总线网络, 包括选用电缆、 选用器件、 设计电路、 工程应 用等。 现场总线的通讯线缆一般情况下可釆用双绞线缆。 本实施例中, 釆用 的双绞线缆除用于保障现场通信总线的物理连接外, 还需要 1对线缆(为方便 阐述, 称为 SVB总线)用于传送槽位电压信号, 这 1对线缆可以为普通线缆, 也可用双绞线。 如现场总线釆用 RS485总线或 CAN总线, 需要釆用至少 4线制 ( 2对)双绞线缆; 而如果釆用 RS422总线, 需要釆用至少 6线制 (3对)双绞 线缆。
现场总线配线可釆用串联地址分配方式, 主机 10位于现场通信总线的一 端, 离主机 10最近的为一号槽位的从机 20, 依次连接, 离主机 10最远的从机 20槽位号最大, 串联在总线末端。 现场通信总线使用方法不作任何改变, 用 于主机 10与从机 20间正常的通讯, 实现系统的监控,
新增的 SVB总线 30, 用于串连主机 10和从机 20, 这一对 SVB总线 30定义 为公共地线 SVB-G、 电压信号线 SVB-V。 各个从机 20间需要在 SVB-V串连单 向导通的二极管, 二极管的数量根据需要设置一或多个, 电压通过二极管后, 得到稳定的电压压降, 以确保每个槽位上的从机 20, 能检测到不同的电压值, 从而通过不同的电压值确定不同的槽位号, 然后将从机 20所在的槽位号设置 为从机 20的地址, SVB总线 30通过主机 10构成回路。 主机 10和各个从机 20需 要增加一检测电压的装置如 A/D检测电路,用于检测本槽位上 SVB-V线上电压 值, 主机 10可在 SVB总线 30末端, 增加电阻回路, 用于保障各串连二极管导 通的最小电流, 也可以借用 A/D的输入阻抗电路来实现。
当主机 10识别现场通信总线上有从机 20地址冲突, 或有新的从机 20投入 时, 主机 10通过如下方式重新设置从机 20地址:
( 1 )获取 ID模块 11通过已有的现场通信总线,如 CAN总线、 RS485总线、 RS422总线等, 发出指令, 要求所有从机 20上报该机器的唯一标识 ID,
( 2 )各从机 20分别通过现场通信总线, 向获取 ID模块 11告知该从机 20 的 ID。 对于 CAN网络, 其本身能够实现冲突检测, 因此, 告知 ID不会有任何 问题, 对于 RS485、 RS422等网络, 也可以籍由不同 ID号, 通过简单的时间避 退算法,向获取 ID模块 11告知 ID。获取 ID模块 11接收到所有从机 20反馈的 ID, 据此获知当前网络中从机 20的数量。
( 3 )指定模块 12通过现场通信总线, 指定某一 ID号的从机 20进入 "槽位 识别" 状态即输出电压到 SVB总线 30。
( 4 )进入 "槽位识别" 状态的从机 20, 通过控制端, 输出一定的电压到
SVB总线 30上, 控制端可用常用的可控器件实现如继电器、 晶闸管、 BJT、 MOSFET、 IGBT等。
( 5 )所有从机 20通过 A/D检测电路检测 SVB总线 30上的电压值, 其中也 包括进入 "槽位识别" 状态、 输出电压的从机 20。
( 6 )检测模块 13也通过 A/D检测电路检测 SVB总线 30上的电压值。
( 7 )所有从机 20把检测到的 SVB总线 30上的电压值, 依次通过现场通信 总线送给检测模块 13。
( 8 )由于各个槽位的 SVB总线 30上的电压值不同, 因此获取地址模块 14 能够判断出各个从机 20的槽位号。
( 9 )由于 SVB总线 30上串连的二极管单向导通, 所有槽位在该处于槽位 识别状态之后的从机 20 , 没有构成电流回路, 检测到的 SVB总线 30上电压值 均为 0, 而由于二极管正向压降固定的特点, 所有槽位在该处于槽位识别状态 之前的从机 20 , 检测到的 SVB总线 30上的电压值, 以一个二极管为例, 依次 会下降约 0.7V (硅管、 锗管约 0.3V ) ,
( 10 )主机 10通过现场通信总线, 通知此从机 20退出 "槽位识别" 状态, 该从机 20关闭输出电压到 SVB总线 30。
( 11 )循环模块 15如发现有上报的检测 SVB总线 30电压值为 0的从机 20, 则通过现场通信总线,指定电压值为 0的任一个 ID号的从机 20进入 "槽位识别 " 状态。 并返回通过检测模块 13检测 SVB总线的电压值, 同时接收各从机 20检 测并上报的电压值和 ID, 直到所有从机 20上报的检测 SVB总线 30的电压值都 不为 0。
SVB电压值, 即可得到各个从机 20的槽位, 当槽位号根据与主机 10距离远近 依次递减时, 第一个从机 20检测 SVB电压值应该和主机 10检测至的电压值相 同; 第二个从机 20检测 SVB电压值依次下降约 0.7V (硅管、 锗管约 0.3V ) , 依次类推。
( 13 )获取地址模块 14的设置单元 143根据各个槽位号,设置各个从机 20 地址和槽位号一致, 以实现地址的顺序识别。
本实施例中, 应用二极管单向导电、 正向压降的特点, 通过将各个二极 管串连, 巧妙实现了槽位的顺序识别, 解决了槽位和地址不匹配的现象, 方 便现场维护和检修,彻底解决了从机 20自动竟争导致的地址随意变更的缺陷。 比较通过拨码开关等硬件配置方式实现地址设置, 本实施例实现全自动化设 置, 不需要人工参与, 避免了人工疏忽导致的地址重复、 地址 /槽位不匹配等 常见问题。
优选地, 本实施例成本低、 实现容易。 总线系统中, 只需要增加一对 SVB
总线 30, 可使用标准的 RJ45、 RJ11等连接器, 成本低廉, 从机 20仅仅在背板 上增加一或多个二极管 (如常用的 IN4002 ) 、 一个可控器件和一个 SVB总线 30的电压检测电路,可控器件可以用常用的继电器、 晶闸管、 BJT、 MOSFET、 IGBT等, 而电压检测电路由于从机 20通常都有 A/D功能, 因此, 只需复用该 A/D即可。
优选地, 本实施例适用性强。 如每个 SVB总线 30上的二极管典型压降为 0.7V (硅管) , 当从机 20为整流器时, 其正常输出电压为 53.5V。 因此, 可以 适用于 53.5/0.7=76个整流器组成的超大容量通信直流电源系统中, 适用性非 常广。 如果提高整流器输出电压到均充点 56.4V、 或者选择正向压降较低的其 他二极管 (锗管 0.3V ) , 则能够支持更大容量(更多节点) 的电源系统, 扩 展性好。
下面以整流器为例对上述实施例作进一步说明:
某公司生产某种型号的通信基站电源系统, 广泛应用于全国各个电信设 备制造商和运营商。该电源系统由交流配电、直流配电、最多 40个整流器(作 为从机 20 )和一个监控单元(作为主机 10 )组成。 整流器由于功率密度的要 求、 成本压力、 即插即用的要求, 除了告警指示灯和 CAN接口外, 没有其他 人机交互设备。 因此, 需要监控单元通过 CAN总线和这 40个整流器通讯, 通 过地址来区分和识别各个整流器, 以便监控单元轮询获取各个整流器的数据 和告警信息, 并且控制整流器的运行状态。
第一步、 硬件实现:
选择线缆。 由于主从机间釆用 CAN总线, 因此只需要一对线缆即可, 再 增加一对线缆作为 SVB总线 30。 通讯电缆可以釆用至少 4线制 (2对)双绞线 缆, 比如通用的 10/100BASE-以太网线缆 T568A/B (该线缆内包含 4对色标双 绞线, 还可以扩充备用) , 连接器选用配套的 RJ45。
网络连接。 为了连接监控单元和各个整流器, 以及分配各个整流器地址, 需要通过以太网线缆顺序串连。 在配线上, 保证监控单元位于一端, 其他各 个整流器依次串连, 最远槽位的整流器位于网线的末端。 各个整流器插入的 背板, 需要有两个 RJ45连接器, 其中 CAN总线的两线(CAN-H、 CAN-L )在 背板直接短路。 SVB的一线 (SVB-G ) 直接短路, 另外一线(SVB-V ) 间串 连一个二极管 (如常用的 IN4002 ) 。 监控单元背板上也需要类似变更, 但可
以省去二极管。
整改整流器电路。 各个整流器本身都有 53.5V直流电压输出, 增加一个继 电器以控制使能输出到 SVB-V线上。 同时, 增加一个 A/D检测电路, 以检测 SVB-V线上的电压幅值。该 A/D检测电路可以是先通过运放进行调理后送到整 流器自带的 A/D检测电路中。
整改监控单元。 监控单元增加一个 A/D检测电路, 以检测 SVB-V线上的 带的 A/D检测电路中,借用调理电路的电阻构成 SVB回路。选择合适调理电路 的电阻, 保证在全电压范围内所有二极管能导通。 假设该二极管完全导通电 流最小 5mA, 系统配置整流器的数量最大 40 , 则该电阻小于 (53.5-0.7 x 39)/5 , 即 5.2ΚΩ即可。 当然电阻选择越小, 二极管上流经的电流会越大, 但损耗系 统较多的功耗, 因此, 建议尽量选择该电阻值的上限, 如 5ΚΩ即可。
监控单元或者整流器识别 CAN总线上有整流器地址冲突, 或有新整流器 投入, 则监控单元通过如下方式重新设置整流器地址:
( 1 )监控单元通过 CAN总线发出指令,要求所有整流器上报唯一标识 ID;
( 2 )所有整流器通过 CAN总线回应监控主机 10对应的 ID;
( 3 )监控单元接收到所有整流器回应的 ID,据此获知当前网络中整流器 的数量;
( 4 )监控单元通过 CAN总线发出指令, 指定任一 ID号的整流器进入 "槽 位识别" 状态;
( 5 )此 ID的整流器进入 "槽位识别" 状态, 输出 53.5V的电压值到 SVB 总线 30上;
( 6 )所有整流器通过 A/D检测电路 SVB总线 30上的电压值;
( 7 )监控单元也通过 A/D检测电路 SVB上的电压值;
( 8 )所有整流器通过 CAN总线上报检测到的 SVB上的电压值, 上报给监 控单元;
( 9 )由于各个槽位的 SVB总线 30上的电压值不同, 因此监控单元能够判 断出各个整流器的槽位号;
( 10 )监控单元通过 CAN总线发出指令, 通知此 ID整流器退出 "槽位识 另 , 状态, 该整流器关闭输出电压到 SVB总线 30 , 此时的 SVB总线 30上电压
为 0;
( 11 )监控单元处理所有整流器上报的 SVB总线 30的电压值, 如发现有 电压值为 0, 通过 CAN总线发出指令, 指定电压值非 0的另外一个不同 ID的整 流器进入槽位识别状态; 并返回步骤(5 )直到所有整流器上报的检测 SVB总 线 30的电压值均不为 0;
( 12 )监控单元根据各个 ID的整流器上报的检测 SVB总线 30的电压值, 即可得到各个整流器的槽位号, 如第一个整流器检测 SVB总线 30的电压值应 该和监控单元检测的 SVB总线 30的电压值相同, 第二个整流器检测的 SVB总 线 30的电压值依次下降约 0.7V (硅管、 锗管约 0.3V ) , 依次类推;
( 13 )监控单元根据各个槽位号, 设置各个整流器从机 20的地址和槽位 号一致, 以实现地址的顺序设置和识别。 以上所述仅为本发明的优选实施例, 并非因此限制本发明的专利范围, 凡是利用本发明说明书及附图内容所作的等效结构或等效流程变换, 或直接 或间接运用在其他相关的技术领域,均同理包括在本发明的专利保护范围内。
工业实用性 本发明实施例提出的一种主从式现场总线中从机地址顺序识别的方法及 系统, 解决了在现场总线网络中, 从机由于地址丟失导致总线冲突或者标识 错误的难题, 在仅增加两根传输信号线和少量硬件的情况下, 完成各个从机 地址的重新设置和识别, 保证了现场总线的正常通讯。 另外, 还可以实现从 机自由扩展, 投入时自动识别, 提高监控系统的智能化程度。
Claims
1、 一种主从式现场总线中从机地址顺序识别的方法, 包括:
设置一槽位电压 (SVB ) 总线, 用于串联主机和从机, 各从机之间通过 SVB总线串联至少一二极管;
当从机的地址冲突或新的从机加入时, 所述主机控制从机输出一预设的 电压至 SVB总线, 并通过检测各从机的电压值重新设置各从机的地址。
2、 如权利要求 1所述的方法, 其中, 所述主机控制从机输出一预设的电 压至 SVB总线, 并通过检测各从机的电压值重新设置各从机的地址包括:
( a )所述主机获取所有从机的 ID;
( b )指定任一 ID的从机输出所述预设的电压至 SVB总线;
( c )检测本端的电压值, 同时接收各从机检测并上^艮的各从机的电压值 和 ID;
( d )根据所述主机和从机的电压值, 获取电压值非 0的从机的 ID和地 址的对应关系, 得到从机的地址;
( e )当存在电压值为 0的从机时, 指定任一电压值为 0的从机输出所述 预设的电压至 SVB总线, 并返回步骤(c ) 。
3、 如权利要求 2所述的方法, 其中, 所述指定任一 ID的从机输出所述 预设的电压至 SVB总线包括:
通过现场通信总线发送控制信号至对应所述任一 ID的从机的控制开关, 通过该控制开关导通所述从机的电压输出端与 SVB总线。
4、 如权利要求 2或 3所述的方法, 其中, 所述检测本端的电压值为: 通过 A/D检测电路检测本端的电压值。
5、 如权利要求 2或 3所述的方法, 其中, 所述根据电压值和 ID, 获取 电压值非 0的从机的 ID和地址的对应关系, 得到从机的地址包括:
分别计算主机的电压值与各从机的电压值的电压差;
据所述电压差和二极管的压降, 判断所述各从机所属槽位号;
将所述槽位号设置为对应从机的地址。
6、 一种主从式现场总线中从机地址顺序识别的系统, 包括主机、 至少一 从机和一槽位电压 (SVB ) 总线, 其中,
所述 S VB总线设置为: 串联主机和从机, 各从机之间通过 S VB总线串 联至少一二极管;
所述主机设置为: 当从机的地址冲突或新的从机加入时, 控制从机输出 一预设的电压至 SVB总线,并通过检测各从机的电压值重新设置各从机的地 址。
7、 如权利要求 6所述的系统, 其中, 所述主机包括:
获取 ID模块, 设置为: 获取所有从机的 ID;
指定模块, 设置为: 指定任一 ID的从机输出所述预设的电压至 SVB总 线;
检测模块, 设置为: 检测本端的电压值, 同时接收各从机检测并上报的 各从机的电压值和 ID;
获取地址模块, 设置为: 根据所述主机和从机的电压值, 获取电压值非 0的从机的 ID和地址的对应关系, 得到从机的地址;
循环模块, 设置为: 当存在电压值为 0的从机时, 指定任一电压值为 0 的从机输出所述预设的电压至 SVB总线,并返回通过检测模块检测本端的电 压值 , 同时接收各从机检测并上报的各从机的电压值和 ID。
8、 如权利要求 7所述的系统, 其中, 所述指定模块设置为:
通过现场通信总线发送控制信号至对应所述任一 ID的从机的控制开关, 通过该控制开关导通所述从机的电压输出端与 SVB总线。
9、 如权利要求 7或 8所述的系统, 其中, 所述检测模块设置为: 通过 A/D检测电路检测本端的电压值。
10、 如权利要求 7或 8所述的系统, 其中, 所述获取地址模块包括: 计算单元,设置为: 分别计算主机的电压值与各从机的电压值的电压差; 判断单元, 设置为: 据所述电压差和二极管的压降, 判断所述各从机所 属槽位号;
设置单元, 设置为: 将所述槽位号设置为对应从机的地址。
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| EP12797353.5A EP2688248B1 (en) | 2011-06-08 | 2012-06-07 | Method and system for ordered identifying slave address from master-slave scene bus |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201110151913.XA CN102821017B (zh) | 2011-06-08 | 2011-06-08 | 主从式现场总线中从机地址顺序识别的方法及系统 |
| CN201110151913.X | 2011-06-08 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2012167736A1 true WO2012167736A1 (zh) | 2012-12-13 |
Family
ID=47295486
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2012/076591 Ceased WO2012167736A1 (zh) | 2011-06-08 | 2012-06-07 | 主从式现场总线中从机地址顺序识别的方法及系统 |
Country Status (3)
| Country | Link |
|---|---|
| EP (1) | EP2688248B1 (zh) |
| CN (1) | CN102821017B (zh) |
| WO (1) | WO2012167736A1 (zh) |
Cited By (6)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111371529A (zh) * | 2018-12-26 | 2020-07-03 | 深圳市优必选科技有限公司 | 一种编码分配方法、装置、主控设备及存储介质 |
| CN113315850A (zh) * | 2021-03-24 | 2021-08-27 | 镇江中煤电子有限公司 | 煤矿安全监控系统传感器485通信地址冲突识别方法 |
| CN113727497A (zh) * | 2021-08-31 | 2021-11-30 | 萤火虫(深圳)灯光科技有限公司 | 定位识别方法、系统、灯光控制装置、设备及存储介质 |
| CN115016998A (zh) * | 2022-08-08 | 2022-09-06 | 南京宏泰半导体科技有限公司 | 一种子模块自适配方法、装置、系统及存储介质 |
| CN116192559A (zh) * | 2023-02-24 | 2023-05-30 | 厦门笃正电子技术有限公司 | 一种多设备数据传输系统及方法 |
| CN119105808A (zh) * | 2024-07-19 | 2024-12-10 | 浙江大华技术股份有限公司 | 模型加载方法、电子设备以及存储介质 |
Families Citing this family (25)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106205073A (zh) * | 2014-12-31 | 2016-12-07 | 无锡华润矽科微电子有限公司 | 联网式烟雾报警器终端地址的自动生成系统及其方法 |
| CN108737583B (zh) * | 2017-04-18 | 2021-06-25 | 奥动新能源汽车科技有限公司 | 系统中从控制器的配置方法和配置系统 |
| CN107478995B (zh) * | 2017-07-25 | 2020-07-28 | 烟台创为新能源科技股份有限公司 | 一种电池热失控检测系统的自动编码方法 |
| DE102017117128A1 (de) * | 2017-07-28 | 2019-01-31 | Ebm-Papst Mulfingen Gmbh & Co. Kg | Drahtlose Vergabe von Netzwerkadressen |
| CN107719153A (zh) * | 2017-09-07 | 2018-02-23 | 浙江吉利汽车研究院有限公司 | 电池管理系统中采集板地址自动分配方法及装置 |
| CN107682467A (zh) * | 2017-10-01 | 2018-02-09 | 北京迪利科技有限公司 | 一种通过逐级供电实现通讯的总线地址分配与识别的方法 |
| CN108809785A (zh) * | 2018-06-08 | 2018-11-13 | 中国电子科技集团公司第十四研究所 | 基于canfd总线的电源监控模块 |
| CN108965448B (zh) * | 2018-07-27 | 2022-09-16 | 东莞铭普光磁股份有限公司 | 一种信息传送系统及方法 |
| CN109150680B (zh) * | 2018-08-30 | 2020-10-16 | 青岛科技大学 | 一种适用于rs485总线的自适应确定地址组网电路及方法 |
| CN109218464B (zh) * | 2018-09-21 | 2021-11-26 | 漳州科华技术有限责任公司 | 模块并联的地址冲突上报方法、系统、设备及存储介质 |
| DE102018125894B4 (de) * | 2018-10-18 | 2021-01-28 | Bender Gmbh & Co. Kg | Verfahren zum Auflösen eines Adresskonflikts bei dem Modbus RTU-Standardprotokoll |
| CN109672566A (zh) * | 2019-01-04 | 2019-04-23 | 烽火通信科技股份有限公司 | 网元装置间的通信方法以及系统、应用 |
| CN110336725B (zh) * | 2019-07-11 | 2020-11-10 | 珠海格力电器股份有限公司 | 精准定位控制器局域网can网络中节点的方法及装置 |
| CN110912791B (zh) * | 2019-11-07 | 2021-06-29 | 苏州浪潮智能科技有限公司 | 系统管理总线链路及其上拉电阻确定方法、装置和设备 |
| CN110830304B (zh) * | 2019-11-13 | 2022-11-11 | 深圳竹芒科技有限公司 | 一种主从通讯系统、从机位置识别方法和移动电源的租借装置 |
| CN110738799A (zh) * | 2019-11-13 | 2020-01-31 | 深圳市搜电科技发展有限公司 | 一种租借系统、主从通讯系统及其主机和从机 |
| CN111142042B (zh) * | 2020-02-28 | 2025-04-08 | 烟台创为新能源科技股份有限公司 | 自动编码系统及方法 |
| CN113721148A (zh) * | 2020-05-25 | 2021-11-30 | 蓝谷智慧(北京)能源科技有限公司 | 一种编址电路系统及能源管理系统 |
| CN111970448B (zh) * | 2020-08-27 | 2022-04-22 | 上海艾为电子技术股份有限公司 | 光学防抖驱动电路、驱动系统及其控制方法和电子设备 |
| CN112599082B (zh) * | 2020-12-22 | 2022-02-11 | 深圳市明微电子股份有限公司 | 自适应寻址及编址方法、装置、设备及存储介质 |
| CN114035122B (zh) * | 2021-11-08 | 2024-09-06 | 中群电气有限公司 | 一种配电箱内的断路器连接编号方法 |
| CN114126140A (zh) * | 2021-12-06 | 2022-03-01 | 张志宝 | 一种led自动编码方法及系统 |
| CN115438713B (zh) * | 2022-07-29 | 2026-01-20 | 科华数据股份有限公司 | 电气模块的绕组组号识别方法、电气模块及存储介质 |
| CN115567488B (zh) * | 2022-09-30 | 2025-02-14 | 上海京硅智能技术有限公司 | 通讯地址配置方法、电子设备及存储介质 |
| CN117221358A (zh) * | 2023-09-23 | 2023-12-12 | 山东华允物联科技有限公司 | 一种物联网终端硬件组态自适应和管理方法 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1949734A (zh) * | 2006-09-21 | 2007-04-18 | 王建华 | 可供电二线制实时总线通讯方法 |
| US7444453B2 (en) * | 2006-01-03 | 2008-10-28 | International Business Machines Corporation | Address translation device |
| CN101355482A (zh) * | 2008-09-04 | 2009-01-28 | 中兴通讯股份有限公司 | 实现嵌入式设备地址顺序识别的设备、方法和系统 |
| CN101482749A (zh) * | 2008-01-11 | 2009-07-15 | 鸿富锦精密工业(深圳)有限公司 | 主设备对从设备的自动定址系统 |
Family Cites Families (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| EP1284556A1 (en) * | 2001-08-17 | 2003-02-19 | Saia-Burgess Murten AG | A method for initializing a control system and a control system |
| CN2715431Y (zh) * | 2004-01-15 | 2005-08-03 | 北京北纬通信科技股份有限公司 | 分体式数据采集发送装置 |
| US7373224B2 (en) * | 2004-07-22 | 2008-05-13 | Safetywatch Technologies, Inc. | Brake monitoring system for heavy vehicles |
| CN100480910C (zh) * | 2007-05-15 | 2009-04-22 | 江苏万工科技集团有限公司 | 一种纺织设备多地址编码机构 |
| DE102007028926B3 (de) * | 2007-06-22 | 2008-10-16 | Siemens Ag | Slavegerät zur Verwendung in einer Reihenschaltung sowie Busanordnung mit Reihenschaltung in einem Subbussystem |
-
2011
- 2011-06-08 CN CN201110151913.XA patent/CN102821017B/zh active Active
-
2012
- 2012-06-07 EP EP12797353.5A patent/EP2688248B1/en active Active
- 2012-06-07 WO PCT/CN2012/076591 patent/WO2012167736A1/zh not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7444453B2 (en) * | 2006-01-03 | 2008-10-28 | International Business Machines Corporation | Address translation device |
| CN1949734A (zh) * | 2006-09-21 | 2007-04-18 | 王建华 | 可供电二线制实时总线通讯方法 |
| CN101482749A (zh) * | 2008-01-11 | 2009-07-15 | 鸿富锦精密工业(深圳)有限公司 | 主设备对从设备的自动定址系统 |
| CN101355482A (zh) * | 2008-09-04 | 2009-01-28 | 中兴通讯股份有限公司 | 实现嵌入式设备地址顺序识别的设备、方法和系统 |
Cited By (9)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN111371529A (zh) * | 2018-12-26 | 2020-07-03 | 深圳市优必选科技有限公司 | 一种编码分配方法、装置、主控设备及存储介质 |
| CN111371529B (zh) * | 2018-12-26 | 2022-11-29 | 深圳市优必选科技有限公司 | 一种编码分配方法、装置、主控设备及存储介质 |
| CN113315850A (zh) * | 2021-03-24 | 2021-08-27 | 镇江中煤电子有限公司 | 煤矿安全监控系统传感器485通信地址冲突识别方法 |
| CN113727497A (zh) * | 2021-08-31 | 2021-11-30 | 萤火虫(深圳)灯光科技有限公司 | 定位识别方法、系统、灯光控制装置、设备及存储介质 |
| CN113727497B (zh) * | 2021-08-31 | 2024-01-23 | 萤火虫(深圳)灯光科技有限公司 | 定位识别方法、系统、灯光控制装置、设备及存储介质 |
| CN115016998A (zh) * | 2022-08-08 | 2022-09-06 | 南京宏泰半导体科技有限公司 | 一种子模块自适配方法、装置、系统及存储介质 |
| CN115016998B (zh) * | 2022-08-08 | 2022-10-21 | 南京宏泰半导体科技有限公司 | 一种子模块自适配方法、装置、系统及存储介质 |
| CN116192559A (zh) * | 2023-02-24 | 2023-05-30 | 厦门笃正电子技术有限公司 | 一种多设备数据传输系统及方法 |
| CN119105808A (zh) * | 2024-07-19 | 2024-12-10 | 浙江大华技术股份有限公司 | 模型加载方法、电子设备以及存储介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN102821017B (zh) | 2018-03-13 |
| EP2688248A1 (en) | 2014-01-22 |
| EP2688248A4 (en) | 2014-11-19 |
| CN102821017A (zh) | 2012-12-12 |
| EP2688248B1 (en) | 2018-08-29 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN102821017B (zh) | 主从式现场总线中从机地址顺序识别的方法及系统 | |
| CN114095477B (zh) | 用于对串联连接的从设备进行自动寻址的系统、设备和方法 | |
| RU2698708C2 (ru) | Аппарат, способ и система для управления нагрузочным устройством через линию электропитания с использованием протокола согласования электропитания | |
| US9811496B2 (en) | Method and apparatus for detecting interface connection between devices | |
| JPH0764894A (ja) | 複数プロトコル端末装置を接続するシステム装置および方法 | |
| EP1019798A2 (en) | Method and apparatus for detecting the presence of a remote device and providing power thereto | |
| JP2015530046A (ja) | 2線式データ通信ケーブルを介した多重化電力供給及びデータ供給のための方法及び装置 | |
| JP6144378B2 (ja) | パワーオーバイーサネット方法および装置 | |
| CN104881382A (zh) | 一种主从设备连接装置及其地址识别方法 | |
| US12189448B2 (en) | Modular power controller | |
| US11165252B2 (en) | Method and apparatus for automatic detection and selection of power over ethernet and power over powered data lines | |
| US7676571B2 (en) | System for monitoring cable interface connections in a network | |
| CN109274611A (zh) | 基板管理控制器切换共享网络协议的方法 | |
| TWI720912B (zh) | 基板管理控制單元與網路交換器之間的連接狀態的偵測方法及其伺服器裝置 | |
| WO2013040941A1 (zh) | 整流器识别方法及装置 | |
| CN215954081U (zh) | 一种基于can总线的自适应aidi扩展板 | |
| CN115658583B (zh) | 一种结合单线双向协议的lin自动寻址系统及方法 | |
| CN205068372U (zh) | 一种主从设备连接装置 | |
| CN116708074A (zh) | Can通信系统、其工作方法及针织机控制系统 | |
| CN110995467B (zh) | 一种对非网管交换机进行远程管理的方法和第一交换机 | |
| US20070078975A1 (en) | System For Monitoring Cable Interface Connections In A Network | |
| CN110752957B (zh) | 以太网控制自动化网络节点及其报文分析设备 | |
| CN118590335A (zh) | 一种以太网供电方法、以太网装置和以太网供电系统 | |
| CN103018521B (zh) | 整流器识别方法及装置 | |
| CN119211194A (zh) | 一种通讯地址的配置系统、主机设备和从机设备 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 12797353 Country of ref document: EP Kind code of ref document: A1 |
|
| WWE | Wipo information: entry into national phase |
Ref document number: 2012797353 Country of ref document: EP |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |