WO2011150717A1 - 通讯芯片故障消除实现方法及装置 - Google Patents

通讯芯片故障消除实现方法及装置 Download PDF

Info

Publication number
WO2011150717A1
WO2011150717A1 PCT/CN2011/072359 CN2011072359W WO2011150717A1 WO 2011150717 A1 WO2011150717 A1 WO 2011150717A1 CN 2011072359 W CN2011072359 W CN 2011072359W WO 2011150717 A1 WO2011150717 A1 WO 2011150717A1
Authority
WO
WIPO (PCT)
Prior art keywords
state
communication chip
data
chip
port
Prior art date
Application number
PCT/CN2011/072359
Other languages
English (en)
French (fr)
Inventor
王常力
史洪源
万雪飞
韩宝林
张云禧
Original Assignee
杭州和利时自动化有限公司
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 杭州和利时自动化有限公司 filed Critical 杭州和利时自动化有限公司
Publication of WO2011150717A1 publication Critical patent/WO2011150717A1/zh

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0654Management of faults, events, alarms or notifications using network fault recovery
    • H04L41/0659Management of faults, events, alarms or notifications using network fault recovery by isolating or reconfiguring faulty entities
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/40Bus networks
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/06Management of faults, events, alarms or notifications
    • H04L41/0681Configuration of triggering conditions

Definitions

  • the present application claims priority to Chinese Patent Application No. 201010192620.1, entitled “Communication Chip Fault Elimination Method and Apparatus", which is filed on June 1, 2010, the entire contents of which are hereby incorporated by reference. in. TECHNICAL FIELD
  • the present invention relates to the field of industrial automation technologies, and more particularly to a method and apparatus for implementing PROFIBUS-DP protocol communication chip fault elimination.
  • BACKGROUND OF THE INVENTION Fieldbus is the lowest level communication network used in manufacturing manufacturing sites, which enables bi-directional serial multi-node digital communication between computerized field measurement control instruments or devices.
  • PROFIBUS-DP is the underlying control network designed for communication between automatic control systems and device-level distributed I/O. It is widely used for high-speed data transmission in distributed control systems (DCS).
  • the central controller communicates with dispersed field devices (such as 1/0, drives, etc.) via a high-speed serial line.
  • the PROFIBUS-DP adopts the RS485 transmission technology, and the slave control stations in the DCS system pass the PROFIBUS-DP protocol communication special chip SPC3, CPLD (complex editable logic device) and the RS485 bus communication module and the main control station.
  • SPC3, CPLD complex editable logic device
  • RS485 bus communication module and the main control station.
  • the communication protocol analysis and the data stream transmission function of the physical layer, the specific module circuit is shown in Figure 1.
  • the SPC3 chip converts the data to be transmitted by the microcontroller to the message specified by the PROFIBUS-DP protocol, and converts it into the corresponding serial BIT (bit) stream according to the PROFIBUS-DP protocol, through the SPC3 chip.
  • the TXD pin on the data is sent out, and one channel of the data signal is divided into two signals by the CPLD, and is provided to the two RS485 buses for data transmission.
  • RS485 is responsible for converting the BIT code to a differential level to meet the bus transmission requirements.
  • the SPC3 chip When the slave control station is in the receive data state, the SPC3 chip is in the receive state and receives the data sent on the bus.
  • the RS485 interface transceiver module is responsible for converting the differential signal on the bus into a level signal.
  • the SPC3 selects and receives the signal sent by one of the buses, and parses the received BIT stream, and synthesizes the report. Text, provided to the microcontroller.
  • the embodiment of the invention provides a method and a device for implementing fault elimination of a communication chip.
  • the communication chip is faulty and occupies the communication bus, the occupation of the communication bus by the faulty chip can be quickly cut off.
  • the embodiment of the invention provides a method for implementing PROFIBUS-DP protocol communication chip fault elimination, and the method includes:
  • the working state is the data sending state
  • the current data transmission state of the bus transceiver connected to the communication chip is set to the data reception state.
  • the determining whether the maintenance time of the data sending state exceeds a preset time threshold includes:
  • the determining whether the maintenance time of the data sending state exceeds a preset time threshold includes:
  • the current data transmission status setting of the bus transceiver that will connect the communication chip is:
  • the transceiver is set to a data reception state by setting the transceiver control port of the bus transceiver to a low level.
  • a PROFIBUS-DP protocol communication chip fault elimination implementation device comprising: a communication chip state acquisition module, configured to acquire a working state of a communication chip;
  • a fault judging module configured to determine, when the working state is a data sending state, whether a maintaining time of the data sending state exceeds a preset time threshold, and if yes, determining that the communication chip is faulty;
  • the fault elimination module is configured to set a current data transmission state of the bus transceiver connected to the communication chip to a data receiving state.
  • the fault determining module includes:
  • a first port signal acquisition submodule configured to acquire a level signal output by the transmission data port of the communication chip
  • a first determining sub-module configured to determine whether there is a level change in a level signal of each byte output by the transmitting data port in a first preset time, and if not, determining the data sending status The maintenance time exceeds the preset time threshold.
  • the fault determining module includes:
  • a second port signal acquisition sub-module configured to acquire a level signal outputted by a port on the communication chip that identifies an operating state of the chip
  • a second determining sub-module configured to determine whether there is a level change in the level signal output by the port that identifies the working state of the chip during the second preset time, and if not, determining the maintaining time of the data sending state The preset time threshold is exceeded.
  • the fault elimination module sets the transceiver to a data receiving state by setting a transceiver control port of the bus transceiver to a low level.
  • the technical solution provided by the present invention monitors the working state of the communication chip.
  • the current working state of the communication chip is the data transmission state
  • the current data transmission state continues to be monitored.
  • the duration exceeds the preset time threshold it is determined that the communication chip is faulty, and the current data transmission status of the bus transceiver connected to the communication chip is changed by
  • the data receiving state prevents the faulty chip from occupying the data bus for a long time, which causes the data to be confusing on the data bus when other communication modules on the data bus transmit data.
  • FIG. 1 is a schematic diagram of a module circuit of a slave control station in the prior art
  • FIG. 2 is a schematic flowchart of a method for implementing a PROFIBUS-DP protocol communication chip fault elimination implementation method according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of a module circuit of a slave control station according to an embodiment of the present invention.
  • FIG. 4 is a schematic diagram of a pin of a packaged chip of the fault determination logic of FIG. 3;
  • FIG. 5 is a schematic structural diagram of a PROFIBUS-DP protocol communication chip fault elimination implementation apparatus according to an embodiment of the present invention. detailed description
  • Step 201 Obtain an operating state of the communication chip.
  • Step 202 When the working state is a data sending state, determining whether the maintaining time of the data sending state exceeds a preset time threshold, and if yes, determining that the communication chip is faulty; Step 203: connecting the communication The current data transmission state of the chip's bus transceiver is set to the data reception state.
  • the communication chip by monitoring the working state of the communication chip, when it is determined that the current working state of the communication chip is the data transmission state, the time during which the current data transmission state continues is monitored. When the duration exceeds the preset time threshold, it is determined that the communication chip is faulty. At this time, the communication chip occupies the data bus for a long time. When other communication modules on the data bus send data, the data on the data bus will occur. confusion. When the communication chip fails, the current state of the bus transceiver connected to the communication chip is a data transmission state. In order to avoid the above situation, by changing the state of the bus transceiver to the data receiving state, the faulty chip releases the occupation of the data bus, thereby ensuring that other communication modules on the data bus can communicate normally, thereby improving the stability of the entire system.
  • the level signal outputted by the transmission data port of the communication chip is obtained; and whether the level signal of each byte output by the transmission data port is determined in the first preset time There is a level change, and if not, it is determined that the maintenance time of the data transmission state exceeds the preset time threshold.
  • the level signal outputted by the port that identifies the working state of the chip on the communication chip is obtained; and the level signal outputted by the port that identifies the working state of the chip is determined in the second preset time. Whether there is a level change, and if not, it is determined that the maintenance time of the data transmission state exceeds the preset time threshold.
  • the duration thresholds of the pre-set port working states are not necessarily the same for the port that sends the data port and the working state of the identifier chip. Therefore, the duration thresholds of the working states of the two ports are respectively The first preset time and the second preset time are distinguished.
  • the transceiver is set to data by setting the transceiver control port of the bus transceiver to a low level. Receive status.
  • the transceiver is set to the receiving state, the faulty chip can release the occupation of the data bus, thereby ensuring that other communication modules on the data bus can communicate normally, thereby improving the stability of the entire system.
  • the SPC3 chip is a dedicated chip for PROFIBUS-DP protocol communication and is usually set in the slave control station.
  • the RTS pin of the SPC3 chip in the control station is always maintained at a low level signal output state before the control station establishes a communication connection with the main control station; and when the communication connection is established from the control station and the main control station, The output level signal state of the RTS pin of the SPC3 chip in the control station is determined by the communication status from the control station and the main control station.
  • the level signal outputted by the RTS pin can determine the working state of the chip: When the SPC3 chip is in the transmitting state, the RTS pin output level signal on the chip is a high level signal; The RS485 interface transceiver module is in the transmitting state, and sends data to the bus. When the SPC3 is in the receiving state, the RTS pin output level signal on the chip is a low level signal; the RS485 interface transceiver module is in the receiving state, and the data sent by the main control station on the receiving line is received by the receiving terminal.
  • the TXD pin on the SPC3 chip is the transmit data terminal.
  • the PROFIBUS-DP protocol adopts the NRZ (Non Return to Zero Code) coding mode. During the bit duration, the binary signal 0 or 1 does not change. For a character, it is usually represented by 11 BITs on the PROFIBUS data bus. During transmission, the character representation format is as follows:
  • the transmission data port on the PROFIBUS-DP protocol communication chip or the port that identifies the working state of the chip can be monitored, and the level signal outputted by the corresponding port is judged to determine whether the communication chip is faulty.
  • FIG. 3 it is a schematic diagram of the circuit connection of the communication module of the slave control station in the embodiment of the present invention.
  • the fault determination logic is used to monitor the operating state of the SPC3 chip to determine whether the SPC3 chip has failed.
  • the input terminals of the fault judgment logic are respectively connected to the transmit data port TXD of the SPC3 chip and the port RTS which identifies the working state of the chip, and the output terminals of the fault judgment logic are respectively connected to the transceiver control terminals (RE, DE) of the two RS485 transceivers, and the fault judgment logic Through the RE, DE terminal
  • the control of the flat signal enables control of the operating state of the RS485 transceiver.
  • the RS485 transceiver When the SPC3 chip fails, the RS485 transceiver needs to be set to the receiving state. By changing the state of the RS485 transceiver to the data receiving state, the faulty SPC3 chip releases the occupation of the RS485 data bus, thereby ensuring other communications on the RS485 data bus.
  • the module can communicate normally, improving the stability of the entire system.
  • the transceiver control terminals (RE, DE) are usually set low. As shown in FIG.
  • the communication baud rate is obtained from the SPC3 chip by using a single chip microcomputer, and is provided to the fault judgment logic, and the fault judgment logic sets a packet data transmission timer according to different baud rates. And the parameters of the byte data transmission timer.
  • the packet data transmission timer is used to set a duration threshold of the transmit data port (TXD) working state; the byte data transmission timer is used to set a duration threshold of the port (RTS) working state that identifies the working state of the chip.
  • Figure 4 is a diagram showing the pinout of a packaged chip implementing the fault determination logic of Figure 3.
  • the MCU obtains the communication baud rate from SPC3. According to different baud rates, the MCU writes the baud rate information as a parameter through the RDBAUD_CS, RDDATALEN_CS, DB[07..00] pins to the fault judgment.
  • the fault judgment logic configures the parameters of the packet data transmission timer and the byte data transmission timer according to the baud rate parameter configuration, and then the fault determination logic starts detecting the levels of the TXD pin and the RTS pin of the SPC3 chip.
  • the data transmission enable T_EN pin of the fault determination logic is set to 0, thereby turning off the transmit switch and connecting the T_EN pin.
  • the RS485 transceiver is set to receive status.
  • the data transmission enable terminal T_EN controls the control signal outputted by the communication chip SPC3 to control the operating state of the RS485 transceiver. If the T_EN pin output is at a high level (set to 1), the control of the control RS485 transceiver output by the SPC3 chip is controlled.
  • the signal can be normally controlled to receive the RS485 transceiver as the data transmission state; if the T_EN pin outputs a low level (set to 0), the RS485 transceiver is forcibly set to the data reception state, and the control signal output of the SPC3 chip is no longer accepted. .
  • the fault judgment logic performs the baud rate parameter according to different baud rates. Configure, and start the byte data sending timer to detect whether there is a level jump in the length of the transmission data of the SPC3 chip in each byte (the serial port is l ibit ), if not, If the SPC3 chip serial port output pin is faulty, the data transmission enable terminal T_EN is cut off, so that when the SPC3 chip sends a fault, the RS485 transceiver can be set to the receiving state.
  • the fault determination logic determines whether the reset pin RST_L generates a reset level signal, and if a reset level signal is generated, re-initializes the register in the fault determination logic; if no reset level signal is generated,
  • the packet data transmission timer is configured to start the packet data transmission timer, and the packet data transmission timer is reloaded after the data is correctly transmitted.
  • the packet data transmission timer is The data transmission enable terminal T_EN is turned off, and the packet data transmission timer function is restarted until the next polling of the slave data transmission starts, thereby ensuring that the RS485 transceiver can be set to the reception state when the SPC3 chip transmits a failure.
  • the time during which the current data sending state continues is monitored, when the duration exceeds the preset time.
  • the communication chip occupies the data bus for a long time.
  • the communication chip fails, the current state of the bus transceiver connected to the communication chip is the data transmission state.
  • the faulty chip releases the occupation of the data bus, thereby ensuring that other communication modules on the data bus can communicate normally, thereby improving the stability of the entire system.
  • the above embodiment only takes the SPC3 chip as an example.
  • the chip needs to follow the PROFIBUS-DP protocol, that is, one character is represented by 11 BITs on the PROFIBUS bus.
  • the description of the character in the SPC3 chip is similar to that of the SPC3 chip. Therefore, the technical solution of the embodiment of the present invention may also be used.
  • the embodiment of the present invention further provides a PROFIBUS-DP protocol communication chip fault elimination implementation device, as shown in FIG. 5, which is a schematic structural diagram of the device, the device may specifically Includes:
  • a communication chip state acquiring module 501 configured to acquire an operating state of the communication chip
  • the fault judging module 502 is configured to determine, when the working state is a data sending state, whether the maintaining time of the data sending state exceeds a preset time threshold, and if yes, determining that the communications chip is faulty;
  • the fault elimination module 503 is configured to set a current data sending state of the bus transceiver connected to the communication chip to a data receiving state.
  • the fault determining module includes:
  • a first port signal acquisition submodule configured to acquire a level signal output by the transmission data port of the communication chip
  • a first determining sub-module configured to determine whether there is a level change in a level signal of each byte output by the transmitting data port in a first preset time, and if not, determining the data sending status The maintenance time exceeds the preset time threshold.
  • the fault determining module includes:
  • a second port signal acquisition sub-module configured to acquire a level signal outputted by a port on the communication chip that identifies an operating state of the chip
  • a second determining sub-module configured to determine whether there is a level change in the level signal output by the port that identifies the working state of the chip during the second preset time, and if not, determining the maintaining time of the data sending state The preset time threshold is exceeded.
  • the fault cancellation module sets the transceiver to a data receiving state by setting a transceiver control port of the bus transceiver to a low level.
  • the communication chip By monitoring the working state of the communication chip, when it is determined that the current working state of the communication chip is the data transmission state, the current data transmission state is monitored for a duration, and when the duration exceeds the preset time threshold, the communication is determined.
  • the chip fails. At this time, the communication chip occupies the data bus for a long time. When other communication modules on the data bus send data, the data on the data bus will be confused.
  • the communication chip fails, the current state of the bus transceiver connected to the communication chip is a data transmission state. In order to avoid the above situation, by changing the state of the bus transceiver to the data receiving state, the faulty chip releases the occupation of the data bus, thereby ensuring that other communication modules on the data bus can communicate normally, thereby improving the stability of the entire system.
  • the device embodiment since it basically corresponds to the method embodiment, it is described as a comparison, and the relevant parts can be referred to the description of the method embodiment.
  • the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, ie may be located One place, or it can be distributed to multiple network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment. Those of ordinary skill in the art can understand and implement without any creative effort.
  • the storage medium may be a magnetic disk, an optical disk, a read-only memory (ROM), or a random access memory (RAM).

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Maintenance And Management Of Digital Transmission (AREA)
  • Small-Scale Networks (AREA)

Description

通讯芯片故障消除实现方法及装置
本申请要求于 2010 年 6 月 1 日提交中国专利局、 申请号为 201010192620.1、 发明名称为 "通讯芯片故障消除实现方法及装置"的中国专 利申请的优先权, 其全部内容通过引用结合在本申请中。 技术领域 本发明涉及工业自动化技术领域, 更具体地说, 涉及一种 PROFIBUS-DP 协议通讯芯片故障消除实现方法及装置。 背景技术 现场总线是用于生产制造现场的最低层通信网络,它实现了微机化的现场 测量控制仪器或设备之间的双向串行多节点数字通信。 PROFIBUS-DP是底层 控制网络, 专为自动控制系统和设备级分散 I/O之间通信设计, 广泛应用于分 布式控制系统( Distributed Control System, DCS )的高速数据传输。 中央控制 器通过高速串行线同分散的现场设备(如 1/0、 驱动器等)进行通信。
现有技术中, PROFIBUS-DP采用 RS485传输技术, DCS系统中的各从控制 站通过 PROFIBUS-DP协议通讯专用芯片 SPC3、 CPLD (复杂可编辑逻辑器件) 以及 RS485总线组成的通信模块与主控制站通讯协议解析和物理层的数据流 传输功能, 具体的模块电路如图 1所示。
当从控制站处于发送数据状态时, SPC3芯片将单片机要传送的数据转换 为 PROFIBUS-DP协议规定的报文, 按照 PROFIBUS-DP协议的规定转换为相应 串行 BIT (比特) 流, 通过 SPC3芯片上的 TXD管脚将数据发出, 通过 CPLD将 一路数据信号分为两路信号,提供给两路 RS485总线分别进行数据传输。 RS485 负责将 BIT码转换成差分电平, 以满足总线传输的要求。
当从控制站处于接收数据状态时, SPC3芯片处于接收状态, 接收总线上 发送过来的数据。 RS485接口收发模块负责将总线上的差分信号转换为电平信 号, 通过 CPLD的 A/B选择逻辑, SPC3选择接收其中一路总线发送的信号, 并 对接收到的 BIT流, 进行解析, 组合成报文, 提供给单片机。
但是, 通过发明人的研究发现, 现有技术中仍然存在着以下缺点: 当某从控制站的通信模块发生故障时, RS485总线接口电路一直处于发 送状态, 则导致该从控制站的通信模块一直占有总线, 当总线上其它从控制站 的通信模块在发送数据时,将造成数据总线上的数据混乱, 系统的其它从控制 站的通信模块无法正常的收发数据, 从而导致整个系统无法正常工作。
发明内容
有鉴于此, 本发明实施例提供一种通讯芯片故障消除实现方法及装置, 当 通讯芯片发生故障占用通讯总线时, 能够快速切断故障芯片对通讯总线的占 用。
本发明实施例提供一种 PROFIBUS-DP协议通讯芯片故障消除实现方法, 所述方法包括:
获取通讯芯片的工作状态;
当所述工作状态为数据发送状态时,判断所述数据发送状态的维持时间是 否超过预置时间阈值, 如果是, 则确定所述通讯芯片发生故障;
将连接所述通讯芯片的总线收发器当前的数据发送状态设置为数据接收 状态。
优选的, 所述判断所述数据发送状态的维持时间是否超过预置时间阈值, 包括:
获取所述通讯芯片的发送数据端口输出的电平信号;
判断在第一预置时间内,所述发送数据端口输出的每个字节的电平信号中 是否有电平变化,如果否, 则确定所述数据发送状态的维持时间超过所述预置 时间阈值。
优选的, 所述判断所述数据发送状态的维持时间是否超过预置时间阈值, 包括:
获取所述通讯芯片上标识芯片工作状态的端口输出的电平信号; 判断在第二预置时间内,所述标识芯片工作状态的端口输出的电平信号中 是否有电平变化,如果否, 则确定所述数据发送状态的维持时间超过所述预置 时间阈值。
优选的,所述将连接所述通讯芯片的总线收发器当前的数据发送状态设置 为数据接收状态的实现方式为:
通过设置所述总线收发器的收发控制端口为低电平,将所述收发器设置为 数据接收状态。
一种 PROFIBUS-DP协议通讯芯片故障消除实现装置, 所述装置包括: 通讯芯片状态获取模块, 用于获取通讯芯片的工作状态;
故障判断模块, 用于当所述工作状态为数据发送状态时, 判断所述数据发 送状态的维持时间是否超过预置时间阈值, 如果是, 则确定所述通讯芯片发生 故障;
故障消除模块,用于将连接所述通讯芯片的总线收发器当前的数据发送状 态设置为数据接收状态。
优选的, 所述故障判断模块包括:
第一端口信号获取子模块,用于获取所述通讯芯片的发送数据端口输出的 电平信号;
第一判断子模块, 用于判断在第一预置时间内, 所述发送数据端口输出的 每个字节的电平信号中是否有电平变化,如果否, 则确定所述数据发送状态的 维持时间超过所述预置时间阈值。
优选的, 所述故障判断模块包括:
第二端口信号获取子模块,用于获取所述通讯芯片上标识芯片工作状态的 端口输出的电平信号;
第二判断子模块, 用于判断在第二预置时间内, 所述标识芯片工作状态的 端口输出的电平信号中是否有电平变化,如果否, 则确定所述数据发送状态的 维持时间超过所述预置时间阈值。
优选的,所述故障消除模块通过设置所述总线收发器的收发控制端口为低 电平, 将所述收发器设置为数据接收状态。
同现有技术相比, 本发明提供的技术方案中,对通讯芯片的工作状态进行 监测, 当确定通讯芯片当前的工作状态是数据发送状态时, 则对当前数据发送 状态持续的时间进行监测, 当持续时间超过预置时间阈值时, 则确定该通讯芯 片发生故障,通过改变连接所述通讯芯片的总线收发器的当前数据发送状态为 数据接收状态,从而避免故障芯片长时间占用数据总线, 而导致当数据总线上 的其他通讯模块发送数据时, 造成数据总线上数据混乱的情形的出现。 附图说明 为了更清楚地说明本发明实施例的技术方案,下面将对实施例或现有技术 描述中所需要使用的附图作筒单地介绍,显而易见地, 下面描述中的附图仅仅 是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动 的前提下, 还可以根据这些附图获得其他的附图。
图 1为现有技术中从控制站的模块电路示意图;
图 2为本发明实施例提供的一种 PROFIBUS-DP协议通讯芯片故障消除实 现方法步骤流程示意图;
图 3为本发明实施例提供的从控制站的模块电路示意图;
图 4为图 3中故障判断逻辑的封装芯片的管脚示意图;
图 5为本发明实施例提供的一种 PROFIBUS-DP协议通讯芯片故障消除实 现装置的结构示意图。 具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清 楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而不是 全部的实施例。基于本发明中的实施例, 本领域普通技术人员在没有做出创造 性劳动前提下所获得的所有其他实施例, 都属于本发明保护的范围。 进行说明, 参照图 2所示, 所述方法包括:
步骤 201、 获取通讯芯片的工作状态;
步骤 202、 当所述工作状态为数据发送状态时, 判断所述数据发送状态的 维持时间是否超过预置时间阈值, 如果是, 则确定所述通讯芯片发生故障; 步骤 203、 将连接所述通讯芯片的总线收发器当前的数据发送状态设置为 数据接收状态。
本发明实施例中,通过对通讯芯片的工作状态进行监测, 当确定通讯芯片 当前的工作状态是数据发送状态时,则对当前数据发送状态持续的时间进行监 测, 当持续时间超过预置时间阈值时, 则确定该通讯芯片发生故障, 这时, 通 讯芯片长时间占用数据总线, 当数据总线上的其他通讯模块发送数据时,将造 成数据总线上数据发生混乱。 当通讯芯片发生故障时, 连接所述通讯芯片的总 线收发器的当前状态为数据发送状态。 为了避免上述情形的出现,通过改变总 线收发器的状态为数据接收状态,使得故障芯片释放对数据总线的占用,从而 保证数据总线上的其他通讯模块可以正常通讯, 提高整个系统的稳定性。
在本发明的一个优选实施例中,判断所述数据发送状态的维持时间是否超 过预置时间阈值的具体实现方式可以有以下两种:
在第一种实现方式中,通过获取所述通讯芯片的发送数据端口输出的电平 信号; 判断在第一预置时间内, 所述发送数据端口输出的每个字节的电平信号 中是否有电平变化,如果否, 则确定所述数据发送状态的维持时间超过所述预 置时间阈值。
在第二种实现方式中 ,通过获取所述通讯芯片上标识芯片工作状态的端口 输出的电平信号; 判断在第二预置时间内, 所述标识芯片工作状态的端口输出 的电平信号中是否有电平变化,如果否, 则确定所述数据发送状态的维持时间 超过所述预置时间阈值。
需要说明的是, 上述两种实现方式可以单独使用, 也可以同时使用, 即同 时监测通讯芯片的发送数据端口和标识芯片工作状态的端口的电平信号,使得 对于通讯芯片的故障判断更为准确。
其中,对于发送数据端口和标识芯片工作状态的端口,根据 PROFIBUS-DP 协议, 预先设定的端口工作状态的持续时间阈值不一定相同, 因此, 对于两个 端口的工作状态的持续时间阈值分别以第一预置时间和第二预置时间进行区 分。
当确定通讯芯片发生故障,通讯芯片长时间占用数据总线时,在本发明的 一个优选实施例中,通过设置所述总线收发器的收发控制端口为低电平,将所 述收发器设置为数据接收状态。 当收发器被设置为接收状态时, 可以使得故障 芯片释放对数据总线的占用,从而保证数据总线上的其他通讯模块可以正常通 讯, 提高整个系统的稳定性。 下面通过一个具体实例对本发明实施例的技术方案进行解释说明。
SPC3芯片是 PROFIBUS-DP协议通讯专用芯片,通常设置于从控制站中。 从控制站在未和主控制站建立通讯连接之前,从控制站中的 SPC3芯片的 RTS 管脚始终维持为低电平信号输出状态;而当从控制站和主控制站建立通讯连接 之后,从控制站中的 SPC3芯片的 RTS管脚的输出电平信号状态则由从控制站 和主控制站的通讯状态决定。对于 SPC3芯片来说,通过 RTS管脚输出的电平 信号可以判断该芯片的工作状态: 当 SPC3芯片处于发送状态时, 该芯片上的 RTS管脚输出电平信号为高电平信号; 此时, RS485接口收发模块处于发送状 态, 由其向总线上发送数据。 当 SPC3处于接收状态时, 该芯片上的 RTS管脚 输出电平信号为低电平信号; RS485接口收发模块处于接收状态, 由其接收总 线上由主控制站下发的数据。
除此之外, SPC3芯片上的 TXD管脚是发送数据端, 按照 PROFIBUS-DP 协议规定, 如果芯片功能正常, 在发送状态时, TXD 管脚在规定的时间内存 在电平变化, 这是由于: PROFIBUS-DP协议采用 NRZ (不归零码)编码方式, 在位持续时期, 二值信号 0或 1不改变。 对于一个字符, 在 PROFIBUS数据 总线上通常利用 11个 BIT来表示, 传输过程中, 字符的表示格式如下:
表 1
Figure imgf000008_0001
可见, 在这 11个 BIT中, 至少存在一个电平信号由 0到 1的跳变。
由此,可以通过对 PROFIBUS-DP协议通讯芯片上的发送数据端口或标识 芯片工作状态的端口进行监测,通过相应端口输出的电平信号, 判断确定通讯 芯片是否发生故障。
如图 3所示, 为本发明实施例中的从控制站通讯模块电路连接示意图。在 图 3中, 故障判断逻辑用于监测 SPC3芯片的工作状态, 从而判断 SPC3芯片 是否发生故障。 故障判断逻辑的输入端分别连接 SPC3 芯片的发送数据端口 TXD和标识芯片工作状态的端口 RTS, 故障判断逻辑的输出端分别连接两路 RS485收发器的收发控制端 (RE、 DE ), 故障判断逻辑通过对 RE、 DE端电 平信号的控制,从而实现对 RS485收发器工作状态的控制。 当 SPC3芯片发生 故障时, 需要将 RS485收发器设置为接收状态, 通过改变 RS485收发器的状 态为数据接收状态,使得故障 SPC3芯片释放对 RS485数据总线的占用,从而 保证 RS485数据总线上的其他通讯模块可以正常通讯, 提高整个系统的稳定 性。 当需要将 RS485 收发器的状态设置为数据接收状态时, 通常将收发控制 端 (RE、 DE )置为低电平。 如图 3所示, 需要说明的是, 本发明实施例中, 利用单片机从 SPC3芯片 获取通讯波特率,提供给故障判断逻辑,故障判断逻辑根据不同的波特率设定 包数据发送定时器和字节数据发送定时器的参数。包数据发送定时器用于设置 发送数据端口 ( TXD )工作状态的持续时间阈值; 字节数据发送定时器用于设 置标识芯片工作状态的端口 (RTS )工作状态的持续时间阈值。
图 4示出的是实现图 3中故障判断逻辑的封装芯片的管脚示意图。上电初 始化后, 单片机从 SPC3获取通讯波特率, 根据不同的波特率, 单片机将波特 率信息以参数的方式通过 RDBAUD_CS、 RDDATALEN_CS、 DB[07..00]管脚 写入到故障判断逻辑中,故障判断逻辑根据波特率参数配置,设定包数据发送 定时器、 字节数据发送定时器的参数, 之后, 故障判断逻辑开始检测 SPC3芯 片的 TXD管脚和 RTS管脚的电平信号, 如果发现异常, 即: 两个定时器中有 任何一个发生超时,则将故障判断逻辑上的数据发送使能端 T_EN管脚置为 0, 从而关断发送开关, 使T_EN管脚连接的 RS485收发器设置为接收状态。 这 里,数据发送使能端 T_EN控制由通讯芯片 SPC3输出的控制 RS485收发器工 作状态的控制信号, 如果 T_EN管脚输出为高电平 (置 1 ) , 则 SPC3芯片输 出的控制 RS485收发器的控制信号可以正常的控制收 RS485收发器为数据发 送状态; 如果 T_EN管脚输出低电平(置 0 ) , 则 RS485收发器被强制设置为 数据接收状态, 不再接受 SPC3芯片输出的控制信号的控制。
需要说明的是, 当对 SPC3芯片的 TXD管脚和 RTS管脚的输出电平信号 均进行监测时, 则当 SPC3 芯片上电后, 故障判断逻辑根据不同的波特率进 行波特率参数的配置, 并启动字节数据发送定时器, 检测 SPC3芯片的发送数 据在每个字节 (串口为 l ibit ) 的时间长度内是否存在电平的跳变, 如果否, 则认为 SPC3芯片串口输出引脚存在故障, 则切断数据发送使能端 T_EN, 从 而保证当 SPC3芯片发送故障时, 可以将 RS485收发器设置为接收状态。
上述监测过程进行的同时, 故障判断逻辑判断复位管脚 RST_L是否产生 复位电平信号,如果产生复位电平信号, 则重新进行故障判断逻辑中寄存器的 初始化; 如果没有产生复位电平信号, 则对包数据发送定时器进行配置, 启动 包数据发送定时器,在正确发送数据后重新装载包数据发送定时器,如果发送 数据完成后, 数据发送使能端T_EN仍然没有复位, 则包数据发送定时器切断 数据发送使能端T_EN, 直到下一次轮询到该从站数据发送开始时, 再次启动 包数据发送定时器功能, 从而保证当 SPC3 芯片发送故障时, 可以将 RS485 收发器设置为接收状态。
可见, 上述实施例中, 通过对通讯芯片的工作状态进行监测, 当确定通讯 芯片当前的工作状态是数据发送状态时,则对当前数据发送状态持续的时间进 行监测, 当持续时间超过预置时间阈值时,则确定该通讯芯片发生故障,这时, 通讯芯片长时间占用数据总线, 当数据总线上的其他通讯模块发送数据时, 将 造成数据总线上数据发生混乱。 当通讯芯片发生故障时, 连接所述通讯芯片的 总线收发器的当前状态为数据发送状态。 为了避免上述情形的出现,通过改变 总线收发器的状态为数据接收状态,使得故障芯片释放对数据总线的占用,从 而保证数据总线上的其他通讯模块可以正常通讯, 提高整个系统的稳定性。 上述实施例仅以 SPC3 芯片为例, 当然, 如果有其它的可以实现 PROFIBUS-DP协议的芯片, 由于芯片需要遵循 PROFIBUS-DP协议, 即对于 一个字符在 PROFIBUS总线上利用 11个 BIT来表示, 格式同 SPC3芯片中字 符的表示方法相类似, 因此, 也可以采用本发明实施例技术方案, 对此, 本发 明不再进行赘述。
相应上述 PROFIBUS-DP协议通讯芯片故障消除实现方法,本发明实施例 还提供了一种 PROFIBUS-DP协议通讯芯片故障消除实现装置, 如图 5所示, 为该装置的结构示意图, 该装置具体可以包括:
通讯芯片状态获取模块 501 , 用于获取通讯芯片的工作状态; 故障判断模块 502, 用于当所述工作状态为数据发送状态时, 判断所述数 据发送状态的维持时间是否超过预置时间阈值,如果是, 则确定所述通讯芯片 发生故障;
故障消除模块 503 , 用于将连接所述通讯芯片的总线收发器当前的数据发 送状态设置为数据接收状态。
在本发明的一个优选实施例中, 所述故障判断模块包括:
第一端口信号获取子模块,用于获取所述通讯芯片的发送数据端口输出的 电平信号;
第一判断子模块, 用于判断在第一预置时间内, 所述发送数据端口输出的 每个字节的电平信号中是否有电平变化,如果否, 则确定所述数据发送状态的 维持时间超过所述预置时间阈值。
在本发明的另一个优选实施例中, 所述故障判断模块包括:
第二端口信号获取子模块,用于获取所述通讯芯片上标识芯片工作状态的 端口输出的电平信号;
第二判断子模块, 用于判断在第二预置时间内, 所述标识芯片工作状态的 端口输出的电平信号中是否有电平变化,如果否, 则确定所述数据发送状态的 维持时间超过所述预置时间阈值。
其中,所述故障消除模块通过设置所述总线收发器的收发控制端口为低电 平, 将所述收发器设置为数据接收状态。
通过对通讯芯片的工作状态进行监测,当确定通讯芯片当前的工作状态是 数据发送状态时, 则对当前数据发送状态持续的时间进行监测, 当持续时间超 过预置时间阈值时, 则确定该通讯芯片发生故障, 这时, 通讯芯片长时间占用 数据总线, 当数据总线上的其他通讯模块发送数据时,将造成数据总线上数据 发生混乱。 当通讯芯片发生故障时, 连接所述通讯芯片的总线收发器的当前状 态为数据发送状态。 为了避免上述情形的出现,通过改变总线收发器的状态为 数据接收状态,使得故障芯片释放对数据总线的占用,从而保证数据总线上的 其他通讯模块可以正常通讯, 提高整个系统的稳定性。 对于装置实施例而言, 由于其基本相应于方法实施例, 所以描述得比较筒 单,相关之处参见方法实施例的部分说明即可。 以上所描述的装置实施例仅仅 是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上 分开的,作为单元显示的部件可以是或者也可以不是物理单元, 即可以位于一 个地方, 或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的 部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出 创造性劳动的情况下, 即可以理解并实施。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程, 是可以通过计算机程序来指令相关的硬件来完成,所述的程序可存储于计算机 可读取存储介质中, 该程序在执行时, 可包括如上述各方法的实施例的流程。 其中,所述的存储介质可为磁碟、光盘、只读存储记忆体(Read-Only Memory, ROM )或随机存储记忆体(Random Access Memory, RAM )等。
对所公开的实施例的上述说明,使本领域专业技术人员能够实现或使用本 发明。 对这些实施例的多种修改对本领域的专业技术人员来说将是显而易见 的,本文中所定义的一般原理可以在不脱离本发明实施例的精神或范围的情况 下, 在其它实施例中实现。 因此, 本发明实施例将不会被限制于本文所示的这 些实施例, 而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。

Claims

权 利 要 求
1、 一种 PROFIBUS-DP协议通讯芯片故障消除实现方法, 其特征在于, 所述方法包括:
获取通讯芯片的工作状态;
当所述工作状态为数据发送状态时,判断所述数据发送状态的维持时间是 否超过预置时间阈值, 如果是, 则确定所述通讯芯片发生故障;
将连接所述通讯芯片的总线收发器当前的数据发送状态设置为数据接收 状态。
2、 根据权利要求 1所述的 PROFIBUS-DP协议通讯芯片故障消除实现方 法, 其特征在于, 所述判断所述数据发送状态的维持时间是否超过预置时间阈 值, 包括:
获取所述通讯芯片的发送数据端口输出的电平信号;
判断在第一预置时间内,所述发送数据端口输出的每个字节的电平信号中 是否有电平变化,如果否, 则确定所述数据发送状态的维持时间超过所述预置 时间阈值。
3、 根据权利要求 1所述的 PROFIBUS-DP协议通讯芯片故障消除实现方 法, 其特征在于, 所述判断所述数据发送状态的维持时间是否超过预置时间阈 值, 包括:
获取所述通讯芯片上标识芯片工作状态的端口输出的电平信号; 判断在第二预置时间内,所述标识芯片工作状态的端口输出的电平信号中 是否有电平变化,如果否, 则确定所述数据发送状态的维持时间超过所述预置 时间阈值。
4、 根据权利要求 1~3中任一项所述的 PROFIBUS-DP协议通讯芯片故障 消除实现方法, 其特征在于, 所述将连接所述通讯芯片的总线收发器当前的数 据发送状态设置为数据接收状态的实现方式为:
通过设置所述总线收发器的收发控制端口为低电平,将所述收发器设置为 数据接收状态。
5、 一种 PROFIBUS-DP协议通讯芯片故障消除实现装置, 其特征在于, 所述装置包括:
通讯芯片状态获取模块, 用于获取通讯芯片的工作状态;
故障判断模块, 用于当所述工作状态为数据发送状态时, 判断所述数据发 送状态的维持时间是否超过预置时间阈值, 如果是, 则确定所述通讯芯片发生 故障;
故障消除模块,用于将连接所述通讯芯片的总线收发器当前的数据发送状 态设置为数据接收状态。
6、 根据权利要求 5所述的 PROFIBUS-DP协议通讯芯片故障消除实现装 置, 其特征在于, 所述故障判断模块包括:
第一端口信号获取子模块,用于获取所述通讯芯片的发送数据端口输出的 电平信号;
第一判断子模块, 用于判断在第一预置时间内, 所述发送数据端口输出的 每个字节的电平信号中是否有电平变化,如果否, 则确定所述数据发送状态的 维持时间超过所述预置时间阈值。
7、 根据权利要求 5所述的 PROFIBUS-DP协议通讯芯片故障消除实现装 置, 其特征在于, 所述故障判断模块包括:
第二端口信号获取子模块,用于获取所述通讯芯片上标识芯片工作状态的 端口输出的电平信号;
第二判断子模块, 用于判断在第二预置时间内, 所述标识芯片工作状态的 端口输出的电平信号中是否有电平变化,如果否, 则确定所述数据发送状态的 维持时间超过所述预置时间阈值。
8、 根据权利要求 5~7中任一项所述的 PROFIBUS-DP协议通讯芯片故障 消除实现装置, 其特征在于, 所述故障消除模块通过设置所述总线收发器的收 发控制端口为低电平, 将所述收发器设置为数据接收状态。
PCT/CN2011/072359 2010-06-01 2011-03-31 通讯芯片故障消除实现方法及装置 WO2011150717A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201010192620.1A CN101854258B (zh) 2010-06-01 2010-06-01 通讯芯片故障消除实现方法及装置
CN201010192620.1 2010-06-01

Publications (1)

Publication Number Publication Date
WO2011150717A1 true WO2011150717A1 (zh) 2011-12-08

Family

ID=42805538

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/072359 WO2011150717A1 (zh) 2010-06-01 2011-03-31 通讯芯片故障消除实现方法及装置

Country Status (2)

Country Link
CN (1) CN101854258B (zh)
WO (1) WO2011150717A1 (zh)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101854258B (zh) * 2010-06-01 2013-01-23 杭州和利时自动化有限公司 通讯芯片故障消除实现方法及装置
CN106844125B (zh) * 2015-12-03 2019-05-31 昆达电脑科技(昆山)有限公司 待测试机台除错信息的自动录制装置及方法
TW202022620A (zh) * 2018-12-05 2020-06-16 新唐科技股份有限公司 處理裝置和更改腳位功能方法
CN110119111B (zh) * 2019-02-26 2021-04-16 北京龙鼎源科技股份有限公司 通信方法及装置、存储介质、电子装置
CN110825062B (zh) * 2019-11-29 2021-04-09 北京首钢冷轧薄板有限公司 一种带钢清洗段信号的应急处理系统及方法
CN111557652A (zh) * 2020-03-23 2020-08-21 广东艾诗凯奇智能科技有限公司 人体健康数据传输方法及其相关设备、存储装置
CN112615761B (zh) * 2020-12-18 2022-05-31 杭州和利时自动化有限公司 一种总线监控系统

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2537177Y (zh) * 2002-02-06 2003-02-19 华为技术有限公司 一种串口防吊死电路
CN2588681Y (zh) * 2002-05-30 2003-11-26 清华同方股份有限公司 一种总线耦合电路
CN2705956Y (zh) * 2004-06-07 2005-06-22 上海电器科学研究所(集团)有限公司 一种执行器传感器网关
CN101854258A (zh) * 2010-06-01 2010-10-06 杭州和利时自动化有限公司 通讯芯片故障消除实现方法及装置

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP2998894B1 (en) * 2005-07-11 2021-09-08 Brooks Automation, Inc. Intelligent condition monitoring and fault diagnostic system
CN201000569Y (zh) * 2007-01-15 2008-01-02 大连光洋科技工程有限公司 在环形总线数控系统中实现总线控制器功能的专用芯片
CN101635652B (zh) * 2009-09-07 2012-11-28 杭州华三通信技术有限公司 多核系统的故障恢复方法和设备

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN2537177Y (zh) * 2002-02-06 2003-02-19 华为技术有限公司 一种串口防吊死电路
CN2588681Y (zh) * 2002-05-30 2003-11-26 清华同方股份有限公司 一种总线耦合电路
CN2705956Y (zh) * 2004-06-07 2005-06-22 上海电器科学研究所(集团)有限公司 一种执行器传感器网关
CN101854258A (zh) * 2010-06-01 2010-10-06 杭州和利时自动化有限公司 通讯芯片故障消除实现方法及装置

Also Published As

Publication number Publication date
CN101854258A (zh) 2010-10-06
CN101854258B (zh) 2013-01-23

Similar Documents

Publication Publication Date Title
WO2011150717A1 (zh) 通讯芯片故障消除实现方法及装置
EP0939511B1 (en) Method and arrangement in a network repeater for automatically changing link speed
US9740655B2 (en) Data transmission using a protocol exception state
KR101519793B1 (ko) 차량용 네트워크 시스템 및 이 시스템 내 이종 통신 제어기의 데이터 전송 방법
US7657691B2 (en) Simplified universal serial bus (USB) hub architecture
US8812759B2 (en) Bus subscriber device for connection to a line-redundant data bus, and method for controlling the communication of a bus subscriber with a line-redundant serial data bus
CN106817264B (zh) 一种链路故障检测的方法、装置和系统
JPS6333945A (ja) ロ−カルエリアデ−タデイストリビユ−シヨンシステム
US20120327950A1 (en) Method for Transmitting Data Packets
CN103684716A (zh) 在可冗余操作的工业通信网络中传输消息的方法和可冗余操作的工业通信网络的通信设备
US10635518B2 (en) Detecting bus faults
EP2985955B1 (en) Controller area network (can) device and method for emulating classic can error management
CN107612800A (zh) 一种连接profibus冗余网络与单总线网络的y型转换设备的实现方法及控制装置
CN105591817B (zh) 一种协商模式处理方法及智能网络设备
US20190260640A1 (en) Port auto-negotiation method and device
US7389469B2 (en) Bus systems, apparatuses, and methods of operating a bus
CA2668671A1 (en) Serial communications protocol for safety critical systems
EP2940935B1 (en) Controller area network (CAN) device and method for controlling CAN traffic
US7130271B1 (en) Relaying apparatus
US20210058495A1 (en) Communication device, communication system, and protocol switchover method
CN104541479B (zh) 通信控制器
CN115733729B (zh) 通信故障处理方法、系统及设备
CN106664231A (zh) 具有检验功能的传输单元
CN104135411A (zh) 一种基于rs232接口多节点通信的实现装置及方法
JP2000134216A (ja) 通信制御装置及び通信制御方法

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: 11789096

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11789096

Country of ref document: EP

Kind code of ref document: A1