Manual ETH-DIO-48
14
Low Level Interface Information
The following information is provided for users who cannot or choose to not use
AIOETHW.dll. This is necessary in non-windows operating systems. For your reference
consider reading the source code for AIOETHW.dll provided with your software install.
More information is available in the HTML API reference installed in your software directory
Packet Structure
A packet is a byte-lengthed string; the first byte is the length(in bytes) of the body. A
packet's body consists of a 4-byte ASCII type and zero or more bytes of payload.
Defined packet types are as follows:
Type Direction Meaning
Payload
ChNW
M>S
Change
network
settings.
IP address, subnet mask, and gateway IP address, each in 4-byte
big-endian format. For example, C0 A8 01 AE FF FF 00 00 C0 A8
01 01 for 192.168.1.174, 255.255.0.0, and 192.168.1.1. Device
should reply with
W_OK
or
_Err
.
ChIP
M>S
Change IP
address.
4-byte big-endian IP address. For example, C0 A8 01 AE for
192.168.1.174. Device should reply with
W_OK
or
_Err
.
ChSN
M>S
Change
subnet mask.
4-byte big-endian subnet mask. For example, FF FF 00 00 for
255.255.0.0. Device should reply with
W_OK
or
_Err
.
ChGW
M>S
Change
gateway IP
address.
4-byte big-endian gateway IP address. For example, C0 A8 01 01
for 192.168.1.1. Device should reply with
W_OK
or
_Err
.
RSta
M>S
Read status.
No payload defined at this time. Device should reply with
R_OK
or
_Err
.
RADI
M>S
Read "all"
DIO data.
No payload defined at this time. Device should reply with
R_OK
or
_Err
.
RPDI
Reserved for reading partial DIO data.
WADO
M>S
Write "all"
DIO data.
1-byte length of DIO data, then DIO data. For example, 06 01 02
04 08 10 20 to set bit 0 on the first byte of DIO, bit 1 on the next
byte of DIO, etc. up to bit 5 on the last byte of DIO. Device should
reply with
W_OK
or
_Err
.
WPDO
M>S
Write partial
DIO data.
1-byte length of mask+DIO data, then mask, then DIO data. Each
bit set in mask corresponds to a bit in DIO data to write. For
example, 0C 03 00 00 00 00 00 01 00 00 00 00 00 to set bit 0
high and bit 1 low on the first byte of DIO, without changing bits 2-
7 or any other byte. Device should reply with
W_OK
or
_Err
.
W_OK
S>M
Write
succeeded.
1-byte length of written data. For example, 01 to indicate success
of a 1-byte write.
R_OK
S>M
Read
succeeded.
1-byte length of read data, then read data. For example, 03 42 49
4F to read 42h, 49h, and 4Fh.
_Err
S>M
Transaction
failed.
4-byte little-endian Windows error code. For example, 42 00 00
00 for ERROR_BAD_DEV_TYPE, indicating read from a write-
only device or vice versa.
Table 5-1: Packet Type Definitions