矿用新能源电机车CAN通信网络软件优化方法

Software optimization method of CAN communication network for mine-used new energy electric locomotive

  • 摘要: 针对矿用新能源电机车CAN节点发送错误造成关键信息丢失的隐患,在TTCAN协议的基础上提出了CAN总线发送容错方法,即对CAN节点发送失败的报文重新发送,当发送成功或者达到预设的最大重发次数后退出该报文的发送;给出了一种CAN总线高效接收、处理报文方法,在中断接收报文期间对报文进行缓存操作,同时修改接收到的报文数量,主程序以此为依据逐条对存放在缓冲区的报文进行后续处理,实现了报文接收与处理的分时操作。测试结果表明,该优化方法可有效提高CAN总线通信的实时性和可靠性,同时减小了各CAN节点CPU开销,提高了工作效率。

     

    Abstract: In order to avoid missing key message caused by sending fault of CAN node in mine-used new energy electric locomotive, a sending fault tolerant method of CAN bus based on TTCAN protocol was proposed, that is, message sent unsuccessfully by CAN node will be resent until the message is sent successfully or resending times reach the maximum resending times. At the same time, a high-efficient receiving and processing message method of CAN bus was proposed. Message is cached during interrupt receiving message, meanwhile, amount of received message is modified, and message in cache is processed by main program based on the modified amount, which realizes time-sharing operation between receiving and processing of message. The test results show that the optimization method can improve real-time ability and reliability of CAN bus communication effectively, decrease working time of CPU in each CAN node and improve working efficiency.

     

/

返回文章
返回