Multitech | MT2834BL | how to configure topsail and linx terminal applications for dial

625 Digital Drive, Plano, TX 75075 Tel: (972) 964-7090 Fax: (972) 964-7643 Web Page: www.linxdata.com
HOW TO CONFIGURE TOPSAIL AND
LINX TERMINAL APPLICATIONS FOR
DIAL-UP MODEM COMMUNICATION
• Revision Date: January 4, 2002
Article 24
Motivation
One of the key features of LINX data terminals is the ability to use a modem to dial into
remote terminals and collect stored data. Because the RS232 serial communications
standard limits the length of a serial cable to 100 feet, the use of modems to dial into
more remote terminals greatly increases the physical area of the network. Obviously, it is
a tremendous advantage to have this option available to network planners. Unfortunately,
some people have been having problems obtaining good connections with recent
modems. This article will attempt to alleviate some of the confusion surrounding this
feature.
In principle, the concept is simple. Rather than have a terminal attached to a computer by
way of a serial cable, we introduce two modems into the system. When it comes time for
Topsail to poll the terminal, it uses the PC’s modem to call the modem of the terminal.
Once the connection is established, the communication channel exists just as it had for
the system with only the serial cable.
The problem many developers face is that the connection between the two modems is not
easily established. To make matters worse, sometimes the modems appear to connect, but
the expected communication is still not present. In most cases, the difficulty is due to an
improper or inconsistent baud rate set on the modem. However, the larger issue is
configuring the modem in general, which will be addressed here.
Theory and Background
As stated before, the principle problem resides setting the modem baud rates, or rather
setting the baud rates and keeping them set. LINX recommends a maximum RS232
communication rate of 9600 baud using the Request/Response protocol. This should be
the maximum speed between the terminal and the modem connected to it.
While it is possible to have the rest of the communication lines operating at a faster
speed, it is not recommended since the buffering required can throw the timing of higher
protocols out of sync. For this reason, the best course of action is to set all of the
communication segments to the same value.
The problems arise with the creation of modern modems. The current versions of Topsail
and LINX Terminals have been designed to comply with the Hayes Compatible AT
command set for modem configuration. However, due to a shift in the technical
standards many modern modems are not fully Hayes compatible anymore. Rather, they
support some small subset of the Hayes command set, and the Microsoft Unimodem
command set. (Even Hayes has reportedly abandoned portions of their protocol.) Some
modem manufacturers have taken liberties with modem auto-configuration, that are not
available with fully Hayes-Compatibility. Consequently, modern modem behavior is
sometimes difficult to anticipate.
In the case of baud rate fixing, this has been a particularly sticky problem. Some
modems will automatically negotiate to a lower baud rate if a line is deemed to noisy for
9600 baud. Normally this would only be a problem for a single session, except that the
modem may decide that only the lower baud rate is now acceptable, and will never again
revert to the original setting of 9600.
Dual purpose modems, used for Topsail communications as well as other
communications (such as dialing into the local ISP), have also expressed symptoms
related to this problem. When the modem is used for ISP communications, the Windows
modem drivers generally don’t respect any saved settings that Topsail has used.
Consequently, the modem must be fully reinitialized by Topsail. (Something that recent
versions of Topsail can be configured to do.)
The solution that we have for these and other related problems is fairly simple: Never
assume the modem is configured correctly before you dial. Always issue the modem its
initialization string before attempting to use it. On the PC side, simply provide Topsail
with the appropriate communication string. On the terminal side, it is trickier; as the
program running on the terminal must be “aware” of the modem, and send the
initialization string itself.
Hardware Requirements
The modem that LINX recommends is the Multi-Tech MT2834BL 33.6Kbps Intelligent
Data/Fax Modem. Although any modem that is fully Hayes compatible should work,
these are difficult to find. It is reasonable to assume that any modem constructed after
2001 is not Hayes compatible, regardless of the marketing claims. If unsure, contact your
modem manufacturer.
For the purposes of this document the modem commands used have been tested on the
MT2834BL. If you want to attempt to use a different brand, consult its documentation to
determine the necessary configuration commands.
The initialization string used on the MT2834BL is “AT$SB9600$MB9600Q2&W0”.
This breaks down into the following commands:
AT
- Attention command prefix
$SB9600
- Set the serial port to use 9600 baud
$MB9600
- Set the modem connection to use 9600 baud
Q2
- Use Dumb Answer Mode (don’t negotiate baud rate)
&W0
- Store the current settings in static ram (in case, of reboot)
Other modems may require other commands to be added to this string as necessary. For
instance, if your modem has replaced dipswitches with software configuration, it may be
necessary to insure other parameters remain constant as well. These parameters may
include, but are not limited to: Parity, Data Bits, Stop Bits, RTS/CTS, and Auto-Answer
mode.
How to set it up
Important Fact #1
The Windows Control Panel is in no way related to the operation of a Topsail modem connection.
Topsail communicates directly with the modem through the serial port, and circumvents the
Microsoft Modem Configuration. In fact, configuring the modem via the Control Panel is more
likely to have a negative effect than a positive one. This is because Windows modem drivers may
overwrite the configuration settings within the modem itself, obliterating the carefully constructed
initialization sequence that you have loaded into it.
On the computer running Topsail, configuration is fairly straightforward.
•
Connect the modem to a serial port on the computer (COM1 will be used here)
•
Set the Answer/Originate switch on the modem to Originate.
•
Set any dipswitches that may be required. For the MT2834BL the switches
should be set as:
“UP, UP, DN, UP, DN, UP, DN, DN, DN, UP, UP, DN, DN, DN, UP, DN”
•
Next start the Topsail serial communications driver (L4IO.exe) and turn
communications to off, if they are not already.
(Option menu ->End Communications)
•
Configure the communications line between PC and Modem.
(File menu ->Comm Line Setup)
o We use 9600 for baud, EVEN/7 for parity/data bits, and 1 stop bit. You
may use other settings, but be sure to configure your PC modem to use the
same ones.
•
Use the RTS/CTS communications option.
(Options menu -> Use Request to Send/Clear to Send (w/Modem) )
•
Add a remote dial-up site.
(Dial-Up menu -> Edit Sites)
o Enter a Name and Phone number
o Click the Modem button to reveal modem configuration info.
o Add the modem initialization string
(For MT2834BL we use “AT$SB9600$MB9600Q2&W0”)
o Click OK to accept the modem configuration.
o Click Exit to leave the Edit Sites dialog box.
•
Either choose manual dial, or set up the automatic dialing, as your situation
requires.
(Dial-Up menu -> Use Remote Access (Modem) -> Manual Dial)
Important Fact #2
On LINX terminals only the COM port has the correct hardware lines to support a modem. The
AUX port does not. Therefore, only attempt to use a modem on the COM port.
Setting up the LINX terminal, requires more work.
•
Using the regular serial connection, load the “modem aware” application into
the terminal.
•
Connect the modem to the COM port on the terminal.
•
Set the Answer/Originate switch on the modem to Answer.
•
Set any dipswitches that may be required. For the MT2834BL the switches
should be set as:
“UP, UP, DN, UP, UP, UP, DN, DN, DN, UP, UP, DN, DN, DN, UP, DN”
This differs from the PC modem only by switch 5 (the auto-answer switch).
•
Use the configuration menus on the terminal to use the correct serial
communication settings for the modem. Again the defaults are 9600 baud,
EVEN/7 for parity/data bits, and 1 stop bit.
•
Wait for incoming connections from Topsail.
The critical part here is making the terminal application modem aware. For this we hope
to show by example. Included below is a sample program that shows the code that needs
to be present for modem awareness.
In particular, note the following:
•
We only attempt to issue the modem initialization string when the computer is
not ONLINE (i.e. communicating with the server), to do so would likely
interrupt a good connection.
•
Initially we feed the modem an initialization string, assuming that it isn’t online
already, of course.
•
Within the main execution loop, we continually check to see if the modem
becomes unavailable by checking the CD (Carrier Detect) line status. If this line
drops to low and then becomes high again, the modem has been disconnected
(or power interruption, etc) and the modem needs to be re-initialized.
Sample Code
' SIMPLE SAMPLE UTILIZING MODEM FOR COMMUNICATIONS
'
' Please note terminal applications wishing to utilize
' a dial up connection should employ similar techniques
' to insure proper initialization of the modem.
'
' You must have the following OS or later for the
' techniques discussed here to work.
'
' LINX III OS (v)10.3 and greater
' LINX IV OS (v) 3.4 And greater
' LINX V OS (v) 3.9 And greater
' LINX V A OS (v) 10.2 And greater
'
CONST FALSE=0
CONST TRUE=-1
CONST HOSTDEV=1
CONST COMDEV=2
CONST BARDEV=3
DIM
DIM
DIM
Dim
DIM
DIM
Dim
Shared
Shared
Shared
Shared
Shared
Shared
Shared
CDState As Integer
CDLast As Integer
ModemInit As String
Symbol As String
Symbol2 As String
Need2InitModem As Integer
BadgeSwipe As String
'---------------------------------'Function to detect the state of CD
'---------------------------------Function GetCDState%
Dim s As String
s=Right$(IOCTL$(ComDev),1)
If s="1" Then
GetCDState%=TRUE
symbol2 = "H"
Else
GetCDState%=FALSE
symbol2 = "L"
End If
End Function
'---------------------------------'Function to determine if term is online
'---------------------------------Function Online%
Dim s As String
s=Left$(Ioctl$(hostDev),1)
If s="1" Then
Online%=TRUE
Symbol="+"
Else
Online%=FALSE
Symbol="-"
End If
End Function
'---------------------------------'Initialize
'---------------------------------'
'Note- The init string utilized here is for the MT2834
'
this is the modem currently recommended by LINX
'
If you choose another vendor of modems you will
'
the modem mfg. for the appropriate init command
ModemInit="AT$MB9600Q2$SB9600&W0"
'Explanation of settings
'AT
'MB9600
'Q2
'SB9600
'&W0
Get Modem's Attention
Use 9600bps on the line
Supress result codes
Set com port to 9600 only!
Save the settings to non-volatile RAM #0
'Dip switches on Modem
'1-UP, 2-UP, 3-DW, 4-UP, 5-UP, 6-UP, 7-DW, 8-DW
'9-DW, 10-UP, 11-UP, 12-DW, 13-DW, 14-DW, 15-UP, 16-DW
'Open all devices to be used
Open "Host" For Random As #HostDev
Open "Com" For Output As #ComDev
Open "Bar" For Input As #BarDev
CDState=GetCDState%
Multitech Modem
Data Terminals.
need to contact
string.
Need2InitModem=FALSE
Do
Cls
Print "Initializing the Modem"
Print "For the first time!";
If online% Then
Cls
Print "Can't Init Modem"
Print "While online with host";
Sleep 3
Else
Print #ComDev, ModemInit + Chr$(13)
Exit Do
End If
Loop
Cls
'---------------------------------'Main Execution Loop
'---------------------------------Do
'++++HANDLE DISPLAY+++
Locate 1,1
'<+> indicates online <-> indicates offline
'<H> indicates modem connected (Carrier Detect High)
'<L> indicates modem not-connected (CD Low)
i% = online%
Print Time$+" <" + symbol + "><" + symbol2 + ">
"
Print "Swipe a Badge";
'+++++++++++++++++++++
'++++HANDLE MODEM++++
'Check the modem to see if we need to re-initalize
CDLast=CDState
CDState=GetCDState%
If Not Need2InitModem Then
If CDState<>CDLast Then 'something has changed
If CDState Then 'CD HIGH
'We are currently connected!
Need2InitModem=FALSE
ElseIf CDLast Then 'CD was high is now low
'We disconnected and need to reset the modem
Need2InitModem=TRUE
End If
End If
Else
'We need to init the modem
'but can only do so safely when we are offline
If Not online% Then
Print #ComDev, ModemInit +Chr$(13)
Need2InitModem=FALSE
Locate 2,1
Print "
";
Locate 2,1
Print "Sent Modem Init!"
Sleep 1
Beep
End If
End If
'++++++++++++++++++++
'++++HANDLE BADGE SWIPE++++
If EOF(BarDev) Then
Line Input #BarDev, BadgeSwipe$
Sound 1200,1
Locate 2,1
Print"
";
Locate 2,1
Print BadgeSwipe$;
Sleep 1
Print #HostDev, DATE$+"|"+Time$+"|"+BadgeSwipe$+"|"+Symbol
End If
'++++++++++++++++++++
Sleep 1
Loop
Download PDF