Binary to Hex Conversion
10. Binary to Hex Conversion
Many of the Device Server’s configuration procedures require you to assemble a series of
options (represented as bits) into a complete command (represented as a byte). The
resulting binary value must be converted to a hexadecimal representation.
Hexadecimal digits have values ranging from 0 to F, which are represented as 0-9, A (for
10), B (for 11), etc. To convert a binary value (for example, 0010 0011) to a hexadecimal
representation, the upper and lower four bits are treated separately, resulting in a two-digit
hexadecimal number (in this case, 4C).
Use the following table to convert values from binary to hexadecimal.
Table 29 - Binary to Hexadecimal Conversion Table
Decimal Binary Hex
0 0000
0
1 0001
1
2 0010
2
3 0011
3
4 0100
4
5 0101
5
6 0110
6
7 0111
7
8 1000
8
9 1001
9
10 1010
A
11 1011
B
12 1100
C
13 1101
D
14 1110
E
15 1111
F
10.1 Connect Mode Options
Note:
Character response codes are C=connect, D=disconnect, N=unreachable
chapter, the binary bit fields for options in connect mode,
disconnect mode, flush mode, interface mode, and pack control mode are described in
detail. The following pages are a summary of the possible hexadecimal entries for each of
these options.
Table 30 - Connect Mode Options
Accept
Incoming
Connections
Serial
Response
Upon
Connection
Active Connection
Startup
Hostlist
Hex
Never
None (quiet)
No active startup
N/A
Never
None (quiet)
Any character
1
Never
None (quiet)
Active DTR
2
Never
None (quiet)
CR (0x0D)
3
Never
None (quiet)
Manual connection
4
Never
None (quiet)
Autostart
5
Never
None (quiet)
UDP
C
XPort™ User Manual and Development Kit
10-1