• Welcome to Forum.Deepsoftware.Com. Please login or sign up.
 
April 24, 2024, 04:12:38 am

News:

SMF - Just Installed!


Own AT command

Started by standus, September 21, 2009, 03:21:42 am

Previous topic - Next topic

standus

Is it possible send to GSM Phone/Modem own AT command and receive answer?

Roman Novgorodov

Hello

Current version of nrGsm does not have public methods for direct AT commands.

You can try to use something like this:

  nrComm1.SendString('ATZ');
  reply := nrComm1.ReadString;

or nrComm1.OnAfterReceive event.

But it can destroy internal TnrGsm logic.

Roman Novgorodov
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

bgzretry

Quote from: Roman Novgorodov on September 21, 2009, 03:46:47 am
Hello

Current version of nrGsm does not have public methods for direct AT commands.

You can try to use something like this:

 nrComm1.SendString('ATZ');
 reply := nrComm1.ReadString;

or nrComm1.OnAfterReceive event.

But it can destroy internal TnrGsm logic.

Roman Novgorodov



Hi Roman,
I would to build my own AT command but I got problem when the connected device was not supported at command, my application become not responding. How to prevent it?
below are my simple code :

 nrComm1.active := true;
 nrComm1.SendString('ATZ');
 sleep(500);
 reply := nrComm1.ReadString;
 if pos('OK',reply) then connectOK := true;

Please help this newbie  ??? ??? ???



Roman Novgorodov

Hello

It's easy.
Just add #13 at the end of your AT command :-)

nrComm1.SendString('ATZ'#13);


Roman Novgorodov
DeepSoftware.Com
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

bgzretry

Quote from: Roman Novgorodov on January 09, 2010, 12:29:20 pm
Hello

It's easy.
Just add #13 at the end of your AT command :-)

nrComm1.SendString('ATZ'#13);


Roman Novgorodov
DeepSoftware.Com


Ok, solved. many thanks.
Is nrcomm need any .dll or .ocx files?? because I try in my computer that I use for develop, the application can work properly but when I try to the other computer didn't work.

Roman Novgorodov

Hello

If you build your project without external packages (see project options), the result EXE contains all is need.
You don't need any DLL or OCX.

Possible something is wrong with serial port initialization or etc.

Roman Novgorodov
DeepSoftware.Com
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

bgzretry

Next question  ;D ;D ;D
How to catch nrComm errors such as when the port already used by other application, Pop up window will be appear. I don't want any pop up window appear, how to do it ?

Try
nrcomm1.active := true;
except On exception: ..... do
Label1.Caption := "Port Open Error"
end;

what exception must be I filled  ??? ??? ???

Regards,
Newbie  ;D ;D

Roman Novgorodov

Hello

You can use something like following:


  try
    nrComm1.Active := true;
  except
     on E: Exception do begin
        ShowMessage(E.Message);
     end;
  end;


Also you can handle OnFatalError event for intercept exceptions from other threads.

Roman Novgorodov
DeepSoftware.Com
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.