300
Accessing I/O Data Via TruePort
Accessing I/O Data Via TruePort
Introduction
Analog and Digital I/O data, as well as output control, can be accessed in several ways. To have
access from an application running on a workstation or server, the I/O Applications Program
Interface (API) provided within Trueport can be used. This API uses a command/response format to
get or set data on each individual I/O channel register. A sample program (
ioapiotp.c)
demonstrating typical usage can be found on the IOLAN product CD-ROM.
Setup
After TruePort has been properly installed and configured on the workstation or server and initiated
from the application, it will setup a connection to the appropriate IOLAN. It will then be available to
relay commands to the IOLAN and communicate responses back the application. TruePort will create
a COM port to which the application can write commands to and read responses from. Since all
communications are done via this COM port, the application need only use standard serial
communication interface calls.
The following steps should be taken:
1. Install the Trueport software on the server or workstation on which the application will be
running.
2. Configure the virtual communication port (COM) (see Trueport User Guide for details).
3. Run the application. Typically the application will:
a. Open the COM port.
b. Send Commands to the COM port using standard write commands.
c. Read Responses from the COM port using standard read commands.
d. Once the desired operations are completed, the COM port can be closed.
Note:
All commands are forwarded to the IOLAN over the network where the specific I/O
channel registers are modified or read, and then responses are sent back to TruePort
where they will be made available to be read from the COM port.