Recent

Author Topic: [Solved] Get AT Command result to TMemo with synapse  (Read 7012 times)

Mujie

  • Jr. Member
  • **
  • Posts: 64
[Solved] Get AT Command result to TMemo with synapse
« on: July 07, 2010, 04:03:14 pm »
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  :)
« Last Edit: July 07, 2010, 07:31:56 pm by Mujie »

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1927
Re: [Ask] Get AT Command result to TMemo with synapse
« Reply #1 on: July 07, 2010, 04:44:54 pm »
Memo1.Text:=AtCommand(..
?

Mujie

  • Jr. Member
  • **
  • Posts: 64
Re: [Ask] Get AT Command result to TMemo with synapse
« Reply #2 on: July 07, 2010, 06:20:24 pm »
Take a look at this code (taken from synapse/synazer example) :

Code: [Select]
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;


How to get and show the result to the TMemo ?

Mujie

  • Jr. Member
  • **
  • Posts: 64
Re: [Ask] Get AT Command result to TMemo with synapse
« Reply #3 on: July 07, 2010, 07:31:36 pm »
Arrggghhh n00b of me, its solved now. Sorry for bothering you Theo.

Here it is the working code :

Code: [Select]
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;

LazaruX

  • Hero Member
  • *****
  • Posts: 597
  • Lazarus original cheetah.The cheetah doesn't cheat
Re: [Solved] Get AT Command result to TMemo with synapse
« Reply #4 on: July 07, 2010, 10:37:32 pm »

Mujie

  • Jr. Member
  • **
  • Posts: 64
Re: [Solved] Get AT Command result to TMemo with synapse
« Reply #5 on: July 08, 2010, 03:04:32 pm »
Wow thanks a million BPsoftware  :D

 

TinyPortal © 2005-2018