Description
There are three commands that you need to become familiar with when interfacing dial-up modems to XXMIT.
These commands are:
Initialize modem
Dial modem
Hangup modem.
Before an ASCII message or a Modbus message goes through the modem, you must first send an initialization string and then a dial string to the modem. Once the modem has dialed the telephone number and made a connection to the remote modem, you may send an unlimited number of ASCII messages or Modbus messages through the modem. To send multiple messages, you increment the message pointer to the next message after each successful XXMIT operation. When all messages are sent, you may then send the hangup string to the modem.
Initialization Message
The initialization message is just like any other ASCII message and may be a maximum of 512 characters long, although 50 characters is usually more than enough to initialize a modem. You may implement any Hayes AT command as part of the initialization string. We recommend the following commands when initializing a modem for use with XXMIT.
Initialization Message for Dial-Up Modem
Initialization Message = |
AT&F&K0&Q0&D0V1Q0X0E1 |
---|---|
AT= |
Self-calibrate Modem 1 |
&F= |
Recall factory configuration as active configuration 1 |
&K0= |
Disable local flow control 2 |
&Q0= |
Communicate in asynchronous mode 2 |
&D0= |
Ignore status of DTR signal 1 |
V1= |
Display result codes as words 1 If V1 is not used or if modem is not capable of returning verbose responses XXMIT returns error 117 (modem replay time out). |
Q0= |
Return result codes 1 |
X0= |
Provide basic call progress result codes: Connect, No Carrier, and Ring 1 |
E1= |
Echo characters from the keyboard to the screen in command state 1 |
1 These parameters must always be part of the initialization string for XXMIT to function properly. 2 These parameters should be part of the initialization string for XXMIT to transmit a message to remote modem properly. Only a experienced modem user should change or not use these parameters. |
The initialization message must always start with Hayes standard AT command. XXMIT automatically precedes modem command messages with AT and appends the message with carriage return (0x0D) and line feed (0x0A) characters since these are required by all modem control messages. Other (non controlling) ASCII messages do not have to end with a carriage return and line feed.
For example, a typical initialization message that XXMIT sends to the modem.
Message |
Length |
---|---|
(AT)&F&K0&Q0&D0V1X0Q0 (<CR><LF>) 1 |
17 characters |
1 Characters within parentheses are automatically sent. |
For example, the initialization message may also be used to set S-registers of the modem.
Message |
Length |
---|---|
(AT)S0=1 (<CR><LF>) 1 |
4 characters |
1 Characters within parentheses are automatically sent. |
To have XXMIT send an initialization message to the modem, bit 9 and bit 0 of the command word must be ON. When bit 0 is ON, bits 1 and 2 must not be ON or XXMIT will not complete the operation successfully. To actually send the message, Start input of XXMIT must come ON and stays ON until the operation is complete or an error occurs. When XXMIT determines the message was successfully sent to the modem, it turns ON the Done output. When an error occurs, the Error output comes ON. The Active output is ON while the message is being sent to the modem.
Dial Message
The dial message is used to send a telephone number to the modem. Only AT commands related to dialing a number should be included with the message. Examples of typical dial messages used with XXMIT are shown below.
For example, dial telephone number using tone dialing.
Message |
Length |
---|---|
(AT)DT)6800326 (<CR><LF>)1 |
7 characters |
1 Characters within parentheses are automatically sent. |
For example, dial telephone number using pulse dialing.
Message |
Length |
---|---|
(AT)DP)6800326 (<CR><LF>)1 |
7 characters |
1 Characters within parentheses are automatically sent. |
For example, dial telephone number using tone dialing, wait to hear dial tone before dialing number, and pause before dialing the rest of the number.
Message |
Length |
---|---|
(AT)DT)W,6800326 (<CR><LF>)1 |
9 characters |
1 Characters within parentheses are automatically sent. |
To have XXMIT send a tone dial message to the modem, bit 9 and bit 1 of the command word must be ON. When bit 1 is ON, bits 0 and 2 must not be ON or XXMIT will not complete the operation successfully. To actually send the message, the Start input of XXMIT must come ON and stays ON until the operation is complete or an error occurs. When XXMIT determines the message was successfully sent to the modem, it turns ON the Done output. When an error occurs, the Error output comes ON. The Active output is ON while the message is being sent to the modem.
Hangup Message
The hangup message is used to hangup the modem. Only AT commands related to hanging up the modem should be used in this message. An example of a typical hangup message is shown below.
For example, hangup modem message.
Message |
Length |
---|---|
(+++AT)H0 (<CR><LF>)1 |
2 characters |
1 Characters within parentheses are automatically sent. |
When the hangup message is sent to a modem that is already connected to a remote modem, XXMIT must first set the local modem in command mode. XXMIT does this by sending a escape sequence +++ to the modem. XXMIT assumes that +++ sets the modem in command mode. Some modem manufactures let the owner change this default escape sequence. For XXMIT to function properly the modem should be set to accept the +++ escape sequence.
To have XXMIT send a hangup message to the modem, bit 9 and bit 2 of the command word must be ON. When bit 2 is ON, bits 0 and 1 must not be ON or XXMIT will not complete the operation successfully. To actually send the message, the Start input of XXMIT must come ON and stays ON until the operation is complete or an error occurs. When XXMIT determines the message was successfully sent to the modem, it turns ON the Done output. When an error occurs, the Error output comes ON. The Done output is ON while the message is being sent to the modem.