SLTA Users Guide
SLTA Users Guide
and PSG/3
User’s Guide
Revision 3
e ECHELON’
Corporation
078-0160-OlE
Echelon, LON, LonTalk, LonBuilder, NodeBuilder, Neuron,
LonManager, LONMARK, LonMaker, LONWORKS, 3120 and 3150
are registered trademarks of Echelon Corporation. LonSupport
and LonWorld are trademarks of Echelon Corporation.
Echelon Corporation
www.echelon.com
FCC NOTICE (for USA only)
Warning: This equipment has been tested and found to comply with the limits for a Class B digital
device, pursuant to part 15 of the FCC Rules. These limits are designed to provide reasonable
protection against harmful interference in a residential installation. This equipment generates,
uses, and can radiate radio frequency energy and, if not installed and used in accordance with the
instructions, may cause harmful interference to radio communications. However, there is no
guarantee that interference will not occur in a particular installation. If this equipment does cause
harmful interference to radio or television reception, which can be determined by turning the
equipment off and on, the use is encouraged to try to correct the interference by one or more of the
following measures:
Changes or modifications not expressly approved by Echelon Corporation could void the user’s
authority to operate the equipment.
Safety
This digital apparatus does not exceed the Class B limits for radio noise emissions from digital
apparatus set out in the Radio Interference Regulations of the Canadian Department of
Communications.
Le present appareil numerique n’emet pas de bruits radioelectriques depassant les limites
applicables aux appareils numeriques de la classe B prescrites dans le reglement sur la brouillage
radioelectrique edict6 par le Minis&e des Communications du Canada.
Preface
iv Preface
Related Manuals
The following Echelon documents are suggested reading for more information:
The LCA Object and Data Server Programmer’s Guide describes how to write a 32-bit
Windows host application and installation tool that can be used with the SLTA-10 NSI
mode.
The LONWORKS Host Application Programmer’s Guide describes how to write a host
application that can be used with the SLTA-10 MIP mode.
The LonBuildef User’s Guide describes how to develop LONWORKS applications with
the LonBuilder Developer’s Workbench.
The NodeBuilder@ User’s Guide describes how to develop LONWORKS applications with
the NodeBuilder Development Tool.
Toshiba and Cypress have authored Neuron@ Chip databooks containing specifications
and literature that describe the architecture of the Neuron Chip.
Web Access
Engineering bulletins and data sheets supporting this product are available on the Echelon
Web site. General information regarding Echelon, its business, and its products also is
located on the site at http://www.echelon.com.
Preface
I..
VIII
8 Using the DOS Driver with SLTA-10 MIP Mode 8-1
Installing the SLTA-10 MIP Mode Driver for DOS 8-2
Buffer Options 8-2
Serial Bit Rate Options 8-3
DOS Device Options 8-4
Timing Options 8-5
Network Interface Protocol Options 8-5
Calling the Network Driver from a Host Application 8-8
Using the SLTA-10 MIP Mode under Microsoft Windows 3.1x 8-10
Preface
13 Using a Programmable Serial Gateway 13-1
Creating a Serial Gateway 13-2
SLTA/PSG History 13-2
Programmable Serial Gateway Hardware Resources 13-3
Developing a PSG Application with the NodeBuilder
Development Tool 13-4
PSG Software Installation 13-4
PSGBOR.DTM 13-5
Firmware Library Support 13-5
Usage 13-6
Code Development and Debugging 13-7
PSG.LIB Functions 13-8
Advanced Applications 13-10
UART Registers 13-11
PROM/FLASH Specifications 13-11
Differences Between PSGI2 and PSG/3 13-11
Porting PSG /2 Code to PSG/3 13-12
Declaration of Conformity
The SLTA-10 Adapter has two modes of operation: NSI and MIP
modes. The SLTA-10 NSI mode is compatible with LNS-based
applications. The SLTA-10 MIP mode is compatible with legacy
applications based on the LonManager@ API or the HA host application
software. The SLTA-10 MIP mode is a replacement for the SLTA/2
Serial LonTalk Adapter. An externally accessible DIP switch
determines the mode of operation.
Network Driver
EIA-232
Interface
Network SLTA-10
Interface Network Adapter
.
Transceiver
Interface LO/WORKS
Software A vailability
The SLTA-10 Adapter is not shipped with software.
Software for the SLTA-10 NSI mode is available with the LonMaker for Windows
Integration Tool (Model 370001, on the LNS Developer’s Kit for Windows CD (Model
34303), in the Connectivity Starter Kit (Model 58030-011, or from the Developer’s
Toolbox of the Echelon web site (http://www.echelon.com).
Software for the SLTA-10 MIP mode is distributed in the Connectivity Starter Kit
(Model 58030-01) and from the Developer’s Toolbox of the Echelon web site.
LNS Compatibility
When the SLTA-10 Adapter is connected directly to the PC host (i.e., no modems), the
SLTA-10 Adapter uses a direct connection. For a direct connection, the SLTA-10
Adapter behaves like any other NSI, such as the PCLTA-10 Adapter or the PCC-10
PC Card. In this case, an SLTA-10 Adapter may be used without issue with
applications based on any version of LNS starting with 1.0.
The SLTA-10 Adapter is also designed so that a PC host can be connected to the
network through a pair of modems and the telephone network. In this scenario, the
PC is a remote host. When the PC initiates the phone call to the SLTA-10 Adapter,
the remote host is said to “dial-in to the network”. When the SLTA-10 Adapter
initiates a call to the PC, the SLTA-10 is said to “dial-out to the remote host”. Once
the phone connection is established, the application running on the remote host can
perform network management, monitoring, or control activities.
TAPI Compatibility
The SLTALink Manager software uses TAP1 release 1.3 or higher. This is supported
in Windows NT 4.0 and higher, but not in Windows NT 3.51. Thus, Windows NT 3.51
does not support the use of the SLTA-10 Adapter with modems; however, Windows
NT 3.51 does support a direct connect interface.
BACK VIEW
-
3.42 P
[86.86]
0 0
0 0
*
0
n
W)
Service I
Button
Neuron@ (55)
Wl) ( 3150@ 1 EIA-232
Service Chip Data Port
LED
F
w 1 (DW
Config. lower Indicator
Switch LED
Block Transceiver
Section (53)
Power Input
(Jl) (J2)
Network Power Input
Connector
4
SLTA-10 0 ECHELON 1996
-
Figure 2.3 SLTA-10 Adapter Without Enclosure (Typical Component-Side View from Top).
ESDWarning
This product contains components which are sensitive to static
electricity. Before installing or removing the network or serial
cables, touch earth ground with your hand to discharge any static
electricity which may have accumulated.
Interface Function
EIA-232 Data Port Connector for the EIA-232 Serial I/O port.
J5 Standard DB9 female connection.
( J2 I
Power Indicator LED (Green LED) Indicates presence of input
power to the SLTA-10 Adapter.
DS2
Connecting Power
Once the SLTA-10 Adapter is physically attached to the desired channel, power must
be supplied via one of the power input connectors. The SLTA-10 Adapter may be
ordered with a plug-in power supply, or may be used with any 9 - 3OVACpDC supply.
Four plug-in power supply options are available for the SLTA-10 Adapter, depending
on the country in which the SLTA-10 Adapter is used: USA/Canada, United
Kingdom, Continental Europe, or Japan. The output voltage of these supplies is a
nominal +SVDC at 5OOmA. Power consumption is typically cl Watt, independent of
input voltage.
Table 2.2 describes the basic characteristics of the four power supply types.
Table 2.2 Power Supply Characteristics
Japan 100 VAC 90- 110VAC 50/60 Hz 2-prong, NEMA l-15P 78040
When power is connected, the yellow service LED will briefly flash and the green
power indicator LED will turn on. Once an SLTA-10 Adapter is powered and
configured, the service LED will remain off unless the service request switch is
pressed.
Note: Do not attempt to power an SLTA-10 Adapter simultaneously from JP2 and
JP3. Mechanical insertion of a connector into JP2 disables the input to JP3.
I 1
This chapter
demonstrates how to attach the SLTA-10 Adapter to a
LONWORKSnetwork, a PC, and a modem.
s!zl
Polarity RS-485
Insensitive Cable -
2
Shield
Jl
Jl
Models 73351,73352,73353
Model 73354
I I I I
SLTA-10
PC (DTE)
WE)
DB-9 DB-9
female end male end
If using a PC or modem equipped with a DB-25 connector, then use a cable equipped
on one end with a DB-25 female connector and a DB-9 male connector on the other
end. Plug the male DB-9 connector into the SLTA-10 Adapter and the female DB-25
connector into the PC.
Table 3.2 PC 25Pin to DB-9 Connection
Signal Name PC Connector Cable DB-25 Cable DB-9 SLTA (DCE)
DB-25 Male Female Male DB-9 Female
SLTA-10
PC (DTE)
WE)
DB-25 DB-9
female end male end
RTS-Pin
DTR-Pin 74 Pins 4 & 7 4.7-6
Pins Pin 6 DSR-Pin 6 I
GND-Pin 5 Pin 5 Pin 5-5 Pin 5 GND-Pin 5
ON/up
OFF/down
Configuration Options
Interface Link Protocol Control (Switch 7 / CFG3)
Switch1 / CFG3 controls the network interface link protocol used between the
SLTA-10 Adapter and a local host, when in MIP mode. For NSI mode, leave this
switch in the default position. Two link protocols are available for the SLTA-10 MIP
mode: the SLTA-10 Adapter ALERT/ACK link protocol and the buffered link protocol.
The ALERT/ACK link protocol is designed for host computers that cannot accept
asynchronously occurring streams of serial data at high speed. For example, a PC
4-2 Configuration
running DOS or Windows cannot guarantee receipt of all characters in an input
stream appearing back-to-back on a COM port . ALERT/ACK link protocol (down
position) is the default setting for the SLTA-10 Adapter. When the SLTA-10 Adapter
uses the ALERTlACK protocol and it wishes to send data to the host, it first sends a
single ALERT character (hex 01). The host then responds with an ALERT ACK
character (hex FE) to indicate its readiness to accept the rest of the data. The
ALERT/ACK protocol places timing requirements on the host, and if these timing
requirements are violated, a driver error occurs. After the host network driver has
sent the ALERT ACK character, it enters a tightly controlled loop for accepting the
remaining characters-usually with interrupts disabled. If this option is enabled
(switch in down position), the ALERT/ACK protocol will also be used when the host
wishes to send data to the SLTA-10 Adapter.
The buffered link protocol (up position) is designed for host computers and applications
that can accept and buffer back-to-back serial data without losing characters. For
example, most real-time operating systems and / dev/ t ty drivers in UNIX systems
have this capability. In this case, the SLTA-10 Adapter simply sends the uplink
message without any handshake with the host. The SLTA-10 Adapter does not support
hardware handshake or XON/XOFF software flow control when directly attached to a
host. If the buffered link protocol option is enabled (up position), the buffered protocol
is also used when the host wishes to send data to the SLTA-10 Adapter. The buffered
link protocol should not be used when CFG2 is set to the Remote Host state
(up position). See Buffered Link Protocol in Chapter 9 for additional application
restrictions when using the buffered link protocol.
Local Host
(default)
4-4 Configuration
If CFGl is set to Network Enable (down position), the SLTA-10 Adapter will enable
network communications after a reset by going directly to the NORMAL state, thus
allowing communications without requiring the niFLUSH_CANCEL command.
If the SLTA-10 Adapter is used with a modem, and the application requires the
SLTA-10 Adapter to dial out to a host in response to a message from the network,
then CFGl must be set to Network Enabled.
If the modem is set to receive incoming calls only, then the host can disable the
FLUSH state after the connection is established, in which case CFGl can be set to
either position. Table 4.1 summarizes these options:
The SLTA-10 Adapter has an SLTA-10 NSI-mode firmware switch which is Switch4
/ NSI. It is factory set in the up position for use of the SLTA-10 NSI mode
firmware. The down position is for the MIP mode firmware.
4utobaud Enabled
r Iutobaud Disabled
( default)
E3aud Determined by
LCSwitches 6, 7, and 8
If the /A option is specified for the DOS network driver, the driver sends the
autobaud sequence every time the driver is opened. However, if the AB option is
enabled, the driver must re-send the autobaud sequence every time the SLTA-10
Adapter cycles power.
For the Windows 95198 or NT network driver, there is no /A option. Using these
drivers, the autobaud sequence is attempted following power up ifAutobaud
Enabled is selected, otherwise (the default) autobaud will not be attempted.
Configuration
For the Windows 95198 or NT network driver, there is no /B option. When using
these drivers, the serial bit rate is configured using the SLTALink Manager as
explained in Chapter 7.
(default)
38,400 bps 1200 bps
IFigure 4.7 SLTA-10 Adapter Serial Baud Rate Switches 6, 7, and 8 / BAUD[2..0]
Table 4.2 SLTA-10 Adapter Autobaud Switch Configuration
Autobaud BAUD ‘ /A ’ Option on ‘/B ’ Option on DOS
Switch Switches DOS Driver Driver
down Specifies actual Don’t care Specifies actual serial bit
baud rate rate. Must match switch-
position selected baud rate
4-8 Configuration
The NODEUTIL node utility application, available on Echelon’s web site, can be used
to modify the MIP mode buffer configuration from a PC host. See the README.TXT
file included with NODEUTIL for details.
By default, the SLTA-10 NSI-mode program ID consists of 8 bytes of program
identification information (80-00-Ol-Ol-03-00-xx-3C, where ‘xx’ is determined by the
transceiver being used). The host application must change this program ID to
indicate its application. This is done automatically in LNS by the LCA Object
Server. If not using the LCA Object Server, the host application needs to send local
write-memory network management messages to change the program ID. See the
LNS Host API Programmer’s Guide for further information.
Table 4.5 SLTA-10 Adapter NSI-mode Default, and Minimum, Buffer Configuration
Skip this Chapter if you are using the SLTA-10 MIP mode.
1. Before installing the software, make sure that you have logged in as
Administrator (for Windows NT only).
4. Click the Start button on the Windows task bar and select the run
command. (If using with Windows NT 3.51: Within Program
Manager, choose the Run command from the File menu.)
8. The next screen presented is shown in figure 5.1. This will determine
the LONWORKS naming convention used for the SLTA-10 adapter.
Skip this Chapter if you are using the SLTA-10 NSI mode.
1. Place the diskette in one of the disk drives of your PC. This will typically be the
A: or B : drive. Under the Windows 95198 operating system, open a DOS console.
AZINSTALL [ENTER]
Substitute your disk drive name for the A : if you are using a different drive.
3. You will be asked to enter the name of your LONWORKS installation directory.
C: \LONWORKS is the default.
l Read-Me File. The README. TXT file includes a list of all the files on the
distribution disk, and also includes any updates to the documentation that
occurred since the SLTA-10 Adapter documentation was printed.
l DOS Network Driver Sources. The SLTA-10 Adapter DOS network driver
source code is contained in the LDVSLTA directory. These files can be used as the
basis for creating drivers for hosts other than PCs running DOS (see also the
UNIX network driver sources). See Chapter 8 for a description of the SLTA-10
Adapter DOS network driver and Chapter 9 for a description of how to write an
SLTA-10 Adapter network driver for other hosts. See Chapter 4 of the
LONWORKS Host Application Programmer’s Guide for a description of the
services that must be supplied by a LONWORKS network driver.
The source files to build the DOS driver are:
LDVSLTA.CFG Configuration file for Borland C.
MAKEFILE Make file script for Borland C.
MDV-T1ME.C Code to manage the PC timer.
MDV-T1ME.H External interface definitions for the timer handler.
MSD-DEFS.H Data structure and literal definitions.
MSDeD1FC.C DOS driver interface functions.
MSD-DRVR.H DOS driver interface and literal definitions.
MSD-EXEC.C Main open, close, read, and write processing.
MSD-FRST.C Module to be linked first in the network driver.
MSD-IRQC.ASM Serial I/O interrupt procedure.
MSD-LAST.C Module to be linked last in the network driver.
MSD-RAW.C Direct serial I/O (modem) processing.
MSD-SEGD.ASM Defines data segment register for driver.
MSD-SI0.C PC/AT UART interface processing.
MSD-TXRX.C Single byte link layer processing.
MSD-UART.H Defines PC/AT UART registers.
l External Interface Files. External interface files included for use by network
management tools are contained in the SLTA directory. External interface files
are included for the transceivers available for the SLTA-10 Adapter. See Binding
to a Host Node in Chapter 3 of the LONWORKS Host Application Programmer’s
Guide for a description of how to use these files to bind to an SLTA-10 Adapter
node. Appendix B of the LONWORKS Host Application Programmer’s Guide
provides a detailed description of how to modify these files to incorporate network
variables and message tags. These interface files are provided in version 3
0 ther Drivers
A UNIX network driver and source code for the SLTA-10 MIP mode is available on
the Echelon web site (http://www.echelon.com).
Chapter 9 discusses creating a SLTA-10 MIP mode driver for any host.
NOTE: Remote SLTA-10 Adapters cannot be used with Windows NT 3.51 because
Windows NT 3.51 does not include the 32-bit TAPI services used by the SLTALink
I Manager software.
Skip this Chapter if you are using the SLTA-10 MIP mode.
The SLTALink Manager is a standalone application that can monitor a modem line,
answer an incoming phone call, associate the incoming call’s SLTA-10 Adapter (and
hence its network) with a LON device, and then launch a pre-determined application
for that particular network or SLTA-10 Adapter. Combined with a properly designed
LNS host application, the SLTALink Manager lets a LONWORKS network establish a
connection to a remote PC through a pair of modems based on an event that occurs
locally to the network.
The SLTALink Manager provides a graphical user interface for creating, editing, and
diagnosing “links”. Each link represents a particular SLTA-10 Adapter and its
network. A link identifies several important aspects of the set-up, including the type
of connection (a remote connection via modems or a local, direct connection), the
COM port, the SLTA-10 Remote Identifier (see below), the baud rate of the serial
port on the SLTA-10 Adapter, and the dial-in password, if any. In addition, the link
indicates if a security callback is required and may be associated with a host
application. The link information is stored in a .slO file, located by default in the
c:\lonworks\bin\sltalO folder.
The SLTALink Manager application can associate a link with a LON device name
and then interface with the SLTA-10 NSI mode driver. The SLTALink Manager
handles automatically dialing into the network from the PC host, providing the
ability for applications with no knowledge of modems or phone numbers to run
remotely through a pair of modems. The SLTALink Manager application can be used
to connect to or disconnect from a remote SLTA-10 Adapter. In addition, the
SLTALink Manager has a simple, programmatic way to interact with the SLTA-NSI
mode. This programmatic interface allows an application to cause the SLTA-10 to
perform a number of functions, such as dial a phone number or hang up. The
SLTALink Manager also includes many diagnostic functions.
NOTE: Remote SLTA-10 Adapters cannot be used with Windows NT 3.51 because
Windows NT 3.51 does not include the 3%bit TAPI services used by the SLTALink
Manager software.
Upon invocation of the SLTALink Manager software (SLTALINK . EXE), the main
screen appears, shown in figure 7.1.
Clicking on Dialing Properties will bring-up the Windows Location Information window
(figure 7.4) if the “Dialing from:” indicator reads “???“, or if TAP1 information has been
previously entered - as shown in figure 7.3 as “Dialing from: The Office” - the
Windows Dialing Properties window (figure 7.5) will be displayed instead. The Dialing
Properties window is a tabbed subset of the Windows Telephony Control Panel.
The option list box will display the list of modems which have been set-up for use on
this computer. The list can be created/modified by using the Windows Modem
Control Panel. Select the line/modem to be used for incoming calls, then click OK.
Individual configuration items are processed on a line-by-line basis. All values are not
required to be in the script file, and any duplicated assignments are simply overwritten.
Any line may start with a semi-colon, which is treated as a comment line. Line
length is limited to 80 characters. Assignments are structured as follows:
keyword=value (note that there are no blank spaces between the components).
Argument strings do not need to be quoted. Keywords are case-insensitive. Edit the
script file as a simple text file with carriage returns and line feeds terminating each
line.
Example
. An SLTA-10 Configuration Script.
bassword=BIG DOG
Callback=1
HangupTimer=
GuardTimer=
ModemInit=ATEOVO&C1&D2SO=lMO
ModemDialPrefix=ATDT
DialDirl=14155557001
DialDir2=14155557002
DialDir3=12155557003
Dialdir4=
DialdirS=
NVConnect=
NVConnect=l 2
Name of link
The name of the link should be descriptive enough to clearly define to users the
connection and remote location.
Remote Identifier
The Remote Identifier is used to identify a specific link when a dial-in to the
computer occurs. It represents the remote SLTA-10 Adapter in a 12-byte string of
characters or hexadecimal numbers. This value here should match the value stored
in the remote SLTA-10 Adapter. It can be entered here as a string in single quotes,
or as a series of hexadecimal numbers separated by dashes.
If this field is blank or all zeroes (oo-OO-OO-OO-OO-~~-~O-OO-OO-OO-OO-OO)
then the Remote Identifier will be captured and stored here the next time
this connection is made.
If this field is all FFs (FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF-FF) then any
Remote Identifier will be accepted. The identifier will not be stored on the
PC. This is known as the wildcard Remote Identifier. The question mark
(?) is also accepted as the wildcard Remote Identifier. The SLTALink
Manager software translates “?” to all FFS.
The Update Identifier checkbox indicates that the remote identifier will be read from
the SLTA-10 Adapter by the SLTALink Manager and the new value will be stored in
the .slO file the next time this link is used.
Link Type
The type of link specifies whether the SLTA-10 is directly connected to the PC
(Local), or if the SLTA-10 is at a different location and must be accessed via a set of
modems (Remote).
TAP1 services will handle the structuring of the call based on the Location
Information (see figure 7.4).
SLTA Password
The Password box allows the user to enter the password for a remote SLTA-10
Adapter. Up to eight characters may be entered. If entered, the password will be
sent to the remote SLTA-10 adapter when a connection is made.
Invoking an Application
The SLTALink Manager provides a space to enter the startup application for this
link. This may be a full executable path name, or the name of an application that
can be found in the system’s search path. Command line arguments may also added
- including the special macros for link connection variables:
Enabling a Callback
If a remote SLTA-10 adapter has callback enabled then it will expect a callback
command whenever someone dials in to it. Check the Enable box if you need to
enable the callback feature.
The callback command includes a directory index that points to a phone number
stored in the remote SLTA-10 adapter. If callback is enabled then one of the remote
directory numbers (“Address 1” though “Address 5”) can be selected to be used to call
the host back.
Configuration
Enable Callback
Check this box if you need to enable callback.
If a remote SLTA has callback enabled then it will expect a callback command
whenever someone dials in to it. The callback command includes a directory index
that points to a phone number stored in the remote SLTA.
Timers
Hangup Timer, minutes
Provides a space to enter a hangup timer value for the SLTA. This must be within
the range of O-255, for 0 (disabled) to 255 minutes.
The hangup timer controls how many minutes of inactivity must pass before the
SLTA hangs up (disconnects the modem).
The guard timer controls how long to wait before attempting to dial the next number
for the auto-connect case.
Modem Settings
Initialization String
Provides a space to enter a modem initialization /configuration string for the SLTA.
This string is sent to the modem whenever the SLTA is reset and it is not currently
connected. Special characters may be embedded in the string:
Dial Prefix
Provides a space to enter a modem dial prefer for the SLTA. This controls the
characters sent to the modem before the actual phone number is sent. The default is
“ATDT” for tone dialing.
Use this feature if you are increasing the size of one string and decreasing the size of
another in one step.
Dial Directories
Provides a space to enter the dialout directory numbers, as strings. To chose which
directory entry to edit, simply select one of the buttons above.
Auto-da/out Configuration
NV Connect
Check this box to enable the Network Variable update auto-connect feature. When
enabled, the SLTA will attempt to connect to a remote host whenever the SLTA is
not connected and a non-broadcast host-bound NV update message is pending.
The SLTA starts with the directory number first specified on the right. If this
attempt fails then the next directory number is used, until the last directory number
has been used. To use a single number simply specify the same directory number in
both fields.
N$I Connect
Check this box to enable the Network Services (NSI) auto-connect feature. When
enabled, the SLTA will attempt to connect to a remote host whenever the SLTA is
not connected and a host-bound NSI message is pending.
The SLTA starts with the directory number first specified on the right. If this
attempt fails then the next directory number is used, until the last directory number
has been used. To use a single number simply specify the same directory number in
both fields.
SLTALINK . EXE executes as a single process. If you try and run another copy of it, it
will defer itself to the original process. However, command line arguments may be
passed in this manner which will direct the existing process to perform certain types
of tasks. These command line options are:
~Linknarnew A link name is required for all actions. If the link name alone
is passed then that link will be connected to. It must be
enclosed in double quotes, since the link name can have
embedded spaces.
C:\lonworks\bin\sltalink.exe "Remote"
C:\lonworks\bin\sltalink.exe "Remote" /D
/# Ymmber” This overrides the phone number for the link. If you have
checked the “Use Country Code and Area Code” option for
this link then the number must be in the ‘canonical’ format
without a ‘+’ sign and enclosed in double quotes. A canonical
number is defined as a country code followed by a space,
followed by an area code or city code enclosed in parenthesis,
followed by a space and the rest of the phone number. TAP1
will take this and decide how to translate it before performs
the dial-out, based on your dialing preferences. Even if the
call is local you should include the area code / city code. This
is the same format as the number that appears in the link
selection dialog under the Port/Number column.
Example: “1 (BOO) 5551213”
If you have not checked the “Use Country Code and Area
Code” option then the number will be used un-translated for
dial-out. In this case you probably won’t specify a canonical
number.
/P “passwdM This overrides the password for the link. It must be enclosed
in double quotes.
Always include a space between each element of the command line arguments.
For the dial-in only scenario, the system strategy issues primarily have to do with
associating the link or phone number with the application. Where there are only one
or two links, this is very easy. When one PC host can be connected to many different
networks, we offer two standard solutions. The first is to have the user navigate the
SLTALink Manager’s GUI. Under the Link menu, the Select item lists
approximately 40 links (of the 1000 possible). The second solution is a monitoring
application that programmatically interacts with the SLTALink Manager to send
down the appropriate phone number, perhaps to a generic out-going link.
In the second case, the remote host PC is assumed to have the NSS engine and a
second NSI on the network (perhaps a service technician with a laptop running a
PCC-10 card) is required to send the AddMyNSI message. Also, SLTA-10 Adapter’s
NSI mode EEPROM must be configured correctly.
In the dial-out only case, besides the call initiation, the SLTALink Manager must be
able to launch the appropriate application - with the correct database and device
driver name. One system solution is to create a separate link for each SLTA-10
Adapter. Each link then stores the Remote Identifier of its SLTA-10 Adapter after
the first connection. Upon connection, the appropriate application and command line
arguments stored in the link get launched. A second viable approach is to create a
generic link that uses the wild card as a Remote Identifier to launch a generic
application using command line arguments to specify the appropriate network or
database and device driver name. These arguments are available and described
above under Invoking an Application.
Note: if the device driver information used in the application does not
match the device driver name being used by the link, the newly launched
application can open a second device driver - which may result in an
attempt to dial-in to the network. Since the modem is still presumably in
use with the original dial-out call to the host PC, the second call will fail.
The result is a system-level failure.
Dial-In / Dial-Out
These scenarios are the combinations and permutations of the above. However, it
needs to be pointed out that not all dial-in strategies can co-exist with all dial-out
strategies. For example, if the dial-out strategy involves having the SLTALink
Manager match the incoming call to the wild card Remote Identifier and if the dial-in
strategy requires a separate link for each SLTA-10 Remote Identifier, then it is
possible that a call initiated from the network will be received by the SLTALink
Manager and will be matched with the link created for the dial-in case. The correct
application may not be launched and a system-level failure may occur.
Callback
The SLTA-10 Adapter callback functionality works as follows: A call is initiated from
some remote PC to an SLTA-10 Adapter on a network, which must have its NSI
mode EEPROM configured to require callback. The SLTA-10 Adapter answers; the
remote PC identifies to the SLTA-10 Adapter one of the SLTA-10 Adapters directory
entries to use for the callback. An SLTA-10 configured to require a callback will not
accept any other direction from the host at this time. The original call is terminated,
and the SLTA-10 Adapter calls the phone number indicated in its directory. Note:
this does NOT need to be the phone number of the original remote PC that initiated
the call. Typically, the SLTALink Manager on the remote host dialed answers the
call and launches the appropriate application.
Several possible system-level failures include:
l The original remote host expects to receive the callback, but the directory index
reflects the phone number of another remote host.
l The original remote host application opens an LNS database and initiates the
first call. The callback is directed back to the original remote host PC. The
To prevent these failures, Echelon recommends that the initial call should either be a
manual connection from within the SLTALink Manager or the initial call should
originate from a “dummy” application that terminates itself without opening the LNS
databases.
Call Termination
The four scenarios for call termination include: termination of the host application,
application controlled hang-up, a manual disconnect in the SLTALink Manager, and
time-out. In all of these cases, the important system-level issues involve making sure
that the termination strategy is compatible with the call initiation strategy.
The second behavior described would be desirable in the event that multiple remote
host PCs needed to be able to dial-in to the same network. As long as no explicitly-
bound network variables were left when the host applications terminated, then
several remote PCs could share one SLTA-10 Adapter. Note: this assumes that the
LNS Server exists somewhere on the network and is not located on one of the remote
PCs sharing the single SLTA-10 Adapter.
The first strategy is to require user intervention to shut down or terminate the
application. No special software must be written for this case. For the dial-in to a
network scenario when the call is user initiated, the user is presumably available to
shut down or terminate the application. In the dial-out case, the requirement of user
intervention to terminate the application means that every call from a network is
seen by an user. If the network is sending alarms, user intervention is highly
desirable.
The second approach requires a node on the network to send a network variable
update to the host when the network no longer requires the host application to be up
and running. When the host application receives this network variable, it should
enter a shut-down routine. This approach places the responsibility on the network to
determine when the host application is needed and requires a hook in the monitoring
application, but provides a level of automation when dial-out is used.
The third approach is the most blunt. In this scenario, the remote host application
terminates itself either after completing a series of actions or based on a timer. We
do not recommend this scenario for the general scenario, but it has certain appeal for
some applications. For example, a connection may be established through dial-in or
dial-out based on a timer. The host application could then take a series of
measurements from the network, log them to a file, and then terminate itself.
The remote monitoring application is based on LNS Object Server of LNS 1.5 or
higher. Applications based on the LNS 1.0 and LNS 1.01 do not behave well by
default and do not allow for certain dial-out scenarios. Applications written at the
NSS layer are not supported for use with the SLTA-10 Adapter across a pair of
modems.
The remote monitoring application should open the appropriate LNS and device
driver. Specifically, the mapping of the Remote ID to the LNS database should be
handled by the application. We suggest using the command line arguments with the
information available from the SLTALink Manager. Note LNS capacity keys may
need to be hard-coded in the monitoring application.
Finally, the LNS application needs to implement a termination strategy that meets
the needs of the application and the system.
l When expecting the SLTA-10 Adapter to dial-out from the network to a remote
PC, dedicate one SLTA-10 Adapter to dial-out and always have that SLTA-10
Adapter connect to the same remote PC. Make sure that the NSI EEPROM is
configured correctly. See figure 7.11.
Monitoring Application
Remote LCA
Modem
Dial-out
I Modem I
I ~~~~
Null Modem Cable
SLTA-10 Adapter
Transceiver Interface
LNS Server
LonWorks Devices
Monitoring Application
LNS Server
Driver
Interface
I Modem I
Dial-in and
Dial-out to the
LNS Server
Modem
SLTA-10 Adapter
Transceiver Interface
LonWorks Devices
I Modem I I Modem I
Dial-in
I Modem I
SLTA-10 Adapter
Transceiver Interface
t
LonWorks Devices
This chapter describes the DOS network driver supplied with the
Connectivity Starter. The driver also is available from the Developer’s
Toolbox on Echelon’s web site at www.echelon.com. The DOS network
driver provides a device-independent interface between a DOS or
Windows 3.1x host application and the SLTA-10 Adapter in MIP mode.
The driver is configurable to use one of four PC/AT serial ports, COMl
through COM4, at one of eight serial bit rates.
Skip this chapter if you are using the SLTA-10 NSI mode.
The available options for the SLTA-10 MIP mode network driver for DOS are
described in the following sections.
Buffer Options
/Onn Sets the number of output (downlink) buffers within the driver to
an>. The buffer sizes within the driver are pre-set to accommodate
255 byte packets. The SLTA-10 Adapter in MIP mode has application
output buffers that may be increased to as large as 255 bytes. There
must be at least 2 buffers and the maximum allowed number for am>
is limited by the size of the buffer (258) times the total number of
input and output buffers within the driver. The entire buffer space
plus the driver code itself cannot exceed 64Kbytes. The size of the
driver code itself is 9Kbytes. The number of output buffers required
is determined by the characteristics of the host application. If the
host application always waits for an outgoing message completion
before sending another message, then only two buffers are required.
If the host application is set up to overlap transactions, more buffers
may be required. In this case greater parallelism may be achieved at
the expense of host application code complexity.
/Inn Sets the number of input (uplink) buffers within the driver to an>.
The buffer sizes within the driver are pre-set to accommodate 255
byte packets. The SLTA-10 Adapter has application output buffers
may also be increased to as large as 255 bytes. There must be at least
2 buffers and the maximum allowed number for cnnr is limited by
the size of the buffer (258) times the total number of input and output
buffers within the driver. The entire buffer space plus the driver code
itself cannot exceed 64Kbytes. The number of input buffers required
1200,2400,9600,14400,19200,38400,57600,115200.
This rate represents the serial bit rate between the PC and the
SLTA-10 Adapter when using a direct serial connection, and between
the PC and the modem when using a remote connection. For remote
connections, the PC-to-modem serial bit rate, telephone line speed,
i.e., modem to modem serial bit rate, and the modem-to-SLTA-10
Adapter serial bit rate may be different. The PC-to-modem serial bit
rate is controlled by the network driver on the PC using the /B
option; the telephone line speed is selected by the modems based on
modem configuration; and the modem-to-SLTA-10 Adapter serial bit
rate is controlled by the hardware configuration of the SLTA-10
Adapter as described in Chapter 4 (autobaud cannot be used in this
configuration).
For local connections with the SLTA-10 Adapter Autobaud option
disabled, the serial bit rate specified by this driver option must match
the rate specified by the configuration switches.
/A Enables the autobaud feature. This provides the autobaud
sequence whenever the driver is opened. The default setting for
the driver is Autobaud Disabled. If the Autobaud input on the
Zf you are using the default SLTA-10 Adapter hardware is enabled, then this option must be
hardware configuration specified. As described in Chapter 4, the default setting for the AB
(autobaud disabled), the switch on the SLTA-10 Adapter is disabled, so the /A option does
autobaud option (IA) does not not need to be specified with the default hardware configuration.
need to be enabled.
This option may not be used with the modem support (/M) option.
/Dn Defines the device unit number as a>, where a> is between 1 and
9, so that the DOS device name is “LONl” through “LON9”. The
default is 1 for “LONl”. This option can be used to support multiple
network interfaces on a single PC. For example, this device name is
passed as a parameter to Ixt-open ( ) when using the LonManager
API. When invoking the sample host application HA, the device may
be specified with the -D option, for example:
HA -DLON2
/Un Sets the serial port interrupt request number (IRQ) to a non-standard
value cn>, where a> is between 1 and 7. If the serial port in use is
COM3 or COM4, you may want to use a unique, unused IRQ for that
port. Many serial ports and internal modems allow the selection of a
non-standard IRQ such as IRQ2 or IRQ5.
COM2 Ox2F8 3
COM3 Ox3E8 4
COM4 Ox2E8 3
(*> May be changed with the /u option
This option also enables the reliable transport protocol. This protocol
includes the addition of a message sequence number and the end of
message ACWNACK code. See Chapter 4 for a description of this
protocol.
When the SLTA-10 MIP mode network driver for DOS is loaded during execution of
the CONFIG. SYS file, it does not attempt to communicate with the SLTA-10 Adapter.
When the network driver is opened with the DOS open call, it establishes
communications with the SLTA-10 Adapter. The network driver returns an error if
this fails, for example, if the SLTA-10 Adapter is disconnected, powered down, or
configured incorrectly. If the open call succeeds, the driver enables network
communications by clearing the SLTA-10 Adapter FLUSH state, if configured to do so.
The DOS read call is defined to return the number of bytes read from the device.
Some LONWORKS standard network drivers return 0 if there are no uplink messages
available. DOS reports this as an end-of-file condition and prevents further reads
from succeeding. However, the SLTA-10 Adapter driver returns a length of 2, and
sets the first byte of the caller’s buffer (the cmd/queue byte) to 0 to indicate that there
is no uplink message available.
Normally, the DOS read and write calls are not used with LONWORKS standard
network drivers. This is because any error from the network interface will display
thefamiliar Abort, Retry, Fai 1? error message from DOS, unless the caller has
installed a critical error device handler. Therefore, DOS applications using a
network device typically call direct entry points into the driver. This also allows
more detailed error status to be returned to the application. The addresses of these
entry points are obtained by calling the i oc t 1( ) function of the driver.
When function code 2 is used, argdx points to the direct-calls structure defined
for all LONWORKS standard network drivers for DOS. If argcx is 13, the size of the
standard direct calls structure, then three direct entry point addresses are returned
as usual. If argcx is 4 (the size of the structure ioc tl-get-dcd-s), then the state
of the modem’s DCD line is returned as a TRUE or FALSE value. Note that the status
field is 16 bits in this structure, but 8 bits in the direct calls structure.
struct ioctl-get-dcd-s {
unsigned ioctl-stat; // 16 bit status
unsigned dcd-state; // Data Carrier Detect (TRUE or FALSE)
Function code 3 is used when the application wishes to write information to the
driver. For the SLTA-10 Adapter driver, argdx points to the following structure, and
argcx is its size:
struct ioctl-o-info-s {
unsigned ioctl-stat; // 16 bit status
unsigned sub-command; // use enum sub-command
unsigned mode;
unsigned mode-aux;
1
enum sub-command {
SUBC-set-opt = 1, // set driver options
SUBC-set_DTR = 2, // set DTR line
SUBC-set-baud = 3, // set serial bit rate
I;
There are three sub-commands, used to set the various modes of the driver, the state
of the DTR (Data Terminal Ready) line to the modem, and serial bit rate of the serial
interface.
When sub-command 1 is used, the mode field in the structure is a bit mask defining
which of the driver modes is to be changed, and the mode-aux field specifies bits
defining the new states of those modes. It is possible to set more than one of the
modes by OR’ing the following bit-masks together:
0x0001 Enables modem support.
0x0002 Allows modem responses to host - same as the /Q option.
0x0004 Forces direct modem mode. In this mode, the network driver is
communicating directly with the modem.
0x00 10 Enables the buffered link protocol and disables the ALERT/ACK
link protocol - same as the /N option.
0x0020 Enables the reliable transport protocol.
The /M option corresponds to 0x0021.
Sub-command 3 is used to set the serial bit rate of the serial interface. The mode
field determines the new bit rate as follows: 0:14,400; 1:1,200; 2:2,400; 3:9,600;
4:19,200; 538,400; 657,600; 7:115,200.
Skip this Chapter if you are using the SLTA-10 NSI mode.
A LONWORKS standard network driver must supply the functions defined under
Network Driver Services in Chapter 4 of the LONWORKS Host Application
Programmer’s Guide. The Windows 3.1x DLL software is described in Appendix A.
The UNIX network driver is a source library that uses the UNIX serial device driver.
It also supportsthe ldv-open(),ldv-read(),ldv-write(), and ldv-close0
functions.
Figure 9.1 illustrates how the network driver fits into the host application
architecture.
Driver services:
open/close/ioctl/read/write
I I I
Host
Downlink Flow Control Uplink Flow Control
Buffer Request Protocol XON/XOFF Protocol Network Driver
I I
- --------
Physical Layer Interface (EIA-232)
I SLTA-10
I
Network Interface
LONWORKS
Network
-
To implement an SLTA-10 MIP mode network driver for a host other than DOS,
Windows, or UNIX, follow these steps:
1 Implement and test low-level serial I/O. Serial I/O may be performed directly to
the host’s UART as is done in the DOS network driver, or may be performed by a
serial I/O driver on the host as is done by the UNIX network driver. Serial I/O
should be interrupt driven for better performance.
The UNIX network driver uses the UNIX serial port driver for all low-level serial
I/O and interrupt support. This simplifies the driver and also simplifies porting
between different versions of UNIX. The serial device is opened by the
ldv-open ( ) function and closed by the ldv-close ( ) function. Data are read
The smip-int-main ( ) function in the DOS network driver services the serial
port connected to the network interface. The function t ick-int-main ()
services the timer tick interrupt every 55 msec.
Both network drivers are fully buffered for both outgoing and incoming
messaging. Read and write functions work with circular buffers within the
driver. The host interrupt service routine handles the other ends of these buffer
queues.
Both network drivers only support a single set of output buffers. An elaboration
on this design could implement a set of priority output buffers. The write
function could determine into which of the two buffer sets to place messages, and
the driver service function could service the priority buffers first.
2 Implement and test timer support functions. Timer support may be provided by
a hardware timer as is done in the DOS network driver, by a system service as is
done in the UNIX network driver, or by implementing a background software
task. The UNIX network driver uses a once per second signal that is handled by
the second-service ( ) function. The DOS timer functions are implemented by
MDV-TIME.CandMDV-T1ME.H.
3 Implement and test the host side of the network interface protocol. The network
interface protocol is implemented by the rx-process ( ) and tx-process ()
functions in the UNIX driver, and by the functions in MSD-TXRX . c for the DOS
network driver.
4 Implement and test raw modem I/O if you need to support a modem interface.
Raw I/O manages the serial interface to the modem when the modem is not
connected to a host and is used for modem initialization and control. The raw I/O
interface is implemented in MSD-RAW. c for the DOS network driver, and is not
implemented in the UNIX network driver.
5 Implement and test the buffer request states, buffer management, and read/write
interfaces. These functions are implemented by MSD-EXEC . c for the DOS
l Presentation Layer. Defines packet formats for network variables and explicit
messages. This is the only layer visible to the host application. The remaining
layers are managed by the network driver.
l Session Layer. Manages flow control, buffer requests, and grants.
l Transport Layer. Ensures end-to-end reliability between the host and the
SLTA-10 Adapter.
l Link Layer. Controls access to the serial link.
l Physical Layer. EIA-232 interface.
The physical layer is defined by the EIA RS-232 standard. The link, transport,
session, and presentation layers are described in the following sections.
I
I
1 ALERT ACK (FE) 1
L I
I [ data ] I
1 checksum 1
The link-layer header contains a length byte followed by a one’s complement of the
length byte. These values are always validated by the receiver before accepting the
rest of the message. Following the length bytes is the network interface command.
See Appendix D of the Host Application Programmer’s Guide for a description of the
command byte structure. If the message contains a data field it follows the command
byte. Finally, a checksum terminates the sequence.
The length byte value describes the length of the network interface command byte
plus the length of the data field. This value will always be at least 1. The checksum
is a two’s complement of the sum of the command byte and all of the bytes in the data
field, if it exists. Checksum errors detected by the host will cause an error to be
reported to the application, and checksum errors detected by the SLTA-10 Adapter
will cause the message to be ignored.
The SLTA-10 Adapter places the following requirements on the rate of the received
serial data stream. When receiving, the maximum wait period for the length byte
following the transmission of the ALERT ACK byte is 1OOms (or 1 second when
attached to a modem). All subsequent bytes received must occur within 1OOms after
the previous byte, otherwise the SLTA-10 Adapter receive process will abort.
Likewise, the SLTA-10 Adapter uses a wait period of 1OOms (or 1 second when
attached to a modem) before aborting for the reception of the ALERT ACK when
When using this protocol, the link-layer header contains a length byte followed by a
one’s complement of the length byte. These values are always validated by the
receiver before accepting the rest of the message. Following the length bytes is the
network interface command. See Appendix D of the Host Application Programmer’s
Guide for a description of the command byte structure. If the message contains a
data field it follows the command byte. Finally, a checksum terminates the sequence.
Sender Receiver
Link-Layer
Header
1 checksum [
This protocol is used when the host is capable of accepting asynchronously occurring
input data without losing characters. The host is also relieved of the obligation of
responding to an ALERT character within 50 ms. This protocol may therefore be
used by an application-level handler calling an interrupt-driven buffered serial device
driver. Drivers with these characteristics are typically provided with real time
operating systems such as VRTX or time-sharing operating systems such as UNIX or
VMS. In this case, these drivers should be set up for binary data communications
without software flow control.
The buffered link protocol should not be used when the SLTA-10 Adapter is attached
to a modem.
The buffered link protocol can only be used on multitasking operating systems such
as UNIX if the host application executes often enough to empty any incoming buffers.
For example, if the SLTA-10 Adapter is receiving 70 packets per second, and each
packet is 25 bytes, the host will receive 1750 bytes per second. If the host has a serial
input buffer of 256 bytes, the buffer will fill within 150 milliseconds if the host
application is preempted. If the host application is preempted for longer than 150
milliseconds, incoming data will be lost due to lack of serial buffer space. In this case,
the ALERTlACK protocol should be used, or the buffer space increased to handle the
worst case traffic during the maximum preemption period.
The reliable transport protocol is enabled on the SLTA-10 Adapter with the Remote
Host option selected by the Switch2/CFGB input as described in Chapter 4. The
reliable transport protocol is enabled on the DOS network driver with the /M option
as described in Chapter 8. The reliable transport protocol is not supported by the
UNIX network driver.
The link-layer header contains an ALERT (0x01) byte, a sequence number, and a
length byte followed by a one’s complement of the length byte. These values are
always validated by the receiver before accepting the rest of the message. Following
the length bytes is the network interface command. See Appendix D of the Host
Application Programmer’s Guide for a description of the command byte structure. If
the message contains a data field it follows the command byte. Finally, a checksum
terminates the sequence.
The ALERT/ACK link protocol should be used with remote hosts. With this protocol,
the sender will start the sequence by transmitting the ALERT byte. When this byte
is received by the receiver, that device responds by transmitting the ALERT ACK
The length byte value describes the length of the network interface
command byte plus the length of the data field. This value will always be
at least 1. The checksum is a two’s complement of the sum of the command
byte and all of the bytes in the data field, if it exists. If the receiver receives
a message in sequence, with a valid checksum, it responds with an ACK
(0x06). Otherwise it responds with a NACK (0x151, requesting a re-
transmission.
Sender Receiver
1 not-length 1
1 checksum [
1 ACK(or NACK) 1
Downlink commands that are executed directly by the SLTA-10 Adapter are:
niRESET, niFLUSH_CANCEL, niONLINE, niOFFLINE, niFLUSH,
niFLUSH_IGN, niPUPXOFF, niPUPXON, niSLEEP, andniSSTATUS.
See the Host Application Programmer’s Guide, Appendix D, for a description of these
commands.
The niSStatus command, when sent downlink, will cause the SLTA-10 Adapter to
respond with a niSStatus command plus one byte of data. In MIP mode, this byte of
data contains the settings of configuration switches, with BAUD0 being the least
significant bit. In NSI mode, this byte of data contains 011 in the least significant
bits followed by the XID information, making the SLTA-10 Adapter NSI mode
consistent with the PCNSI Adapter.
Downlink commands that are buffered in the SLTA-10 Adapter are niNETMGMT (for
network management commands to be executed by the SLTA-10 Adapter itself) and
niCOMM (for messages to be sent out on the network, including network variables,
explicit messages, and network management messages addressed to other nodes).
For these two commands, a buffer request protocol is used to ensure that the
SLTA-10 Adapter has a free application buffer for the data. The network driver must
first request an output buffer before sending the interface buffer. The network driver
must hold the buffers in an output queue until the SLTA-10 Adapter is ready to
receive them. The network driver takes the SLTA-10 Adapter through 3 states to
request a buffer and send the interface buffer. Figure 9.5 summarizes the downlink
state transitions.
Receive
Flush niFLUSHCANCEL
Available? output
Available?
Receive niCOMM
or niNETMGMT
message?
L(czi&Jm
There is no buffer request protocol for uplink traffic. The network driver is
normally assumed to have sufficient buffers. The network driver can
suspend or resume uplink traffic when no network driver input buffers are
available by sending the Uplink Source Quench (niPUPXOFF) command to
the SLTA-10 Adapter. This prevents the STLA from sending any LonTalk
messages uplink. When the network driver senses that network driver
input buffers are available, it sends the Uplink Source Resume (ni PUPXON)
command to resume uplink transfers. Figure 9.6 summarizes the uplink
state transitions.
Node
1 Reset Receive
niPUPXOFF?
Receive
niPUPXON?
Note: Responses to niNETMGMT and niSSTATUS commands are allowed in the Flush state.
ExpMsgHdr Message
or Header
NetVarHdr size = 3
SendAddrDtl
Network
RcvAOdbrDtl Address
size = 11
Resp&drDtl
UnprocessedNV
Data
or
size
ExplicitMsg
varies
Once the SLTA-10 Adapter is in the configured state, it will retain that state and its
address assignment across power-cycles, because that information is stored in the
internal EEPROM. However, if Switch3KFGl is set to Network Disable, the FLUSH
state must be canceled each time the SLTA-10 Adapter is reset.
If the host application attempts to send a message while the SLTA-10 Adapter is in
the FLUSH state, the SLTA-10 Adapter will return a failed response for acknowledged
messages and a success response for unacknowledged messages. The message will
not be sent in either case.
If the host application attempts to send a message while the SLTA-10 Adapter is in
the NORMAL, unconfigured state, the SLTA-10 Adapter will always return a success
response even though the message will not be sent.
To initialize an SLTA-10 Adapter, follow these steps (for more detail, see the
LONWORKS Host Application Programmer’s Guide):
1 Reset the SLTA-10 Adapter from the host application by sending the niRESET
command. If installed correctly, the SLTA-10 Adapter will respond with an
uplink niRESET message upon completion of the reset. The first message from
an SLTA-10 Adapter after power-up will also be an uplink niRESET message
informing the host that the SLTA-10 Adapter has reset.
3 Install the network interface in one or two domains using the Update Domain
network management message. This may be done by a network management
tool across the network, or may be done directly by the host application by
sending the Update Domain message as a local network management command.
4 Change the state of the network interface to configured. This may be done by a
network management tool across the network, or may be done directly by the
host application by sending the Set Node Mode network management message.
Installing with LNS, the LonMaker for Windows Integration Tool, or the
LNS DDE Server
With an LNS-based application, the SLTA-10 Adapter is initialized automatically as
part of the system open. Prior to the system open, the application selects the desired
network interface. See the Chapter 3 Initializing and Terminating LCA Applications
in the LCA Object and Data Server Programmer’s Guide for code fragments.
When installing the SLTA-10 Adapter node, the channel definition must match the
transceiver on the SLTA-10 Adapter. If it does not, the SLTA-10 Adapter will not
accept the new values. A ‘No’ response is required to the prompt, Do you want to
install communications parameters? DO NOT use the Yes response to the
prompt: Do you want to install communications parameters? unlessthe
channel and hardware definitions are compatible with the transceiver and input clock
on the SLTA-10 Adapter.
When defining the application image, the App Image Origin field should be set to
Interface File, and the App Image Name should be set to the name of an
external interface file (XIF)created as described under Binding to a Host Node in
Chapter 3 of the LONWORKS Host Application Programmer’s Guide.
WARNING: This is NOT the default setting for the App Image Origin. If you
specify a Neuron C source file as the App Image Origin, the SLTA-10 Adapter may
be rendered unusable.
Host
‘w
I Modem 1
Telephone
Network
I Modem I
Network
Interface
transceiver LONWORKS
Network
When the SLTA-10 Adapter is configured for modem support, it will respond to
special network management messages that cause it to communicate with the
attached modem. The modem used must support the Hayes standard AT command
set allowing it to dial-out, auto-answer incoming calls, and set various parameters.
In MIP mode, the SLTA-10 Adapter cannot itself initiate any connection; it must be
commanded to do so by another node on the local network, or else by the modem’s
detection of an incoming call. This means, for example, another node on the local
network must initiate the dialing procedure when an alarm is detected that needs to
be reported to the host. Once a connection has been established, however, any node
on the local network can communicate with the host by addressing messages to the
SLTA-10 Adapter.
In order to support the modem functions, the SLTA-10 Adapter Switch2/CFG2 input
must be set to the Remote Host state (UP position). Switchl/CFG3 should be set to
the default ALERT/ACK link protocol (DOWN position). This automatically enables
the reliable network interface transport protocol. See Chapter 4 for details of the
configuration inputs. See Chapter 7 for using the SLTALink Manager with the
SLTA-10 NSI mode or Chapter 8 for SLTA-10 MIP mode DOS network driver
options.
Note that the packet throughput of the SLTA-10 Adapter is substantially reduced
when using a modem because of the overhead associated with modem support.
l The IDLE state is entered after power-up reset. In this state any uplink bound
messages are ignored since the SLTA-10 Adapter is not connected to a host.
The IDLE state is also entered whenever the telephone connection is broken
and the modem drops the DCD (Data Carrier Detect) line.
l The FAILED state is entered if the connection process failed. This state is
operationally the same as IDLE.
The connection state of the SLTA-10 Adapter is preserved across software resets,
allowing normal network management resets to occur without breaking the
connection. The SLTA-10 Adapter will not preserve the connection state after it has
been through a power reset.
Translated Characters
All strings that are sent specifically to the modem (as commands) by the SLTA-10
Adapter are scanned for certain characters by the SLTA-10 firmware. These
characters are then translated into specific functions or characters unless they are
preceded by a backslash (“\“>. The characters are:
The tilde will cause the SLTA-10 Adapter to pause 500ms before sending the
next character to the modem. The tilde itself is not sent.
! The exclamation point will cause the SLTA-10 Adapter to send a carriage
return (OxOH) to the modem. The exclamation point itself is not sent.
The tilde is provided for users familiar with existing modem packages. It can be
used, for example, in the command string which causes the modem to hang-up. When
dialing out, Hayes AT-compatible modems use the comma character to insert delays
between portions of a dial command; the comma character should continue to be used
for dialing out.
DTE Connections
In addition to the basic three wire connections-Transmit Data (TXD), Receive Data
(RXD), and Signal Ground- there are two additional signals that must be connected:
Data Carrier Detect (DCD) and Data Terminal Ready (DTR). The modem must also
be configured to use these signals. DCD is used by the SLTA-10 Adapter to
determine that a connection has been made and DTR is used to terminate a
connection by hanging up. Note that many modems default to ignore these two
signals and must be configured to enable them. The following AT command enables
these two signals on many modems.
AT&Cl&D2[CR]
These network management messages may be sent from any node on the network to
the SLTA-10 Adapter. If an application node wishes to send modem-control network
management messages to the SLTA-10 Adapter, it does so using explicit messaging.
See Chapter 4 of the Neuron C Programmer’s Guide for details on explicit messaging.
The message should be delivered using request/response service, and the message code
for modem control messages is always 7D hex. The data portion of the message always
begins with a sub-code value of 1, indicating that the message is addressed to an
SLTA-10 Adapter, followed by an application command byte indicating which modem-
control command this is. This is followed by parameters specific to the application
command. These messages may be sent by a Neuron C-based node, a node based on
the Microprocessor Interface Program (MIP), or a node based on another SLTA-10
Adapter.
Note that the SLTA-10 Adapter will be unable to receive any messages, including
these network management messages, if network communications is disabled, i.e., it
is in the FLUSH state. This will normally be the case if it is not connected to a host.
Therefore, in order to be able to dial-out and connect to a host, the SLTA-10 Adapter
must be configured to initialize with network communications enabled, i.e., the
NORMALstate, with the CFGl input. See Chapter 4 for more details.
The messages should be sent with request/response service, and the response code
should be checked to see if the message was executed correctly - it will be Ox3D if
there was no error, and OxlD if there was. Possible failure conditions are noted
under each message. Some of these network management messages return data to
the sender in the response structure as noted below.
Note that some of these messages cause one or more bytes of EEPROM in the
SLTA-10 Adapter to be written. Each byte of EEPROM takes 20ms to write, and the
response is not sent by the SLTA-10 Adapter until after the command is executed.
This time should be taken into account when setting the transaction timer
(tx-timer) in the message tag connection for implicit addressing, or in the
destination address for explicit addressing. If the LonBuilder or LonManager API
binder is used to create the connection, the transaction timer may be explicitly
specified.
Example:
msg.-tag SLTA-tag;
when ( . . . ) {
msg-out.code = Ox7D; // network mgmt msg code
msg-out.tag = SLTA-tag;
msg-out.service = REQUEST;
msg-out.data[O] = 1; // sub-code for SLTA-10
msg-out.data[ll = app-command; // specific command
msg-out.data[2] = ..... // additional parameters
msg-send();
when (resp-arrives(SLTA-tag) {
// SLTA-10 Adapter did respond to the message
if (resp-in.code == Ox3D)
// command executed successfully
...
Many of these network management messages, for example the “Install...” messages,
may be sent to the SLTA-10 Adapter from the host computer via the telephone link if
the SLTA-10 Adapter is in the CONNECTEDstate. In this case, they should be sent
using the niNETMGMT network interface command so that they are addressed to the
SLTA-10 Adapter itself.
Structures are defined in the file SLTA-ANM . H for each of the application commands,
and include the sub-code and app-command fields, as well as any additional
parameters for the specific application command. If the response contains data other
than the response code, a structure for the returned data is also defined.
For the SLTA-10 MIP mode, the EEPROM pool consists of the following strings:
l One dial-out prefix string. This string is sent as a prefx to any dial-out
operation to specify the modem dial command and to indicate whether tone or
pulse dialing should be used.
For the SLTA-10 NSI mode, the EEPROM pool consists of the following strings:
l One modem initialization string. This string is used to initialize the modem as
required.
l One dial-out prefix string. This string is sent as a prefer to any dial-out
operation to specify the modem dial command and to indicate whether tone or
pulse dialing should be used.
EEPROM storage and allocation for these strings is managed by the NSI mode EEPROM
pool. This allows flexible utilization of the SLTA-10 Adapter’s NSI mode EEPROM space.
The NSI mode pool consists of 8 blocks, each with 12 bytes of data storage space. A
string occupies one or more blocks.
The NSI mode EEPROM pool does not require the exclamation point (translated to a
carriage return) in the dial directories; whereas, it is required in the MIP mode EEPROM
pool. In addition, the NSI mode EEPROM pool does not require a null terminator on
exact sector size strings. In the MIP mode EEPROM pool, if a string winds up ending on
the last byte of a sector, a subsequent sector is required to hold the null terminator.
The network management functions that install these strings allow incremental
EEPROM writes, and include a total-s i ze field. Incremental writes allow long
strings to be installed without the requirement of large buffer sizes on the SLTA-10
Adapter. If the total-size field is greater than the amount of EEPROM storage
space available then the network management message response will indicate a
failed status. In all cases the strings should include a null terminator.
The off set field in the install messages indicates the starting point in the complete
string of the current string piece to be installed. The first byte of the complete string
is at offset zero. If the offset is such that the string piece would not fit in the
All pieces of a string should specify the same value for total-size. Otherwise it
means that you are starting over with a new string.
Once a particular string has been installed in the pool, it may be deleted by re-
installing it with a total size of 0. Alternatively, the Clear EEPROM Pool message
may be issued to clear the whole EEPROM string pool.
Product Query
This message may be used to check the type of interface product that the node is
running. The value returned for the SLTA-10 Adapter is a ‘1’. Application nodes will
respond with a failed code of OxlD returned for this or any message where the
request message code is Ox7D.
typedef struct {
byte sub-code; // always #1
byte app-command; // value = 1
} ANM-product-query-request;
typedef struct {
byte product; // for SLTA-10 Adapter, = 1
1 ANM-product-query-response;
typedef struct {
byte sub-code; // always #1
byte app-command; // value = 2
STR-mode mode;
char modem-string [I;
)ANM-send-str-request;
If a large string needs to be sent to the SLTA-10 Adapter, use a series of these
requests with a single carriage return in the last string. Note that many modems
have a limited input buffer size, typically 32 to 80 bytes.
The mode parameter is used to control the connection state of the SLTA-10 Adapter.
The values for this parameter are:
0 Make no change to the SLTA-10 Adapter’s modem connection state. Send only if
not CONNECTED.Otherwise, respond with a failed status.
1 Initiate a dial-out connection. If the SLTA-10 Adapter is already currently
connected, preserve that connection, and ignore the message. The SLTA-10
Adapter’s connection status changes from IDLE to CALL-IN-PROCESS, unless
the connection is already made, in which case the state stays at CONNECTED.
The dial-out prefix is sent first.
2 Same as ‘l’, but disconnect (hang-up) if currently connected before initiating the
new connection.
typedef struct {
char response[]; // null terminated string
1 ANM-modem-response-query-response;
typedef enum {
IDLE = 0,
FAILED = 1,
CALL-IN-PROCESS = 2,
CONNECTED CT3
] CONN-state;
typedef struct {
CONN-state connection-state;
} ANM-connect-state-response;
typedef struct {
byte sub-code; // always #I
byte app-command; // value = 7
STR-mode mode;
byte dir-num; // value = O-7 for MIP; O-4 for NSI
) ANM-dial-dir-request;
If the directory entry does not exist, the response to this message will indicate a
failure. A successful response to this message indicates that the SLTA-10 Adapter
has sent the dial-out command to the modem, not that the modem has successfully
dialed. The Connection Status Query message should be sent to determine whether a
successful connection has been established.
Hang-up
This message causes the SLTA-10 Adapter to pulse the EIA-232 DTR signal (Data
Terminal Ready) low for 500ms. If the DCD signal is still ON following this step,
then the SLTA-10 Adapter will send the hangup string (see below) if it is not a null
string. This will terminate the connection, and the SLTA-10 Adapter enters the IDLE
state. The response will not be sent until this process is complete. Therefore the
transaction timer for this message should be set to at least 768ms if it is sent from a
node on the network. If this message is sent from a remote host, no response should
be expected, since the connection will have been broken before the response can be
sent.
typedef struct {
byte sub-code; // always #I
byte app-command; // value = a
boolean if-config;
} ANM-hangup-request;
Install Password
This message stores a dial-in password in EEPROM. The default setting for this
string is a null string, which results in no password requirement by the SLTA-10
Adapter. Any node on the network may change the password, but an external host
must have already connected and used the existing password in order to change it,
unless it was blank. Any installed SLTA-10 Adapter should use a password,
otherwise an intruder might change the password to another setting.
The password string is limited to 8 characters, and may be any sequence of non-zero
eight bit values. The string must be null-terminated.
typedef struct {
byte sub-code; // always #I
byte app-command; // value = 9
char passwd_string[81;
) ANM-install-passwd-request;
If a password is installed in the SLTA-10 Adapter, the host must issue the niPASSWD
network interface command to the SLTA-10 Adapter after the connection is
established. The code for this command is OxE4, and it should be followed by up to
eight password characters, null terminated. For details on sending network interface
commands, see the LONWORKS Host Application Programmer’s Guide.
Configure Modem
This message will cause the SLTA-10 Adapter to send its Modem Configuration
String to the modem provided it is not in the CONNECTED state. See the Install
Modem Configuration String message for further details. If the modem is in the
CONNECTED state, the failed status will be returned.
typedef struct {
byte sub-code; // always #I
byte app-command; // value = 14
1 ANM-modem-config-request;
typedef struct {
byte sub-code; // always #I
byte app-command; // value = 16
} ANM-clear-eepool-request;
typedef struct {
byte sub-code; // always #I
byte app-command; // value = 17
byte NVConnect; // two 4-bit fields
) ANM-install-nvconnect;
typedef struct {
byte sub-code; // always #I
byte app-command; // value = 18
byte NSIConnect; // two 4-bit fields
1 ANM-install-nsiconnect;
The SLTA-10 Adapter has been tested with the following modems:
Best Data Smart One external modem 33,600 bps Data/Fax modem
Diamond SupraExpress 336e external faxmodem
You should disable XON/XOFF flow control in the modem when using it
with the SLTA-10 Adapter.
Note: When using the Hayes Accura external Fax Modem with Simultaneous Voice
and Data 33.6 modem with the US Robotics 28.8 Faxmodem with Personal Voice
Mail, an incompatibility in communication occurs. Testing the two modems via
Hyperterminal reveals that the CD signal (Carrier Detect) is incorrect. Due to this
communication incompatibility, do not use these two modems together with the
SLTA-10 adapter.
The SLTA-10 Adapter has been tested with the following V.90 modems:
Best Data Smart One 56SX V.90
Zoom Telephonics Faxmodem 56KX Dualmode
The V.90 modems were tested using default Windows settings on the host side:
1 Default I
Use error control On I
Compress Data On I
Hardware (RTSZTS) Flow Control On
Standard Modulation Type On
When using the USRobotics modem on the SLTA-10 side, set the DIP switch SW4 on
the modem to the DOWN position. This configures the modem for “No echo offline
commands”.
Hardware Setup
Assuming the use of a modem with speeds less than or equal 28.8K band, set the
switches as shown in figure 11.2.
Figure 11.2 DIP Switch Settings for Use with a Diamond SupraExpress 336e Modem
Use an Echelon Model 73380 Null Modem Cable between the SLTA-10 and the
modem. A 3-conductor cable, complete with connectors wired as shown in table 3.1,
also will be required.
Software Setup
The host PC must be operating under Windows 9598, or NT. For the purposes of
this example, the PC uses Windows 95.
Run the setup. exe supplied for the SLTA-10 Driver and the SLTALink Manager
software. After common installation queries are addressed, the setup program will
display the dialog box shown in figure 11.3. Answer “Yes” if using 16-bit
LonManager API for Windows-based applications. Answer “No” if suing 32-bit LNS-
based applications, i.e., LonMaker for Windows Integration Tool.
SLTALin k Manager
The SLTALink Manager software provides the interface to setup the SLTA-10 for
different modes of operation. The remote PC is assumed to have the network
database required for the connection application. The LonMaker for Windows tool is
assumed for this example.
To configure the SLTA-10 and modem for remote dial-in access, follow these steps:
1. Temporarily connect the serial port of the host PC directly to the SLTA-10.
2. Click on the SLTALink Manager icon found in the notification section of the
taskbar (figure 11-5).
3. Confirm that the left panel of the SLTALink status bar shows the ‘Local
SLTA-10’. If not, then click on the Link. Select> menu to select the Local
SLTA-10.
4. Click on the Manual Connect Link speed button (left-most button on the
toolbar) to establish a connection to the local SLTA-10. A successful
connection will immediately be reported in trace frame of the SLTALink
Manager. If the application requires only a dial-in from a remote SLTA-10
to a host PC, then the main configuration concern is the password used to
gain access to the SLTA-10 remotely. Use the Device. Conf igure SLTA...
dialog to set the password used to control access to the SLTA-10 (figure 6).
Figure 11.6 showsa Password, with Clear EE Pool on Apply selected,
and Auto-dialout options not selected. When Apply button is clicked,
the SLTA-10 connected to the PC updates with the new configuration
information.
5. The SLTA-10 can now be tested by running the LonMaker for Windows tool
and selecting SLTALONl to make the current active local SLTA-10 be the
network interface. In the LonMaker for Windows tool, the
LonMaker . Status Sumary... command will provide a quick confirmation
that the SLTA-10 functions properly and can reach all devices in the target
network. Once the operation of the SLTA-10 has been established, shut
down the LonMaker for Windows tool and manually disconnect the local
SLTA-10 using the SLTALink Manager.
6. Connect the proper null modem cable between the SLTA-10 and the modem
and verify that both devices are powered.
7. From SLTALink Manager, use the Link. New...command to define the
remote connection description. See figures 11.7 through 11.9.
9. Provide the password that was configured during the local connection, as
shown in Step 5.
12. Attach the remote SLTA-10 modem to the telephone network. The SLTA-
10 is now configured to dial-in and perform the network management
functions required to diagnose and maintain the network just as if there
was a local connection between the host PC and the remote site. To
establish the remote connection, connect the modem of the PC operating
the network management tool (i.e., LonMaker for Windows tool) to the
telephone network, select the remote link just defined using the
Link. Select> menu function, and click on the Connect speed button. A
successful remote connection is shown in figure 11.10. The network
management application can now connect to the SLTALONl device.
I Skip this Chapter if you are using the SLTA-10 NSI mode.
-Bbps To change the LDVSLTA network driver serial bit rate. The
default is the current setting of the network driver. This
controls the link rate between the host computer and the
modem. The acceptable values for the bps value are the same
as those available on the SLTA-10 Adapter: 12 0 0, 2 4 0 0, 9 6 0 0,
14400,19200,38400,57600, and 115200.
All options must precede string arguments on the command line when
evaluated from left to right.
12-2 Using the DOS Host Connect Utility with SLTA-10 MIP Mode
response from the modem before sending the next string. This requires that
word (alphabetic) modem responses are enabled in the modem. If the OK
response does not appear within 4 seconds, HCU will stop waiting and proceed
to the next string.
Theory of Operation
Upon execution, HCU will open the network driver, set the driver’s operational
mode to modem support on, force direct mode on (disables any SLTA-10
Adapter network interface protocols, enabling communications with the modem
itself), modem responses on (enables modem responses to be passed to the
host), and reliable transport protocol on. If a serial bit rate has been indicated,
this also is set within the driver.
Next, if the HCU hangup operation is selected, HCU will drop DTR for 500ms.
See Using the SLTA-10 Adapter with a Modem, Chapter 11.
Next, all string arguments are sent to the modem. Acceptable modem
responses to these strings are OK or ERROR.
Next, if the HCU connection operation is selected, HCU will wait for the
connection to be established. This wait will be terminated by one of the
following conditions:
l A response from the modem indicating either success or failure. These responses
may be one of the following. [CR] is the carriage return (OxOD) character.
CONNECT[anytextl [CR] This indicates a successful connection.
These indicate a failed connection:
NO [anytextl [CR], BUSY [CR], VOICE [CR1
l Any keyboard action. This will abort the HCU process.
Once the connection is considered made, HCU will process any additional
modem responses for a few seconds. It will then change the operational mode
of the network driver to force direct mode off and modem responses off. If this
Finally, if the user has indicated that a password is to be used, HCU will send
the password command plus the password to the remote SLTA-10 Adapter, and
wait for a response. If the response does not appear within five seconds, or if
the response is not an acknowledgment, the process is repeated up to two
additional times.
HCU will exit with a status of zero if the connection or hangup was successful.
Otherwise the exit status will be ‘1’. Upon successful exit the network driver
state will be set to modem responses off. This implies that if the connection is
broken during the course of a host application execution the network driver will
not start sending modem responses back to the host application, since it may
not know how to handle them.
If operating under Microsoft Windows 3.1x, dialing out to a remote SLTA-10
Adapter requires running the DOS program HCU. EXE in a session prior to running
the Windows API application. The HCU source code is available from Echelon for
integration into a DOS application. ~
When using HCU with the Windows 95/93 operating system, use the following
procedure:
l After the message “successfully connected” and the DOS prompt appears, EXIT
(type c: \>exit) DOS box.
Usage Examples
To connect at 9600 bps with a modem initialization string included in the
process:
HCU -b9600 -pSLTA-2.0 "ATMlElS8=1!" "ATDT9,555-1234!"
It is important to remember to include the carriage return (‘!‘> at the end of
each command string argument.
To hangup:
HCU -h "---+++---ATHO! M
12-4 Using the DOS Host Co(mect Utility with SLTA-10 MIP Mode
hcu -b9600 -pSLTA-2.0 Qdial.cmd
if not errorlevel 1 hostapp.exe
hcu -h n---+++---athO ! fl
l Send modem responses: enabled ("~0"). This causes the modem to respond
to commands sent to it with a result code.
l Word responses (“~1”). The modem result codes will be expressed as full
word codes (alphabetical) rather than as numerical codes.
l Full response set ("x4" or "~2"). This will include the BUSY and NO
DIALTONE responses, which will expedite the process when these cases
occur.
l DTE flow control: disable ("s 5 8 = 0" for Telebit modems, "&KO" for Hayes
modems). If your modem uses software (XON/XOFF) flow control,
you must disable it since the SLTA-10 Adapter link layer is a binary
one.
l Auto-answer: enabled ("s o =l">. If you need your Host modem to answer to
an incoming call from a remote SLTA-10 Adapter and modem, you will need
to enable this feature.
where nun/ dd/ yy is the current month/day/year, and hh/nun/ ss is the current
time. All modem responses are also displayed.
Device initialization error, Indicates a problem with initializing the network driver.
devname
Could not open file filename Indicates a problem with opening the string argument file.
Password Format error, abort Indicates there was a problem interpreting the password
argument.
Modem Response Timeout Indicates that the modem did not respond to a command
string.
DCD state test error, deuname Indicates a problem communicating with the network
driver.
Connect timeout, devname Indicates that the connection was not established within the
connection timeout period.
User Abort Indicates that the connect wait process was aborted by the
user.
Password Validation Fail Indicates that the remote SLTA-10 Adapter has responded
to the password command with a negative acknowledgment.
You are probably using the wrong password.
Password Validation Complete Indicates a successful password command transfer with the
remote SLTA-10 Adapter, and that HCU has successfully
communicated with the remote SLTA-10 Adapter.
Hangup Failed, Still Indicates HCU still thinks that the connection is made
Connected following a hangup. This could be the result of a persistent
DCD ON level.
12-6 Using the DOS Host Connect Utility with SLTA-10 MIP Mode
13
Using a Programmable Serial
Gateway
Depending on the hardware you intend to use, one of the following #defines
must be defined in your source ( . NC)just before the PSG. H file is included.
-----------------__. I
I
I
I
i
EIA-232 ; UART - LONWORKS
I Network
I
Trans- I
I ceiver
I----------------___
2. The two header files (PSG. H and PSGREG. H) should be copied to your
development tool include directory. By default, this directory is
c:\lonworks\neuronc\include.
3. The final step is to copy the PSG. LIB file to your development tool’s library
directory. By default, this directory is c : \ lonworks \ images.
PSG/3’s are modified to ignore DIP switch #4. The NSI memory map is the only
available memory map.
In most cases, this library provides all the functions necessary to control the
UART hardware and to read and write data from the serial port. Your
application program will normally make use of some or all of the firmware
functions included in the library PSG. LIB. Prototypes for the following
functions, and the enumeration literals used in the following descriptions, are in
the include file PSG. H.
This library is available for free download from the licensed software section of
the Developer’s Toolbox at www.echelon.com. The library also is provided with
the NodeBuilder Development tool.
This will control which low-level I/O access functions are used. Include the
#define before the #include <PSG. H> statement. For example:
#include cnetdbg.h>
#define PSG20
#include cpsg.h>
...
when (reset)
I
...
1
#include <netdbg.h>
#define PSG20
#include <psg.h>
when (reset)
{
3
4. Insert the FLASH. into the PSG and power the PSG. Be sure that your
NodeBuilder tool is connected to the PSG using the LONWORKS network.
(The same way you would connect to any other custom node.)
Note: You should remove the reference to cne tdbg . h when creating
your final distribution build.
format-6Nl 6 no one
format-601 6 even one
format-5Nl 5 no one
1format-5El I 5 I even I one I
format-501 5 odd one
Example:
when (reset) {
slta-init(format_8Nl, baud-38400, intfc-3wire);
1
MSB LSB
boolean slta-txrdy(void);
This function returns TRUE if the UART is ready to accept a character to be
transmitted and FALSE otherwise.
Example:
network input SNVT-str-asc text-message;
when(nv-update-occurs(text_message)) {
slta-puts(text-message.ascii);
slta-puts("\r\nN);
long slta-getchar(void);
This function tests to see if a character is waiting in the UART’s input FIFO
buffer. If there is no character waiting, the function returns - 1. If there is a
character waiting, it is returned in the least significant byte, and zero is returned
in the most significant byte.
Example:
when (slta-rxrdy()) { // keep polling UART
char c;
c = (char) slta-getchart); // get the character
1
Advanced Applications
For most applications, the functions in PSG . LIB are all that are necessary to
create custom programs for a programmable serial gateway using Neuron C.
However, for specialized applications, the registers of the UART and the
programmable serial gateway may be accessed directly by the application
software. This section describes these registers and how they are accessed. For
complete documentation, obtain a data sheet for the UART. The UART is an
Exar Model 16C5501 (httn://www.exar.com/products/st16c550.html).
This function writes the data byte to the memory mapped I/O location defined by
addr.
extern unsigned slta-read-uart (unsigned addr);
This function reads the data byte from the memory mapped I/O location defined
by addr, and returns that value.
The map for the extended address space is shown in the following sub-sections.
Neuron C declarations for these addresses and bit assignments are provided in the
include file SLTAREG . H on the PSG software diskette.
PROM (90ns)
5. Recompile your application and link with the PSG. LIB library.
This chapter provides solutions to problems that may arise with a modem
attached to an SLTA-10 Adapter.
The most common problem is a failure to use the correct SLTA-10 Null Modem
Cable specified in Chapter 3.
l Mismatched network interface link protocols. One end is using the ALERT/ACK link
protocol and another is using the buffered link protocol. These settings are
determined on the SLTA-10 Adapter by Switchl/CFGS and in the host by network
driver switches. The ALERT/ACK link protocol should be used (OFF/down position
for SwitchlICFG3 on the SLTA-10 Adapter).
l Using the Host Connect Utility in the wrong network interface link protocol. HCU
can and may modify the current configuration of the DOS network driver. Ensure
that the command line switches for the HCU maintain the desired network interface
link protocol and serial bit rate settings. For example, you may have used the /N
option with the DOS device driver, but did not use the -N switch with HCU.
l Using XON/XOFF flow control in your modem. Since the SLTA-10 Adapter network
interface protocol is a binary one, this configuration will interfere with, or lock up,
your modem. Be sure that this feature is disabled in your modems.
l Use with Microsoft Windows 3.1x, particularly at higher serial bit rates (9600 or
greater). This is always a problematic case. The priority of the serial I/O interrupts
for PC/ATs is always lower than the DOS tick interrupt, which is used by Windows
to perform many multi-tasking services. During these services, the serial I/O
interrupts may not be serviced in time, resulting in lost uplink data. One solution is
to lower the serial bit rate. Another solution may be to replace the PC/AT’s UART
with the 16550 UART, which has a 16 byte FIFO buffer built into it. This only
works for external modem configurations, and will add about 16ms of interrupt
headroom at 9600 bps, because of the hardware FIFO buffer. Another suspect in
this area can be a disk caching program. These programs also perform services
under the DOS tick interrupt, such as flushing data onto the disk drive, which can
postpone serial I/O interrupts for lengthy periods.
l Modem serial bit rate overrun. For example, if the SLTA-10 Adapter serial bit rate
is set to 38,400 bps and the modem telephone line speed is set to 2,400 bps, the
modem will likely be overrun by sending it data faster than it can transmit it. This
can occur since no flow control schemes can be used to restrict the rate that data is
sent to the modem. In general, set the modem link rate equal to the telephone line
speed. In certain cases it will be acceptable to exceed the telephone line speed - for
instance, with a 14,400 bps V.32bis modem with data compression enabled, it may
be possible to run the modem link at 19,200 bps.
l Full duplex FIFO overrun. This is caused by excessive full duplex traffic when
using the buffered link protocol. The ALERT/ACK link protocol should be used
instead.
LONWORKSDLL Interface
Software
Microsoft Windows 3.1x supports access to DOS drivers through an interface layer
called DOS Protected Mode Interface (DPMI). This interface standard defines the
requirements to switch the processor between protected (Windows) and Real (DOS)
mode operation, and also the mechanisms for proper data transfer between code
running in these operating environments. Using DPMI, the same driver may be used
in DOS, Windows 3.1x, and Windows 95198 without modification.
The DPMI layer that allows access to the LDVSLTA.SYS and other DOS drivers
provided by Echelon is contained in the Windows 3. lx DLL, WLDV.DLL. This DLL is
part of the LonManager@ API for Windows, and the LonManager DDE Server. It is
also supplied on the Windows 3.1x DLL diskette. The LonManager API provides high
level functions for network installation, maintanence, monitoring, and control. The
LonManager DDE Server provides a simple Dynamic Data Exchange (DDE) interface
for other client Windows applications to access to a LONWORKS based network for
monitoring and control.
Programs specify a logical network driver name when first requesting access to the
network. The WLDV.DLL supports simultaneous access to a maximum of eight (8)
DOS drivers. The functions provided by WLDV.DLL are described in the following
section.
A-2 Appendix A
ldv-close
Purpose
Terminates access to the network interface hardware.
Syntax
#include <ldv.h>
short ldv-close(short handle);
See Also
ldv-open0
Returns
LDV-OK (0) Device closed successfully.
LDV-NOT-OPEN (3) Invalid handle or device not open.
Parameters
handle short
Device identifier returned by ldv-open ().
Syntax
#include <ldv.h>
const char far * ldv-get-version(void)
See Also
None.
Returns
char far * Character pointer to text string containing the
WLDV. DLL version number.
Parameters
None.
A-4 Appendix A
ldvjoctl
Purpose
Ldv-octl error codes are the same as for ioctl(); the number of bytes actually
transferred. -1 implies invalid handle, func, or device type. Only DOS device drivers
are allowed.
Syntax
int ldv-ioctl (int handle, unsigned char func, pVoid argdx, int argcx);
See Also
1dv.h
Returns
Parameters
The only valid values for ‘func’ are:
Appendix A
ldv-read
Purpose
Retrieves an available message from the network interface hardware. The function
returns immediately when no messages are available. An error is returned when the
next available message is longer than the specified buffer length.
Syntax
#include <ldv.h>
short ldv-read(short handle, void far *msg-p, short len);
See Also
ldv-write0
Returns
LDV-OK (0) Message read and placed in the buffer
pointed to by msg-p.
LDV-NOT-OPEN (3) Invalid handle or device not open.
LDV-DEVICE-ERR (4) Error occurred accessing device.
LDV-NO-MSG-AVAIL (6) No message available.
LDV-INVALID-BUF-LEN (9) Invalid buffer length.
Parameters
handle short
Device identifier returned by ldv-open ().
n-w-p void far *
Pointer to the buffer into which the message will be
placed.
len short
Length of buffer, in bytes.
Paramters
handle short
Device identifier returned by ldv-open ( 1.
msg_p void far *
Pointer to buffer containing the message to be
delivered to the network.
len short
Length of outgoing message, in bytes.
A-8 Appendix A
ECHELON” DECLARATION OF CONFORMITY
Place: Amersfoort, The Netherlands Date: October 2000 Position: Controller, Echelon Europe