基于labwindows的串口通信

基于labwindows的串口通信

ID:30946331

大小:57.15 KB

页数:9页

时间:2019-01-04

基于labwindows的串口通信_第1页
基于labwindows的串口通信_第2页
基于labwindows的串口通信_第3页
基于labwindows的串口通信_第4页
基于labwindows的串口通信_第5页
资源描述:

《基于labwindows的串口通信》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库

1、#include#include#include#include#include#includeinclude”串口通信.h“#definetextjength2048staticintconfig_handle;config_flag;portindex;port_open;RS232Error;comport;baudrate;parity;databits;stopbits;inputq;o

2、utputq;xmode;ctsmode;type;stringsize;bytes_sent;send_byte;send_mode;read_cnt;bytes_read;chardevicenamef301;charsend_data[textjength];charread_dataltext_length];chartbox_read_data[text_length];doubletimeout;staticvoid*callbackdata;staticintpanelHandle,graphpanel,c

3、onfig;voidComCallbcick(intCOMport,inteventMask,void*callbackdata);voidSetConfigParms();voidGetConfigParms();voidEnablePanelControls(int);voidSendAscii(void);voidSendByte(void);voidDisplayRS232Error(void);voidSetConfigParms(){SetCtrlVal(config_handle,CONFIG_COMPOR

4、T,comport);SetCtrlVal(config.handle,CONFIG_BAUDRATE,baudrate);SetCtrlVal(config_handle,CONFIG_PARITY,parity);SetCtrlVal(config_handle,CONFIG.DATABITS,databits);SetCtrlVal(config_handle,CONFIG_STOPBITS,stopbits);SetCtrlVal(config_handle,CONFIG」NPUTQ,inputq);SetCtr

5、lVal(config_handle,CONFIG.OUTPUTQ,outputq);SetCtrlVal(config_handle,CONFIG.CTSMODE,ctsmode);SetCtrlVal(config_handle,CONFIG_XMODE,xmode);SetCtrllndex(config_handle,CONFIG_COMPORT,portindex);voidGetConfigParms(){GetCtrlVal(config_handle,CONFIG_COMPORT,&comport);Ge

6、tCtrlVal(config_handle,CONFIG_BAUDRATE,&baudrate);GetCtrlVal(config_handle,CONFIG.PARITY,&parity);GetCtrlVal(config.handle,CONFIG.DATABITS,&databits);GetCtrlVal(config_handle,CONFIG.STOPBITS,&stopbits);GetCtrlVal(config_handle,CONFIG」NPUTQ,&inputq);GetCtrlVal(con

7、fig_handle,CONFIG_OUTPUTQ,&outputq);GetCtrlVal(config_handle,CONFIG_CTSMODE,&ctsmode);GetCtrlVal(config_handle,CONFIG_XMODE,&xmode);GetCtrlVal(config_handle,CONFIG_TIMEOUT,&timeout);GetCtrlIndex(config_handle,CONFIG_COMPORT,&portindex);#ifdef_Nl_unix_devicename[0

8、]=0;#elseGetLabelFromlndex(config_handle,CONFIG_COMPORT,portindex,devicename);#endifvoidEnablePanelControls(intenable)冷uoA。jui4[oj)uoojui4puudjui)>

9、ouq[

10、B09pou

当前文档最多预览五页,下载文档查看全文

此文档下载收益归作者所有

当前文档最多预览五页,下载文档查看全文
温馨提示:
1. 部分包含数学公式或PPT动画的文件,查看预览时可能会显示错乱或异常,文件下载后无此问题,请放心下载。
2. 本文档由用户上传,版权归属用户,天天文库负责整理代发布。如果您对本文档版权有争议请及时联系客服。
3. 下载前请仔细阅读文档内容,确认文档内容符合您的需求后进行下载,若出现内容与标题不符可向本站投诉处理。
4. 下载文档时可能由于网络波动等原因无法下载或下载错误,付费完成后未能成功下载的用户请联系客服处理。