Registriert seit: 28. Jan 2006
Ort: Görlitz / Sachsen
489 Beiträge
Delphi 2007 Professional
|
Re: Comport Daten senden
18. Feb 2008, 18:41
Delphi-Quellcode:
SIms : Array [0..20] of Byte = ($80,$21, $48, $00, $01, $00, $00, $00,$61, $00,
$00, $00, $01, $10, $00, $00, $00, $00, $00, $00, $00);
Delphi-Quellcode:
procedure TForm5.Button1Click(Sender: TObject);
var BytesWritten: DWORD;
d: array[1..1500] of Char;
BytesRead: DWORD;
i: Integer;
Result: string;
begin
Compt:=ComPort.Text;
WriteFile(ComFile, SIms[20], Length(SIms), BytesWritten, nil);
Result := '';
if not ReadFile(ComFile, d, SizeOf(d), BytesRead, nil) then
begin
MessageDlg('Nicht Verbunden', mtError, [mbOK], 0);
exit;
end;
{ s := '';
for i := 1 to BytesRead do
d := d + d[I];
Result := d;
Memo1.Lines.Add(Result); }
end;
Ausgabe = 00 8D 40 00 38 27 46 00 44 27 46 00 50 27 46 00 5C 27 46 00 6C
Marcel
|
|
Zitat
|