A-14 | Thermox CEM/O2 TM
Sample Program
This section provides a sample Quick Basic program that reads and writes
to the serial port:
DECLARE FUNCTION Checksum$ (M$)
‘Serial test routine
‘ Continuously sends a message and prints the string returned
CLS
‘Open the communications port
OPEN “COM2:9600,N,8,1 “FOR RANDOM AS #1
‘String to be echoed
T$ = “Test message”
‘Address of the series 2000 controller
Address% = 254
‘Build the message
M$ = “>” = HEX$(Address%) = “A” = T$
M$ = M$ + Checksum$(M$)
‘Continue sending message until key pressed
‘(Assumes that Series 2000 controller is connected)
WHILE (INKEY$ = “”)
PRINT #1, M$
LINE INPUT #1, A$
‘Show results
PRINT “Sent…..”; M$
PRINT “Returned…”; A$
PRINT
WEND
CLOSE #1
STOP
FUNCTION Checksum$ (M$)
DIM Sum AS LONG
Sum = 0
‘Skip >
FOR I% = 2 TO LEN(M$)
Sum = Sum + ASC(MID$(M$, i%,1)
NEXT I%
‘Get low byte of checksum
Checksum$ = HEX$(Sum MOD 256)
END FUNCTION
Содержание Thermox CEM O2/TM
Страница 12: ...xii Thermox CEM O2 TM This page intentionally left blank...
Страница 45: ...Installation 3 23 Figure 3 20 Current output connections example...
Страница 47: ...Installation 3 25 Figure 3 21 Series 2000 standard alarm connections...
Страница 49: ...Installation 3 27 Figure 3 22 Series 2000 controller RCU connections...
Страница 51: ...Installation 3 29 Figure 3 23 Series 2000 2 wire RS 485 communications connections...
Страница 53: ...Installation 3 31 Figure 3 24 Series 2000 4 wire RS 485 communications connections...
Страница 56: ...3 34 Thermox CEM O2 TM This page intentionally left blank...
Страница 116: ...5 26 Thermox CEM O2 TM This page intentionally left blank...
Страница 137: ...Service and Parts 7 3 This page intentionally left blank...
Страница 139: ...Service and Parts 7 5 Figure 7 1 Cell replacement...
Страница 143: ...Service and Parts 7 9 Figure 7 3 Furnace replacement...
Страница 162: ...B 4 Thermox CEM O2 TM This page intentionally left blank...
Страница 166: ...C 4 Thermox CEM O2 TM This page inentionally left blank...
Страница 168: ...D 2 Thermox CEM O2 TM This page intentionally left blank...