摘要
本文阐述了在Win98环境下PC和PLC实时通信的方法 .根据S7- 2 0 0PLC的特点 ,利用自由口通信方式和相关的特殊标志位 ,实现了PC和PLC之间的通信 .这种方法与单个数据中断的通讯方式相比 ,实时通信更加简单、快捷 ;PC机利用VisualC ++6 .0的通信控件MSComm编写软件程序 ,该通信控制使用事件驱动或查询方式解决开发通信软件中遇到的问题 ,保证了通信的实时性 ,文中并详细介绍了通信过程 .以泵房监控系统为实例 。
A realization of real-time communication between PC and PLC based on Windows98 is presented in this paper.According to the characteristic of S7-200 PLC,the free port communication mode and specially marked bits related are used to make the communication successful,which is more simple and faster than the corresponding mode for odd date intermit.We programmed by the corresponding control as MSComm in the Visual++6.0, which makes use of the event-driven or query mode to solve the problem,thus real time is assured. The process of communication is introduced in detail.A supervisory system of the pump room is taken as an example.The control of the water pump running is realized and it is supervised and controlled by the PC.
出处
《南昌大学学报(工科版)》
CAS
2002年第2期81-82,共2页
Journal of Nanchang University(Engineering & Technology)