基于C#的可扩展串口通信模块设计  被引量:1

Design of scalable serial communication module based on C#

在线阅读下载全文

作  者:王东[1] 杨杰 谭礼健 Wang Dong;Yang Jie;Tan Lijian(School of Intelligent Manufacturing,Chongqing Industry&Trade Polytechnic,Chongqing 408000,China;School of Artificial Intelligence,Chongqing Industry&Trade Polytechnic,Chongqing 408000,China)

机构地区:[1]重庆工贸职业技术学院智能制造学院,重庆408000 [2]重庆工贸职业技术学院人工智能学院,重庆408000

出  处:《无线互联科技》2023年第10期1-3,14,共4页Wireless Internet Technology

基  金:重庆市教委科学技术研究项目,项目编号:KJZD-K201903601。

摘  要:随着智能化、自动化的发展,各类设备对联网通信的需求越来越强。在传统设备改造过程中,串口通信应用广泛,针对常用串口通信中协议解析与其他模块融合,导致协议解析模块存在无法实现重用和维护困难等问题,文章应用面向对象的思想,充分利用C#语言的封装、继承和多态特性,设计了可扩展的串口通信模块,通过设计不同的协议实现类,可扩展不同的通信协议,而客户端只需要设计简单的实现类对通信协议进行配置即可完成对协议的解析。文章以文本数据格式的通信协议为例,进行了实际测试,该模块稳定可靠,具有较高的实用性。With the development of intelligence and automation,the demand for networking communication of various devices is getting stronger and stronger.The serial communication is widely used in the process of traditional equipment transformation.For the common serial communication,the protocol parsing and other modules are fused together,which leads to the problem that the protocol parsing module cannot be reused and is difficult to maintain.This paper applies object-oriented thinking and makes full use of the encapsulation,inheritance and polymorphic features of C#language to design an extensible serial communication module.By designing different protocol implementation classes,different communication protocols can be extended,and the client only needs to design a simple implementation class to configure the communication protocol to complete the parsing of the protocol.And the communication protocol in text data format is taken as an example and tested practically,the module is stable and reliable and has high practicality.

关 键 词:串口 通信协议 面向对象 可扩展 

分 类 号:TP311.5[自动化与计算机技术—计算机软件与理论]

 

参考文献:

正在载入数据...

 

二级参考文献:

正在载入数据...

 

耦合文献:

正在载入数据...

 

引证文献:

正在载入数据...

 

二级引证文献:

正在载入数据...

 

同被引文献:

正在载入数据...

 

相关期刊文献:

正在载入数据...

相关的主题
相关的作者对象
相关的机构对象