It is necessary to know three commands to interface telephonic modems to PLCs. These commands are the following:
-
initialize modem,
-
renumerate,
-
disconnect modem.
It is imperative to send an initialization message followed by a dial message to the modem before sending it an ASCII or Modbus message.
When the connection is successful between the two modems, you may send an unlimited number of ASCII or Modbus messages.
When all the messages have been sent, you must send the disconnection string to the modem.
The two modems must be configured with the same characteristics as the serial ports:
Then define ‘’+’’ as escape character (command: ATS2=43).
Example of initializing command:
ATQ0&Q0E0&K0V1
with:
-
Q0: enable the result code
-
&Q0: DTR is always assumed (ON),
-
E0: disable the echo of characters,
-
&K0: no flow control,
-
V1: word result codes.
The dial message is used to send the telephone number to the modem.
Only AT commands relating to dialing should be included in the message.
Example:
-
Frequency dialing: ATDT6800326<CR><LR>
-
Pulse dialing: ATDP6800326<CR><LF>
-
Frequency dialing with tone waiting: ATDTW6800326<CR><LF>
The modem is first switched back to the Command Mode by receiving the escape character three times.
Then, the disconnect command "ATH0" can be send.
Escape sequence: "+++" (modem result code: OK),
Disconnect command: "ATH0" (modem result code: OK).