我用MSComm串口取来的数据,都是乱码!请问怎么回事?
解决方案 »
- 关于摄像头控制视频显示区域的问题?
- 在intraweb 环境下,怎么实现iwdbgrid中是数据导入到excel啊!大哥大姐教教我
- 老婆生了個兒子,高興中。散分!順便求各位達人幫忙取個名字!
- 问一个MDI的问题 烦人:(
- 请问table、query怎么与view连接?
- 如何转换呀(在线等待)
- 高手救命啊!!ADOStoredProc的问题,参数不存在?
- 初学delphi,问一个简单的问题。
- Access加上密码后,为何ADO不能联接?
- access数据库的密码忘了怎么办呀 有没有通用密码!!!!急!!!
- 怎样检测Query是否为空?
- Exception EClassNotFound in module Project1.exe at 000176E2.Class TEdit not found 的问题?
begin
MSComm1.InBufferCount:=0;
MSComm1.InputLen:=0;
MSComm1.RThreshold:=10;
end;procedure TFrmBill.B_weightClick(Sender: TObject);
begin
if FrmComm.Comm_Select.Text='COM1' then
MSComm1.CommPort:=1
else
MSComm1.CommPort:=2;
MSComm1.Settings:=FrmComm.Comm_String.Text;
MSComm1.PortOpen:=true;
MSComm1.DTREnable:=true;
MSComm1.RTSEnable:=true; //showmessage(FloatToStr(int3));
end;procedure TFrmBill.MSComm1Comm(Sender: TObject);
var
reStr1:String;
buffer:Variant;
begin
case MSComm1.CommEvent of
comEvReceive:
begin
buffer:=MSComm1.Input;
reStr1:=buffer;
memo1.Text:=memo1.Text+reStr1;
end;
end;
end.
Recdata:array of byte;
I:integer;
Rs:ansiString;
begin
RecData := MSComm1.Input;
for I := low(RecData) to high(RecData) do
Rs := Rs + IntToHex(RecData[I],2);
end;
for I := low(RecData) to high(RecData) do
begin
bTMP:=RecData[i];
Rs := Rs + chr(bTMP);
end;
Memo1.Text:=Memo1.Text+RS;
可在文本框Memo里什么也看不到!
请问怎么回事?