Recent

Author Topic: Cant connect to gsm modem with synapse  (Read 4207 times)

deadflowers

  • Newbie
  • Posts: 6
Cant connect to gsm modem with synapse
« on: January 19, 2010, 10:20:17 pm »
hi,

i use synapse to connect my gsm modem. but when i try to run, can not connet to gsm modem. i got error message 9997.

This my code :

Code: [Select]
Program sms;

uses crt,strings,mysql4,SysUtils,strutils,synaser;

const
   bps:integer=115200;
   bits:integer=8;
   parity:char='N';
   stop_bits:integer=2;
   lport:string='COM22';

var
   hp:TBlockSerial;

procedure phone;
begin
  write('Koneksi ke modem.....');
  hp:=TBlockSerial.Create;
  try
    hp.config( bps,bits,parity,stop_bits,false,true);
    hp.Connect(lport);
    hp.ATCommand('AT');
    sleep(15500);
    if (hp.LastError <> 0) or (not hp.ATResult) then
      write('Gagal (',hp.ATResult);
      writeln(')');
      writeln;
      Exit;
   hp.ATConnect('AT+GMM');
   if (hp.LastError <> 0) or (not hp.ATResult) then
      Exit;
    // you are now connected to a modem at +420971200111
    // you can transmit or receive data now
    writeln(hp.ATResult);
  finally
    hp.free;
  end;

end;


begin
     clrscr;
     phone();

end.

Pls hlp me......

 

TinyPortal © 2005-2018