引用本文:阚江,孙苓生.用VB 6.0实现工控软件和下位机的串口通信[J].电力自动化设备,2002,(9):34-37
.Serial communication between industrial control software and slave system with VB 6.0[J].Electric Power Automation Equipment,2002,(9):34-37
【打印本页】   【HTML】   【下载PDF全文】   查看/发表评论  【EndNote】   【RefMan】   【BibTex】
←前一篇|后一篇→ 过刊浏览    高级检索
本文已被:浏览 3328次   下载 0 本文二维码信息
码上扫一扫!
用VB 6.0实现工控软件和下位机的串口通信
阚江,孙苓生
作者单位
摘要:
针对自动化控制中出现的工控软件串口通信驱动程序不支持现有设备的问题,基于DDE(Dynamic Data Excehange)技术,用VB6.0实现了一个能被绝大多数工控软件使用的串口通信接口程序。对下位机,利用MSComm控件收发串口数据;对工控软件,通过DDE方式与其交换数据,使得工控软件能透明地操作串口数据。实际工程运行表明,该方法实现简单,功能适用,运行可靠。另外,在工业现场的实现应用常常需要定时发送数据,而VB提供的定时器控件只能精确到55ms左右,利用WinAPI实现了精度1ms的高精度定时器。
关键词:  VB6.0 工控软件 下位机 串口通信 动态数据交换 程序设计
DOI:
分类号:TP311.1
基金项目:
Serial communication between industrial control software and slave system with VB 6.0
KAN Jiang  SUN Ling sheng  ZHANG Ming
Abstract:
Regarding to that the serial communication driver provided with industrial control software does not support current devices in automation control,a DDE based serial communication software with VB 6.0 is developed,which can be applied by most industrial control software.For the slace system,the MSComm Controller is used to receive and transmit serial data,for the industrial control software,the data is exchanged transparently via DDE(Dynamic Data Exchange).The engineering practice proves that it is easy in implementation,applicable in functions and reliable in operation.In addition,the data are normally transmitted by time schedule in industrial control and the timer control provided by VB can not be less than 55 ms,WinAPI is hence adopted to set a timer with 1 ms resolution.
Key words:  industrial control software,serial communication,DDE,timer

用微信扫一扫

用微信扫一扫