摘要
现场总线是用于自动化系统最底层的现场设备或仪表互联的通信网络。CAN是现场总线中的一种 ,具有较高的性能价格比和较强的实时处理能力。文章以采用CAN总线的通讯网络结构的校园消费系统为例 ,介绍在CAN总线通信中如何采用基于多线程的通信程序实现实时的接收、处理和发送数据的功能 ,对多个线程之间的协作关系进行了分析 ,以及对采用信号量实现线程的互斥和同步问题进行了详细的论述 ,最后给出了利用Delphi编写的线程的框架。
Field bus is a network via which all field equipments and meters intercommunicate in a roboticized system. It is derived from the network of computer which is applied in the automatically controlled system. The CAN is a kind of field bus which has higher ratio of capability and price, and more effective capability of real time process. The paper uses the consumption system of campus which adopts CAN bus network as example to introduce how to use the program which based on multi-thread to receive , handle and send data on real time. The relationship of mutli-thread is analyzed, the method of how to use signal to realize the mutex and synchronization of multi-thread is discussed in details too . At last, the framework of multi-thread which is written in Delphi is given .
出处
《东华理工学院学报》
2004年第2期196-200,共5页
Journal of East China Institute of Technology