45 lines
1.7 KiB
HTML
45 lines
1.7 KiB
HTML
<HTML>
|
|
<HEAD>
|
|
<TITLE>Serial Port Direct Access</TITLE>
|
|
</HEAD>
|
|
<BODY>
|
|
<H1>Serial Port Direct Access</H1>
|
|
<P>
|
|
At SINQ serial devices are connected to a UNIX/LINUX computer. On this machine runs a serial port server which allows to read and write data through TCP/IP sockets to a serial port connected to the machine. This document describes a simple interface for communicating with such serial devices.
|
|
</p>
|
|
<H2>Invocation</H2>
|
|
<P>
|
|
The interface to a serial device connected to a UNIX/LINUX computer is initialised with the following command given at the Tcl prompt:<BR>
|
|
<EM>Controller name computer port channel</EM><BR>
|
|
This command opens a connection to the serial port on the UNIX/LINUX machine and installs a new command in order to interact with it. The parameters:
|
|
<UL>
|
|
<LI><b>name</b> is the name of the new command to generate for the connection in Tcl.
|
|
<LI> <b>computer</b> is the computer name of the UNIX/LINUX machine.
|
|
<LI> port: is the TCP/IP port number at which the UNIX/LINUX machine
|
|
serial port server is is listening. Usually this is 4000.
|
|
<LI>channel: is the number of the RS-232 port to connect to.
|
|
</UL>
|
|
<p>
|
|
<H2>Usage</H2>
|
|
<P>
|
|
Once the connection has been initialised name is available as a new command
|
|
in Tcl. Let us assume, MC as the name for the purpose of this description.
|
|
MC then can be used as follows:<BR>
|
|
<EM>MC -tmo value</EM><BR>
|
|
Configures the timeout for the connection to value.
|
|
Value is in microseconds.<BR>
|
|
<EM>MC arg1 arg2 ..... argn</EM><BR>
|
|
Everything after MC is written to the serial port. The reply received from
|
|
the port is returned.
|
|
</p>
|
|
|
|
<P>
|
|
All these commands can return errors. Mostly these refer to the wrong device
|
|
being specified on initialisation. The others are network problems.
|
|
</P>
|
|
|
|
|
|
|
|
</BODY>
|
|
</HTML>
|