节点文献

Windows CE嵌入式操作系统下的CANopen主站实现方案及其应用研究

The Solution and Application Research of CANopen Master Based on Windows CE

【作者】 高旭

【导师】 王志刚;

【作者基本信息】 河北工业大学 , 通信与信息系统, 2007, 硕士

【摘要】 CAN总线最早是由德国Bosch公司为汽车应用而开发的,由于它具备多主访问,实时性、纠错和抗干扰能力强的特点,已经成为最有前途的现场总线之一。标准化的CAN高层协议CANopen,由CiA负责起草和日常的维护工作。由于它高度的开放性和灵活性,CANopen正在被广泛地应用于机械制造、医疗设备、铁路运输、建筑工程和海事电子等众多领域中。本文从物理电气特性、帧格式、冲突和仲裁机制以及错误处理和故障界定等不同角度出发,重点地介绍了CAN通信的核心特色和优势;以协议模型研究和模块分析为手段,深入分析了CANopen的通信机制的内容和特点,从而为进行CANopen主站规划和主站开发奠定了坚实的协议基础。遵循嵌入式软件设计一般方法,按照面向对象的设计原则,本文合理地规划了CANopen主站软件结构,使通信和应用分离,通信模块以C++通用类的方式提供给应用类去调用,应用中只需要在包含通信类文件的基础上简单地创建实例即可实现基本的CANopen通信功能。在主站开发过程中,首先解决了在Windows CE嵌入式操作系统下如何实现高精度定时和软件定时复用的问题。然后在此基础上,依照协议标准实现了CANopen通信框架和应用接口。经反复测试, PDO、SDO、SYNC、NMT等各种通信对象数据收发正常。最后,给出了CANopen主站的的应用实例,说明了应用中需要解决的一些问题。在系统软件设计中,由于采用了面向对象的设计方法,开发的CANopen主站代码可以非常容易移植到其他PC/IPC平台上,满足各种不同场合的控制需要,做到易维护性、稳定性、可移植性三者的有机统一。

【Abstract】 CAN(Controller Area Network) has been the most dominant field bus which was originally developed by Bosch for use in automobiles, with the characteristics of multi-master accessing, real-time capability, error correction, high noise immunity. CANopen is a standard CAN-based high-layer protocol which is sponsored and maintained by CiA(CAN in Automation). By virtue of its openness and flexibility, CANopen is used wildly in machine building, medical technology, rail vehicles, building automation and maritime application.The kernel features and advantages of CAN, from physical and electrical character, frame format, collision and arbitration to error handling and error confinement are introduced in this paper. Based on modeling research and module analysis, the contents and characteristics of CANopen communication mechanism are analyzed so as to establish a solid foundation for CANopen master design and development. Conforming to the common methods of embedded software design and according to the principle of object-oriented design, we arrange the software architecture properly, setting communication and application apart so that communication module presents as C++ general class which is called by the application clsss. The application class only has to include the communication class file to complete basic CANopen communication function.During the development of CANopen master, we firstly solve the problem of high resolution timer and its multi-use, based on that, we realize the CANopen communication frame and application interfaces. After testing repeatedly, PDO, SDO, SYNC and NMT communication objects transmit and receive correctly. At last, an instance is provided and problems in application are discussed. With an object-oriented design, the CANopen master software implements the basic CANopen communication function, and it is easy to maintain, stable, portable, and could be easily adapted to different PC/IPC-based hardware platforms and used in many kinds of control backgrounds.

【关键词】 CANCANopen主站Windows CE面向对象设计
【Key words】 CANCANopen masterWindows CEObject-oriented design
  • 【分类号】TP273
  • 【被引频次】6
  • 【下载频次】302
节点文献中: