Y yuerzhang Unregistered / Unconfirmed GUEST, unregistred user! 2005-09-17 #1 我用mscomm控件只能发送和接收2字节的数据,请问,如何才能发送和接收多字节的数据,很着急,拜托高手
Y yuerzhang Unregistered / Unconfirmed GUEST, unregistred user! 2005-09-17 #2 我用mscomm控件只能发送和接收2字节的数据,请问,如何才能发送和接收多字节的数据,很着急,拜托高手
A ahhlian Unregistered / Unconfirmed GUEST, unregistred user! 2005-09-17 #4 //初始化 procedure TForm1.FormCreate(Sender: TObject); begin Mscomm1.PortOpen:=true; Mscomm1.InputLen:=0; MsComm1.InputMode:=comInputModeText; ReData:=''; end; //发送数据 procedure TForm1.BitBtn1Click(Sender: TObject); var s1:string; StringCount,i:integer; begin Mscomm1.InBufferCount:=0; MsComm1.Output:='dfdsfsd'; end; //接收数据 procedure TForm1.MSComm1Comm(Sender: TObject); begin Case MsComm1.CommEvent of 2: ReData:=MsComm1.Input+ReData; end; end;
//初始化 procedure TForm1.FormCreate(Sender: TObject); begin Mscomm1.PortOpen:=true; Mscomm1.InputLen:=0; MsComm1.InputMode:=comInputModeText; ReData:=''; end; //发送数据 procedure TForm1.BitBtn1Click(Sender: TObject); var s1:string; StringCount,i:integer; begin Mscomm1.InBufferCount:=0; MsComm1.Output:='dfdsfsd'; end; //接收数据 procedure TForm1.MSComm1Comm(Sender: TObject); begin Case MsComm1.CommEvent of 2: ReData:=MsComm1.Input+ReData; end; end;