45
B) Send the set temperature of 10.00 to the controller.
1.
The controller address, AA, is by definition 00.
2.
The control command, CC, for “FIXED DESIRED CONTROL SETTING” is 1c.
3.
Multiply the desired set-point temperature by 100
10
(10.00 x 100 = 1000).
4.
Convert 1000
10
to hexadecimal (3e8
16
) and add on leading zeros to make the eight-character send
value DDDDDDDD (000003e8).
5.
Compute the checksum (SS) by adding the ASCII values of the following characters: 0, 0, 1, c, 0, 0, 0,
0, 0, 3, e, and 8:
ASCII Character:
Hexadecimal Value:
0
30
0
30
1
31
c
63
0
30
0
30
0
30
0
30
0
30
3
33
e
65
8
38
Sum
02b4
16
The 8-bit checksum is the 8 least significant binary bits of the sum, represented as b4 in
hexadecimal.
6.
Combining all of these characters in one string we send: (stx)001c000003e8b4(etx).
7.
If the temperature controller receives the command and the checksum is correct, it will send back:
(stx)000003e8c0(ack). If the checksum is not correct the temperature controller will send back:
(stx)XXXXXXXXc0(ack).
C) Send the set temperature of -1.50 °C.
1.
The controller address, AA, is by definition 00.
2.
The control command, CC, for “FIXED DESIRED CONTROL SETTING” is 1c.
3.
Multiply the desired set-point temperature by 100
10
(-1.50 x 100 = -150).
4.
Convert -150
10
to hexadecimal by taking the two’s complement of the number. (This can be easily
done by using the formula 2
n
–
N
, where
n
is the word-bit size and
N
is the absolute value of the
number being converted.) Hence, you have 2
32
- 150 = 4294967146
10
. This value then converts to
ffffff6a
16
.
5.
Compute the checksum (SS) by adding the hexadecimal ASCII values of the following characters: 0,
0, 1, c, f, f, f, f, f, f, 6, and a:
ASCII Character:
Hexadecimal Value:
0
30
0
30
1
31
c
63
f
66
f
66
f
66
f
66
f
66
f
66
6
36
a
61
Sum
3ef
16