L
L.Ming
Unregistered / Unconfirmed
GUEST, unregistred user!
procedure TDM.DataSend(const Str: String;Types: byte)
{发送数据}
var
i: integer;
rbuf:array of byte;
commflg:boolean;
begin
case Types of
0: Comm.WriteCommData(PChar(DM.DictateTable.FieldByName('code').AsString),Length(DM.DictateTable.FieldByName('code').AsString))
//字符串发送
1: with TStringList.Create do //比特数组发送
try
Delimiter := ' ';
DelimitedText := TRIM(Str);
SetLength(rbuf,Count);
for i := 0 to Count - 1 do
begin
rbuf:= byte(strtoint('$'+ Strings));
Comm.WriteCommData(@rbuf,1);
//Comport1.Write(rbuf,1);
sleep(20);
end;
finally
Free
end;
end;
end;
procedure TfrmProjectives.RzBitBtn5Click(Sender: TObject);
begin
DM.Comm.CommName := 'COM6';
DM.Comm.BaudRate := 9600;
DM.Comm.ByteSize := _8;
DM.Comm.StartComm;
DM.DataSend(trim(eDIT1.Text),1);
end;
{发送数据}
var
i: integer;
rbuf:array of byte;
commflg:boolean;
begin
case Types of
0: Comm.WriteCommData(PChar(DM.DictateTable.FieldByName('code').AsString),Length(DM.DictateTable.FieldByName('code').AsString))
//字符串发送
1: with TStringList.Create do //比特数组发送
try
Delimiter := ' ';
DelimitedText := TRIM(Str);
SetLength(rbuf,Count);
for i := 0 to Count - 1 do
begin
rbuf:= byte(strtoint('$'+ Strings));
Comm.WriteCommData(@rbuf,1);
//Comport1.Write(rbuf,1);
sleep(20);
end;
finally
Free
end;
end;
end;
procedure TfrmProjectives.RzBitBtn5Click(Sender: TObject);
begin
DM.Comm.CommName := 'COM6';
DM.Comm.BaudRate := 9600;
DM.Comm.ByteSize := _8;
DM.Comm.StartComm;
DM.DataSend(trim(eDIT1.Text),1);
end;