Manual ETH-IDIO-16 B1
12
Chapter 5: Programming
TCP/IP
This model family is TCP/IP. The source for our Windows DLL is installed with the samples, into the
.\Win32\Driver.SRC\AIOETHW\DLL\ directory. The intent is for any language and operating system able to
send TCP/IP packets to be able to utilize the unit.
Client API
To install the client, simply copy AIOETHW.dll next to the program that will use it, or to the 32-bit system
directory.
The general sequence to use it is:
•
AEW_Connect() to open a connection.
•
AEW_DIO_Configure() to set the initial digital input vs output configuration, and disable the tristate.
•
Repeated I/O calls, using AEW_DIO_WriteAll()/AEW_DIO_Write1(), AEW_DIO_ReadAll().
•
AEW_Disconnect() to close the connection when done.
If the connection fails during operation, a new connection can be swapped in, like this:
•
AEW_Disconnect() to close the old connection.
•
AEW_Connect() to open a new connection.
•
Resume with the I/O calls.
The following is a brief reference of common AIOETHW.dll functions.
AEW_Connect()
AEW_Connect() connects to the specified host device. It returns a client reference (like a handle) that
represents the connection, or zero on a failure.
AEW_Disconnect()
AEW_Disconnect() disconnects a client reference, closing the connection and cleaning up any memory used.
After being passed to AEW_Disconnect(), the client reference is invalid.
AEW_GetStatus()
AEW_GetStatus() reads the device's status block.
AEW_DIO_Configure()
AEW_DIO_Configure() sets the direction of the DIO bytes, writes to all of them, and then disables the tristate.
Writes to input bytes are ignored.
AEW_DIO_WriteAll()
AEW_DIO_WriteAll() writes to all the DIO.
AEW_DIO_ReadAll()
AEW_DIO_ReadAll() reads from all the DIO.
For a complete AIOETHW.dll API reference please refer to the HTML API reference installed in your
software directory.