COMMERCIAL IN CONFIDENCE
Page 16
After a short delay (approx. 10ms), the CAL Controller will respond with a 7 byte reply. Assuming the
Setpoint to be 200 degrees this would be:
byte 0
:
Slave address
xx
byte 1
:
Function code
03 hex
byte 2
:
Number of data bytes to follow
02 hex
byte 3
:
High byte of Setpoint value
07 hex
byte 4
:
Low byte of Setpoint value
D0 hex
byte 5
:
Low byte of CRC value
?? hex
byte 6
:
High byte of CRC value
?? hex
These characters should be stored in a reply array, and the CRC computed (as above) over the first 5
characters and compared with bytes 5 and 6, the reply should be accepted only if they match. If there
are any errors in the transmitted message, the reply will be missing altogether or the reply will be an
error response. Either way, only accept the reply if the Function code is 03 and the CRC is correct.
The CALController stores the Setpoint internally in 10th degree units, so the value can be computed
as:
setpoint = ((reply[3] << 8) + reply[4]) / 10 ;
or, in a language other than C:
setpoint = ((reply[3] * 256) + reply[4]) / 10 ;
Reading the temperature
Exactly the same method is used as above, except replace byte 2 and 3 of the message with the
register address of the Temperature thus:
byte 2
:
High byte of Temperature address
00 hex
byte 3
:
Low byte of Temperature address
1C hex
The temperature will be returned in bytes 3 and 4 of the reply, exactly as the example for Setpoint, and
this must also be divided by 10 to bring it to degrees. Note that the temperature is always returned in
Centigrade, so any Fahrenheit conversion must be made by the PC.
A typical message would be:
[01][03][00][1C][00][01][45][CC]
A typical reply would be:
[01][03][02][00][C4][B9][D7]
which shows the temperature to be 00C4 hex, 196 decimal, which is 19.6 degrees centigrade.