Appendix c: serial communications – TE Technology TC-36-25-RS485 User Manual

Page 43

Advertising
background image

 

43

APPENDIX C:  Serial Communications

 
I.  Definitions
 
Note: where needed, 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.  

 
Use lowercase ASCII characters. 
 
(stx) 

 

Start of text character (*) or 2a

16

(etx) 

 

End of text character (carriage return) or 0d

16

(ack) 

 

Acknowledge character (^) or 5e

16

 
AA 

 

Address characters are ASCII characters ranging from 0 through 9 or a through f.  

 
CC 

 

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

 
DDDDDDDD 

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 (32‐bit word size):  

 

 

1

10

 = 00000001

16

 

 

 

‐1

10

=ffffffff

16

 

 
SS 

The 8‐bit (modulo 256) hexadecimal checksum of characters sent to/from the controlling computer.  
This is represented as 2 ASCII characters.  The checksum calculation excludes the characters (stx), SS, 
and (etx).  The TC‐36‐25 RS485 sums (in an 8‐bit register) the hexadecimal values of the ASCII 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 controller calculates the checksum and compares it 
to the checksum sent by the controlling computer.  The TC‐36‐25 RS485 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 hexadecimal number (a, b, c, d, e, and f) be sure to 
reference lower case letters.
   

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

(stx)AACCDDDDDDDDSS(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 eight ASCII characters: 
         (stx)DDDDDDDDSS(ack) 
 
To query a controller, there is no send value so the controlling computer only needs to send the following ASCII characters 
with the “D”s filled with zeros: 
 

(stx)AACC00000000SS(etx) 

 
If the temperature controller receives the query and the checksum is correct, the temperature controller will respond by 
sending back a “return value” and the checksum of those eight ASCII characters: 
         (stx)DDDDDDDDSS(ack) 
 
If the checksum for a command or query is not correct the temperature controller will respond with eight upper case X’s 
and then c0, which is the checksum of these eight X’s: 
         (stx)XXXXXXXXc0(ack)  
 

Advertising