亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

蟲蟲首頁(yè)| 資源下載| 資源專輯| 精品軟件
登錄| 注冊(cè)

ReceiveData

  • WinCE下利用COPYDATA消息在進(jìn)程間發(fā)送和接收數(shù)據(jù)代碼實(shí)例 1.SendData工程文件 2.ReceiveData工程文件

    WinCE下利用COPYDATA消息在進(jìn)程間發(fā)送和接收數(shù)據(jù)代碼實(shí)例 1.SendData工程文件 2.ReceiveData工程文件

    標(biāo)簽: ReceiveData COPYDATA SendData WinCE

    上傳時(shí)間: 2016-11-08

    上傳用戶:

  • 24c01a的讀寫程序

    #include <at24c01a.h>/*************************************************向24C01A寫入一個(gè)字節(jié)輸入:E2ROM地址,字節(jié)數(shù)據(jù)******************************************************/void write24c01a(uchar uadd_1,uchar udata_1){sendbyte=0xa0;start();send(sendbyte);if (!ack())continue;send(uadd_1);if (!ack())continue;send(udata_1)if (!ack())continue;stop();}/**********************************發(fā)送開始*****************************************/void start(void){a_scl=1;a_sda=1;a_sda=0;a_scl=0;a_scl=1;}/********************************************發(fā)送停止*******************************************/void stop(void){a_scl=0;a_sda=0;a_scl=1;a_sda=1;} /*********************************************發(fā)送反饋************************************************/bit ack(void){int a_acka_scl=0;a_scl=0;a_scl=0;a_scl=1;a_ack=a_sda;a_scl=0;return(a_ack)}/**************************************發(fā)送無(wú)反饋********************************************/bit noack(void){int a_ack;a_scl=1;a_scl=1;a_scl=0;}/*******************************************發(fā)送****************************************************/void send(uchar  undata){uchar i;sendbyte=undatafor(i=8;i>0;i--){a_sda=sendbyte7;a_scl=0;a_scl=1;sendbyte=sendbyte<<1}}/********************************************接受****************************************************/ void   receive(void){int i;uchar data;for(i=8;i>0;i--){ a_scl=1;receivebyte7=a_sda;a_scl=0;receivebyte=receivebyte>>1}ReceiveData=receivebyte;}/********************************************向 24c01a讀一個(gè)字節(jié);輸入:EEROM地址;輸出:EEROM數(shù)據(jù);********************************************/void read24c01a(uchar  counter){receivebyte=0xa1;start();send(receivebyte);if (!ack())continue;send(counter);if (!ack())continue;receive()noack();stop();}

    標(biāo)簽: 24c01a 讀寫程序

    上傳時(shí)間: 2013-12-23

    上傳用戶:wxhwjf

  • procedure senddata var i:integer commflg : Boolean begin commflg:=true for i:=1

    procedure senddata var i:integer commflg : Boolean begin commflg:=true for i:=1 to 8 do begin if not fcomm comml writecommdata(sendbutter,i) then begin Commflg=false break end end end (4) 接收數(shù)據(jù) 在編寫基于串口的計(jì)算機(jī)工業(yè)測(cè)控時(shí),通常需要由下位機(jī)向PC機(jī)發(fā)送數(shù)據(jù)以使PC機(jī)了解系統(tǒng)的測(cè)試數(shù)據(jù)或下位機(jī)的運(yùn)行狀態(tài),并進(jìn)而控制下位機(jī)的行為。利用Spcomm串口控件接收下位機(jī)發(fā)送的數(shù)據(jù)信息的示例代碼如下: //事件驅(qū)動(dòng)方式接收數(shù)據(jù)程序 procedure TForm1.CommlReceiveData(Sender:Tobject Buffer:Pointer bufferLength:Word) var ReceiveData:array of byte begin sleep(100) //等待100ms,保證接收到所有數(shù)據(jù) move(buffef ,ReceiveData,bufferlength) //將接收緩存區(qū)中的數(shù)據(jù)轉(zhuǎn)移到數(shù)組中 …… end (5) 關(guān)閉串口 在系統(tǒng)開發(fā)中,應(yīng)注意在不使用串口時(shí)應(yīng)及時(shí)關(guān)閉串口,釋放系統(tǒng)資源,否則可能會(huì)影響系統(tǒng)的其它應(yīng)用。關(guān)閉串口的代碼如下: procedure TForm1.FormClose ( Sender TObj ect:var Action:TCIoseAction ) begin comml.StopComm end

    標(biāo)簽: commflg procedure senddata integer

    上傳時(shí)間: 2014-01-26

    上傳用戶:懶龍1988

主站蜘蛛池模板: 龙海市| 类乌齐县| 博罗县| 汉寿县| 屏南县| 台东市| 囊谦县| 溆浦县| 唐山市| 利津县| 龙山县| 广饶县| 新营市| 武定县| 临澧县| 静安区| 萍乡市| 嘉义县| 深水埗区| 鹤山市| 长垣县| 隆子县| 中卫市| 多伦县| 蒙山县| 白沙| 丰台区| 南通市| 西宁市| 岚皋县| 沈阳市| 大同市| 昌图县| 安多县| 巴林右旗| 昆山市| 台州市| 温泉县| 娱乐| 育儿| 舟曲县|