User`s manual
C
C
Appendix C DIO Commands
In this appendix, we present the DIO commands used to access the Digital I/O status of the
WE-2100T from an Ethernet network. The Digital I/O status can be accessed by a specific TCP
port (default 5001) on the WE-2100T.
Command Packet Format
Length (Bytes)
4 1 – 255
Format
*Header Data
Send the Command packet to the WE-2100T. The “Data” field is command specific.
ACK Packet Format
Length (Bytes)
4 1 -255
Format
*Header Data
The WE-2100T returns by ACK packet. You can determine a DIO channel's status and mode by
checking the “Data” field of the packet.
*Header Format
Length (Bytes)
1 1 1 1
Format
Command Version
(must be 2)
Command Status Length (for data)
Check the “Command Status” to obtain the result after sending a Command packet.
Command: This field specifies the command code. For example, 1 (hex) represents “read single
D I/O.” Command codes are listed later in this appendix.
Command Status: This field returns the status of the command.
0 – OK
1 – Command error; may be unknown
2 – Version error; not supported by this version
3 – Length error; the length member does not match the attached data
4 – Operation error; you cannot set the DIO mode to input mode, and set the DO status at
the same time
5 – “Packet too short” error
6 – DIO number error; might not support request DIO number
0xFF – other unknown error
Data Structure Definition:
C code example:
//define DIO Header format