
Bytes 3-5 contain the current dose rate reading in floating point notation, where bytes 3 and 4 contain
the 16 bit positive mantissa and byte 5 is the signed (-128...+127) 2-based exponent. The unit is µSv/h
(pulses per second for pulse rate indicating probes like 6150AD-k, AD-17, AD-19).
Byte 6 is the XOR (exclusive OR) of Bytes 2-5 and is intended to be used as a block check character to
detect transmission errors.
The following QBASIC program gives an example how to decode the string:
' Variable Types
DEFINT A-W
DEFSNG X-Z
' Constant Expressions
CONST STX = 2
CONST DEVERR = 57
' ---------------------------------------------------------------------
' Main Program
' ---------------------------------------------------------------------
' Open COM: 4800 Bd, no parity, 8 data bits, 1 stop, no handshake
OPEN "com1:4800,n,8,1,rs,cs,ds,cd" FOR INPUT AS #1
ON ERROR GOTO RecvErr
' Main Loop: read and decode string (6 characters including STX),
' display result, exit on any key.
MainLoop:
DO
WHILE ASC(INPUT$(1, #1)) <> STX: WEND 'wait for STX
sonde = ASC(INPUT$(1, #1)) 'type of detector/6150AD
bc = sonde
mantlo = ASC(INPUT$(1, #1)) 'low order mantissa
bc = bc XOR mantlo
manthi = ASC(INPUT$(1, #1)) 'high order mantissa
bc = bc XOR manthi
expon = ASC(INPUT$(1, #1)) 'exponent
bc = bc XOR expon
IF expon > 127 THEN expon = expon - 256
bc = bc XOR ASC(INPUT$(1, #1)) 'block check
IF bc <> 0 THEN ERROR DEVERR 'block check error
mant = manthi * 256 + mantlo '16 bit mantissa
xdl = mant * 2 ^ (expon - 15) 'dose rate as floating point number
GOSUB GetProbe 'set ger$, det$ and unit$
PRINT TIME$; " Device: 6150"; ger$; " Detector: "; det$;
PRINT USING " Reading=########.### "; xdl;
PRINT unit$
LOOP WHILE LEN(INKEY$) = 0 'exit on any key
PRINT "End."
END
' ---------------------------------------------------------------------
' set ger$ / det$ / unit$ according to 'sonde'
' ---------------------------------------------------------------------
GetProbe:
flag$ = ""
IF sonde >= 128 THEN flag$ = "/E": sonde = sonde - 128
ger$ = "AD2/4/6" + flag$
IF sonde >= 64 THEN ger$ = "AD1/3/5" + flag$: sonde = sonde - 64
det$ = "unknown"
unit$ = "µSv/h"
SELECT CASE sonde
CASE 0
det$ = "Probe AD-0"
unit$ = "cps"
CASE 7
det$ = "Probe AD-b"
CASE 15
det$ = "Probe AD-15"
CASE 17
06/2003
Technical Manual 6150AD Probe Connector
Page 5 of 14
Daimlerstrasse 27
Telefon +49(0)6203-9503-00 http://www.automess.de
USt.-ID-Nr. / VAT ID No.
D-68526 Ladenburg Telefax +49(0)6203-9503-29 eMail: [email protected] DE 144 458 420