Description

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.

Initializing the Modem

The initialization message is an ASCII message comprised of a maximum of 512 characters, although 50 characters are generally adequate for initializing a modem.

You can use any Hayes AT command as a component of the initialization string.

Example: A typical Hayes initialization message:

  • AT&F&K0&Q0&D0V1X0Q0 <CR><LF>

NOTE: To simplify programming, you may initialize the modem via a terminal (for example: Windows hyperterminal) and not use the OUT_IN_CHAR function. Once the parameters have been loaded in the modem, they may be saved in non-volatile memory with an AT command, usually &W.

Dialing the Modem

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 1: Frequency dialing:

  • AT DT 6800326 <CR><LF>

Example 2: Pulse dialing:

  • AT DP 6800326 <CR><LF>

Example 3: Frequency dialing with tone waiting:

  • AT DT W,6800326 <CR><LF>

NOTE: The timeout value should be large because the connection between two modems takes time (for example, set timeout to 30,000 ms). A Status code 116 is generated by the OUT_IN_MBUS block is the value is too short. Several attempts may be necessary before finding the optimum time.

Disconnecting the Modem

The disconnection message is used to disconnect the modem.

Example 1: Typical Hayes disconnection message:

  • +++AT H0 <CR><LF>

NOTE: The timeout value should be large because the disconnection of a modem takes time (for example, set timeout to 30,000 ms). A Status code 116 is generated by the OUT_IN_MBUS block if the value is too short. Several attempts may be necessary before finding the optimum time.