How do I call the “AT command” of the GSM modem in the codeys? Not a standard Send_SMS and E.T.C

I have a gsm-modem and plc, plc sees a modem (I use *.lib and the function block “openPort”), but I don’t understand how to write “in the modem” at command”, such as “ate0”.
First, in order to increase your understanding of AT commands, please read V. 250 specification. This will make you an AT command expert.

Then for the actual implementation, I don’t know codesys, so the following is the pseudo code of the structure that should have to process AT commands:< /p>

the_modem = openPort();
...
// start sending ATE0
writePort(the_modem, "ATE0 ");
do {
line = readLinePort(the_modem);
} while (! is_final_result_code(line))
// Sending of ATE0 command finished (successfully or not)
...
closePort(the_modem);

Whatever you do, never use delay, sleep or similar instead of waiting for the final result code. You can view the code of atinout as an example of the is_final_result_code function ( You can also compare with isFinalResponseError and isFinalResponseSuccess in ST-Ericsson’s U300 RIL, but please note that CONNECT is not the final result code, it is the intermediate result code, so the name isFinalResponseSuccess is 100% correct).

I have a gsm-modem and plc, plc sees a modem (I use *.lib and the function block “openPort”), but I don’t understand how to write “at command” in the modem, For example, “ate0” .

First, in order to increase your understanding of AT commands, please read the V. 250 specification. This will enable You become an AT command expert.

Then for the actual implementation, I don’t know codesys, so the following is the pseudo-code of the structure that AT commands should have:

the_modem = openPort();
...
// start sending ATE0
writePort(the_modem, "ATE0 ");
do {
line = readLinePort(the_modem);
} while (! is_final_result_code(line))
// Sending of ATE0 command finished (successfully or not)
...
closePort(the_modem);

Whatever you do, never use delay, sleep or similar instead of waiting for the final result code. You can view the code of atinout as an example of the is_final_result_code function (you can also check the ST- Compare with isFinalResponseError and isFinalResponseSuccess in Ericsson’s U300 RIL, but please note that CONNECT is not the final result code, it is the intermediate result code, so the name isFinalResponseSuccess is 100% correct).

Leave a Comment

Your email address will not be published.