Windows CE嵌入式操作系统下的CANopen主站实现方案及其应用研究
详细信息    本馆镜像全文|  推荐本文 |  |   获取CNKI官网全文
摘要
CAN总线最早是由德国Bosch公司为汽车应用而开发的,由于它具备多主访问,实时性、纠错和抗干扰能力强的特点,已经成为最有前途的现场总线之一。标准化的CAN高层协议CANopen,由CiA负责起草和日常的维护工作。由于它高度的开放性和灵活性,CANopen正在被广泛地应用于机械制造、医疗设备、铁路运输、建筑工程和海事电子等众多领域中。
     本文从物理电气特性、帧格式、冲突和仲裁机制以及错误处理和故障界定等不同角度出发,重点地介绍了CAN通信的核心特色和优势;以协议模型研究和模块分析为手段,深入分析了CANopen的通信机制的内容和特点,从而为进行CANopen主站规划和主站开发奠定了坚实的协议基础。遵循嵌入式软件设计一般方法,按照面向对象的设计原则,本文合理地规划了CANopen主站软件结构,使通信和应用分离,通信模块以C++通用类的方式提供给应用类去调用,应用中只需要在包含通信类文件的基础上简单地创建实例即可实现基本的CANopen通信功能。
     在主站开发过程中,首先解决了在Windows CE嵌入式操作系统下如何实现高精度定时和软件定时复用的问题。然后在此基础上,依照协议标准实现了CANopen通信框架和应用接口。经反复测试, PDO、SDO、SYNC、NMT等各种通信对象数据收发正常。最后,给出了CANopen主站的的应用实例,说明了应用中需要解决的一些问题。在系统软件设计中,由于采用了面向对象的设计方法,开发的CANopen主站代码可以非常容易移植到其他PC/IPC平台上,满足各种不同场合的控制需要,做到易维护性、稳定性、可移植性三者的有机统一。
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.
引文
[1] 史久根,张培仁,陈真勇.CAN现场总线系统设计技术.北京:国防工业出版社,2004:250~264
    [2] Olaf Pfeiffer, Andrew Ayre, Christian Keydel. Embedded Networking with CAN and CANopen. RTC Books, 2003.
    [3] 何宗键.Windows CE嵌入式系统. 北京航空航天大学出版社,2006,9:9~10.
    [4] BOSCH.CAN Specification 2.0 Part A.1991
    [5] BOSCH.CAN Specification 2.0 Part B.1991
    [6] Konrad Etschberger.Controller Area Network.IXXAT Automation Gmbh,2001, 8:15:18.
    [7] 蒋建文,林勇,韩江洪.CAN 总线及其应用技术[J].微计算机信息,2002,18(9):3~5
    [8] 邬宽明.CAN 总线系统设计中的几个问题.电子技术应用,1998,9:18~20
    [9] 饶运涛,邹继军,郑勇芸.现场总线 CAN 原理与应用技术.北京:北京航空航天大学出版社,2006:18~38.
    [10] 田希晖.CAN 总线及其应用技术[J].微计算机信息,2002,18(9):3~5
    [11] 王俊波,胥布工. 《CANopen协议分析与实现》,《微计算机信息》(嵌入式与SOC), 2006,6-2:104~106
    [12] CANopen Application Layer and Communication Profile.CiA Draft Standard 301 V4.02,2002
    [13] 叶浩峰.CANopen 总线的原理以及实现:[硕士学位论文]广东:华南理工大学,2005
    [14] 于锋.计算机网络与数据通信.北京:中国水利水电出版社,2003,8:105~107
    [15] 吴爱国,刘莉.CAN 总线控制系统的应用层协议 CANopen 剖析.微计算机信息,2003,19(3):27~29
    [16] 王桂荣,钱剑敏.CAN 总线和基于 CAN 总线的高层协议.计算机测量与控制,2003,11(5):391~394
    [17] Advantech.UNO-2052 user manual. 2004.
    [18] 林涛.嵌入式系统 Windows CE 的研究.微计算机信息,2006,22(6):91~93
    [19] 钱能.C++程序设计教程.北京:清华大学出版社,1999,4:234~235
    [20] 杨新照,胡海江,张凤登,孟庆栋.WinCE多线程编程技术在无纸记录仪中的应用.仪表技术,2006,1:48~49
    [21] 路明.对 WindowsNT 核心的实时性能的分析与测试.计算机工程与应用,2000,12: 61~62
    [22] 凌有铸,徐晓光,潘伟.基于 WinCE 的嵌入式远程实时监控系统.计算机技术与发展,2007,17(7):204~208
    [23] 杨军波 , 须文波 . 基于 WinCE 环境的 CAN 设配卡驱动程序的设计与实现 . 微计算机信息,2005,21(12):26~2
    [24] [美]Jeffrey Richter著.王建华,张焕生,侯丽坤等译.Windows 核心编程.北京:机械工业出版社,2006,9:121~130
    [25] 王锦标.现场总线综述.冶金自动化,1998,22(6):64~66
    [26] 李庆诚,唐德凯.嵌入式操作系统实时性比对与评价.单片机与嵌入式系统应用,2007,6:18~21
    [27] 景小荣,郭进,刘利芳.基于 WindowsNT 铁路调度监督系统实时性研究.兰州铁道学院学报,2002,21(6):37~40
    [28] 马维昊.广域网技术在铁路调度监督系统中的应用研究.铁道学报,1996,12:4~6
    [29] CANopen Framework for CANopen Managers and Programmable CANopen Devices.CiA Draft Standard Proposal 302 V3.2.1,2003
    [30] CANopen: high-level protocol for CAN-bus.NIKHEF internal documentation,2000
    [31] CANopen Electronic data sheet specification for CANopen.CiA Draft Standard 306 V1.3,2005
    [32] Interfacing CANopen with TCP/IP.CiA Draft Standard 309 V1.1,2006
    [33] CANopen Framework for Maritime Electronics.CiA Draft Standard 307 V1.0.1,2002
    [34] CANopen Device Profile for Generic I/O Modules.CiA Draft Standard 401 V2.1,2002
    [35] Mirko Tischer.Master And Slave In The CANopen World.Vector Informatik GmbH,2004
    [37] 邓竹莎.基于 CAN 实时应用的可靠调度性研究.计算机应用,2006(3):25~34
    [38] 吕科,罗永革,石振东,佘建强.基于 CAN 总线的超生波倒车雷达系统设计.汽车电子技术分会第七届年会论文集,2006:231~234
    [39] 王宜怀,刘晓升.嵌入式应用技术基础教程.北京:清华大学出版社,2005
    [40] 于海昕,曾文华.基于 ARM 的汽车 ACCS 硬件回路仿真平台设计.计算机工程,2007,33(5):229~231
    [41] 徐平,蒋健,张弘.WindowsCE.Net 下 CAN 卡的驱动程序设计.技术纵横,2003:31~35
    [42] 菜月明,刘浩.基于 CAN 总线的工业控制系统.中国仪器仪表,2001:16~18
    [43] M.Farsi,K.Ratcliff,ManuelBarbosa.An introduction to CANopen.Computer & Control Engineering Journal,1999:161~168
    [44] 王楠,白凤山.CAN 通信系统中心控制模块的设计.内蒙古大学学报,2006,37(5):564~569
    [45] 胡军辉,王友钊.WindowsCE 设备驱动程序开发.计算机工程,2006,32(16):41~43
    [46] Short M,Pont M J,Huang Q.Safety and Reliability of Distributed Embedded System:Simulation of Vehicle Longitudinal Dynamics[R].Embedded Systems Laboratory,2004
    [47] MicrosoftWindows CE. Net Help [ EB/OL ]. http: //msdn microsoft. com/library/default. asp,2003.
    [48] Douglas Boling. Programming Microsoft Windows CE. NET, Third Edition[M ]. Microsoft Press,2003.
    [49] Pat Richards.A CAN Physical Layer Discussion.Microchip,2006
    [50] 邬宽明.CAN 总线原理和应用系统设计[M].北京:北京航空航天大学出版社,1996
    [51] 崔晓俊,季建华.船舶液位遥测系统中的新技术应用[J],船舶工程,2007,3:72-74. ,

© 2004-2018 中国地质图书馆版权所有 京ICP备05064691号 京公网安备11010802017129号

地址:北京市海淀区学院路29号 邮编:100083

电话:办公室:(+86 10)66554848;文献借阅、咨询服务、科技查新:66554700