Forum > Networking and Web Programming
[Solved] Get AT Command result to TMemo with synapse
Mujie:
Hi,
I'm currently try to make a simple app with synapse. My problem is, how I get the AT command result (capture result) likes Hyperterminal does to the TMemo ? Thanks for your help :)
theo:
Memo1.Text:=AtCommand(..
?
Mujie:
Take a look at this code (taken from synapse/synazer example) :
--- Code: ---procedure TForm1.Button1Click(Sender: TObject);
var
ser: TBlockSerial;
begin
ser:=TBlockSerial.Create;
try
ser.Connect('COM19');
ser.Config(460800,8,'N',0,false,true);
ser.ATCommand('AT');
if (ser.LastError <> 0) or (not ser.ATResult) then
Exit;
if (ser.LastError <> 0) or (not ser.ATResult) then
Exit;
finally
ser.Free;
end;
end;
--- End code ---
How to get and show the result to the TMemo ?
Mujie:
Arrggghhh n00b of me, its solved now. Sorry for bothering you Theo.
Here it is the working code :
--- Code: ---procedure TForm1.Button1Click(Sender: TObject);
var
ser: TBlockSerial;
begin
ser:=TBlockSerial.Create;
try
ser.Connect('COM19');
ser.Config(9600,8,'N',0,false,false);
Memo1.Lines.Text:=ser.ATCommand(Edit1.Text);
finally
ser.free;
end;
end;
--- End code ---
LazaruX:
This may help you too http://activexperts.com/xmstoolkit/atcommands/
Navigation
[0] Message Index
[#] Next page