48 appendix b serial communications – TE Technology TC-48-20 User Manual

Page 48

Advertising
background image

48

Appendix B Serial Communications 

I. Definitions: 
All numeric values are in hexadecimal format.  Use lowercase ASCII characters. 
 
Note: where applicable, the base of a number is indicated by its subscript. So, 20

10

 is the number 20 in decimal 

(base 10) format, and it converts to 14

16

 in hexadecimal (base 16) format. 

 
(stx) 

 

Start of text character (*) 2a

16

 

(etx) 

 

End of text character (carriage return) or 0d

16

 

(ack) 

 

Acknowledge character (^) or 5e

16

 

 
CC 

 

Command characters are ASCII characters from 0 through 9 or a through f. 

DDDD 

This is the ASCII representation of the hexadecimal return or send value. Negative numbers are 
represented by the hex 2’s complement of the number (16‐bit word size): 

 

 

1 decimal = 0001

16

 in hex two’s complement 

 

 

‐1 decimal = ffff

16

 in hex two’s complement 

 
SS 

The 8‐bit (modulo 256) checksum of characters sent to/from the controlling computer.  This is 
represented as 2 ASCII hex characters.  The checksum calculation excludes the characters (stx), 
SS, and (etx).  TC‐48‐20 sums (in an 8‐bit register) the ASCII values of the characters sent to/from 
the controlling computer.  Any overflow is truncated, leaving the 8‐bit (modulo 256) checksum.  
When the controller is receiving data, this number (as represented by two hex characters) is 
compared to the two ASCII character hex checksum sent by the controlling computer.  The TC‐48‐
20 will respond as shown below depending on whether or not the checksums match.  When the 
controlling computer is receiving data the checksum sent by the controller can be used to make 
sure the data has not been received with an error.  Remember, when finding the ASCII value for a 
hex number (a, b, c, d, e, and f) be sure to use lower case letters.  
 

 
To write a command to a controller, the controlling computer must send the following ASCII characters: 
 

(stx)CCDDDDSS(etx) 

 
If the temperature controller receives the command and the checksum is correct, the temperature controller will 
respond by sending back the “send value” and the checksum of those four ASCII data characters, DDDD: 

(stx)DDDDSS(ack) 

 
To query a controller, there is no send value so the controlling computer only needs to send the ASCII command 
characters with the “D”s filled with zeros: 
 

(stx)CC0000SS(etx) 

 
If the checksum for a query is correct the temperature controller will respond by sending back a “return value” and 
then SS, which is the checksum of the four return value (DDDD) characters: 

(stx)DDDDSS(ack) 

 
If the checksum for a command or query is not correct the temperature controller will respond with four upper 
case X’s and then 60, which is the checksum of these four X’s: 

(stx)XXXX60 (ack) 

Advertising
This manual is related to the following products: