首页 | 官方网站   微博 | 高级检索  
     

基于API函数库实现串口数据通信的分析与设计
引用本文:屈武江.基于API函数库实现串口数据通信的分析与设计[J].计算机技术与发展,2020(4):167-170.
作者姓名:屈武江
作者单位:大连海洋大学应用技术学院
基金项目:2017年辽宁省教育科学研究项目(QL201722)。
摘    要:串口数据通信能够实现计算机与外部设备之间的数据传输,广泛应用于实时监控和工业自动化系统中,为此开发高效、快速、实用的串口数据通信系统尤为重要。从串口数据通信实现的过程出发,详细介绍了使用VB6.0的MSComm控件、使用SerialPort串口通讯类和调用API库中的通信函数三种方法实现串口数据通信的过程。并以农业生产蔬菜大棚自动杀虫灯数据采集分析程序为例,应用VS2012集成开发环境从基于API函数库实现串口数据通信系统的设计思路、打开串口和接收数据等通用类方法设计入手,实现了自动杀虫灯数据采集分析串口数据通信程序在VS2012中的设计。实验结果显示,在VS2012系统中采用API函数库实现的串口数据采集通信系统,编程效率较高、可移植性强,同时适合于对通信质量要求较高,传输距离较远的应用场合。

关 键 词:串口数据通信  VS2012  API函数库  分析与设计

Analysis and Design of Serial Port Data Communication Based on API Function Library
QU Wu-jiang.Analysis and Design of Serial Port Data Communication Based on API Function Library[J].Computer Technology and Development,2020(4):167-170.
Authors:QU Wu-jiang
Affiliation:(Institute of Applied Technology,Dalian Ocean University,Dalian 116300,China)
Abstract:Serial data communication can realize the data transmission between the computer and external equipment,which is widely used in real-time monitoring and industrial automation systems,so it is particularly important to develop an efficient,fast and practical serial data communication system.Starting from the process of realizing serial data communication,we introduce in detail the process of realizing serial data communication by using MSComm control of VB6.0,SerialPort serial communication class and calling communication function in API library.Taking the data acquisition and analysis program of automatic insecticidal lamp for agricultural production vegetable greenhouse as an example,the design idea of serial data communication system based on API function library,the design of open serial port and receive data and other general class methods are applied in the integrated development environment of VS2012.The design of serial data communication program of automatic insecticidal lamp data acquisition and analysis is realized in VS2012.The experiment shows that the serial data acquisition and communication system based on API function library in VS2012 system has high programming efficiency and mobility,and is suitable for applications with high communication quality and long transmission distance.
Keywords:serial port data communication  VS2012  API function library  analysis and design
本文献已被 维普 等数据库收录!
设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司    京ICP备09084417号-23

京公网安备 11010802026262号