电子测量技术
電子測量技術
전자측량기술
ELECTRONIC MEASUREMENT TECHNOLOGY
2015年
6期
139-142
,共4页
串口通信%M SComm控件%通信传输协议%通信握手协议%远程串口通信
串口通信%M SComm控件%通信傳輸協議%通信握手協議%遠程串口通信
천구통신%M SComm공건%통신전수협의%통신악수협의%원정천구통신
serial port communication%MSComm control%communication transfer protocol%communication handshake protocol%long distance serial port communication
串口通信因其简单、可靠和高标准化在工业自动化和电子仪器控制中得到广泛的应用。介绍数据采集系统串口通信的设计和实现。首先以Visual C++的编程环境为例,给出了用MSComm控件实现计算机与下位机之间的串口通信关键代码设计,介绍了M SComm控件的创建和属性的设置后,又从数据的发送和接收2个方面详细阐述了其关键代码的实例。然后,进行了通信传输协议的设计,以图形和代码示例详细展示了如何实现数据块的传输。接着给出了通信握手协议的设计,以流程图的形式讲述了上位机与下位机之间如何实现握手的。最后展示了系统运行的结果。还做了思路扩展,提出了实现计算机与下位机之间远程串口通信的2种方案。
串口通信因其簡單、可靠和高標準化在工業自動化和電子儀器控製中得到廣汎的應用。介紹數據採集繫統串口通信的設計和實現。首先以Visual C++的編程環境為例,給齣瞭用MSComm控件實現計算機與下位機之間的串口通信關鍵代碼設計,介紹瞭M SComm控件的創建和屬性的設置後,又從數據的髮送和接收2箇方麵詳細闡述瞭其關鍵代碼的實例。然後,進行瞭通信傳輸協議的設計,以圖形和代碼示例詳細展示瞭如何實現數據塊的傳輸。接著給齣瞭通信握手協議的設計,以流程圖的形式講述瞭上位機與下位機之間如何實現握手的。最後展示瞭繫統運行的結果。還做瞭思路擴展,提齣瞭實現計算機與下位機之間遠程串口通信的2種方案。
천구통신인기간단、가고화고표준화재공업자동화화전자의기공제중득도엄범적응용。개소수거채집계통천구통신적설계화실현。수선이Visual C++적편정배경위례,급출료용MSComm공건실현계산궤여하위궤지간적천구통신관건대마설계,개소료M SComm공건적창건화속성적설치후,우종수거적발송화접수2개방면상세천술료기관건대마적실례。연후,진행료통신전수협의적설계,이도형화대마시례상세전시료여하실현수거괴적전수。접착급출료통신악수협의적설계,이류정도적형식강술료상위궤여하위궤지간여하실현악수적。최후전시료계통운행적결과。환주료사로확전,제출료실현계산궤여하위궤지간원정천구통신적2충방안。
As a simple ,reliable and highly standard way of communication ,serial port communication is widely used in industrial automation and electrical equipment controller . The paper presents the way to implement serial port communication of a data collection system .Take Visual C+ + programming as example ,the key code for MSComm control is presented to implement serial port communications between computer and lower computer .It presents how to create and set up the MSComm control properties .Detailed key code design is discussed from sending perspective and receiving perspective . The communication transfer protocol is designed in details with figure illustration and code examples .The communication handshake protocol is designed in details with process presented to show how the handshake does between computer and lower compute .At the end ,the running result for the system is shown .The paper also extends its strategy to long distance communications between computer and lower computer .Two designs are mentioned .