APPENDIX C. BINARY TELECOMMUNICATIONS
C-3
The optional ports byte (currently on return if
requested by a CR10X J command) expresses
the datalogger port status. The most significant
bit represents Port 8, and so on to the least
significant bit which represents Port 1. If a bit is
set and the port is configured for output in the
datalogger, the port is toggled.
For each input location requested by the J
command, four bytes of data are returned. The
bytes are coded in Campbell Scientific, Inc.
Floating Point Format. The format is decoded
to the following:
Sign(Mantissa*2
(Exponent)
)
Data byte 1 contains the Sign and the
Exponent. The most significant bit represents
the Sign; if zero, the Sign is positive, if one, the
Sign is negative. The signed exponent is
obtained by subtracting 40 HEX (or 64 decimal)
from the 7 remaining least significant bits.
Data bytes 2 to 4 are a binary representation of
the mantissa with byte 2 the most significant and
4 the least. The mantissa ranges in value from
80 00 00 hex (0.5 decimal) to FF FF FF HEX
(1-2
-24
decimal). The one exception is for zero
which is 00 00 00 00 HEX.
The Mantissa is calculated by converting Data
bytes 2 to 4 into binary. Each bit represents
some fractional value which is summed for all
24 bits. The bits are arranged from MSB to
LSB with the most significant as bit
23
and least
significant as bit
0
. The value that each bit
represents = 2
n-24
; where n=bit location. For
example, if there was a 1 at bit
20
, it’s value
would be 2
(20-24)
or 2
-4
.
A simple method for programming this is as
follows:
Set Mantissa = 0.
Set Bit Value = 0.5.
For loop count = 1 to 24 do the following:
If the MSB is one, then add Bit Value to the
Mantissa.
Shift the 24 bit binary value obtained from
Data bytes 2 to 4 one bit to the left.
Multiply Bit Value by 0.5.
End of loop.
Another method that can be used as an
estimate is to convert Data bytes 2 to 4 from a
long integer to floating point and dividing this
value by 16777216.
As an example of a negative value, the
datalogger returns BF 82 0C 49 HEX.
Data byte 1 = BF HEX.
Data byte 2 to 4 = 82 0C 49 HEX (or 8522825
decimal).
Data byte 1 is converted to binary to find the
Sign. BF HEX = 10111111 BINARY.
The most significant bit is 1 so the Sign is
NEGATIVE.
The exponent is found by subtracting 40 HEX
from the remaining least significant bits.
Converting the binary to hexadecimal, 111111
BINARY = 3F HEX (or 63 decimal).
3F - 40 HEX = FF FF FF FF FF HEX. Or in
decimal: 63 - 64 = -1.
Exponent is -1 decimal.
The binary representation of Data bytes 2 to 4
is: 10000010 00001100 01001001.
Summing all the fractional values: 2
-1
+ 2
-7
+
2
-13
+ 2
-14
+ 2
-18
+ 2
-21
+ 2
-24
= 0.50800.
Using the estimate method to find the Mantissa =
82 0C 49 HEX / 1 00 00 00 HEX (or 8522825 /
16777216) which is 0.50800 decimal.
The value is then (-)0.508*2
-1
which equals
-0.254.
Summary of Contents for CR10X
Page 2: ...This is a blank page...
Page 4: ...This is a blank page...
Page 10: ...CR10X TABLE OF CONTENTS vi This is a blank page...
Page 36: ...CR10X OVERVIEW OV 24 This is a blank page...
Page 50: ...SECTION 1 FUNCTIONAL MODES 1 14 This is a blank page...
Page 102: ...SECTION 7 MEASUREMENT PROGRAMMING EXAMPLES 7 18 FIGURE 7 16 2 Well Monitoring Example...
Page 210: ...SECTION 13 CR10X MEASUREMENTS 13 18 FIGURE 13 5 1 Circuits Used with Instructions 4 9...
Page 216: ...SECTION 13 CR10X MEASUREMENTS 13 24 This is a blank page...
Page 228: ...SECTION 14 INSTALLATION AND MAINTENANCE 14 12 This is a blank page...
Page 232: ...APPENDIX A GLOSSARY A 4 This is a blank page...
Page 256: ...APPENDIX C BINARY TELECOMMUNICATIONS C 8 This is a blank page...
Page 258: ...This is a blank page...
Page 260: ...This is a blank page...
Page 264: ...APPENDIX F DYNAGAGE SAP FLOW P67 F 4 This is a blank page...
Page 272: ...APPENDIX G DATALOGGER INITIATED COMMUNICATIONS G 8 This is a blank page...
Page 280: ...APPENDIX I MODBUS ON THE CR10 AND CR10X I 4 This is a blank page...
Page 281: ...APPENDIX J TD OPERATING SYSTEM ADDENDUM FOR CR510 CR10X AND CR23X MANUALS...
Page 282: ...This is a blank page...
Page 284: ...This is a blank page...
Page 290: ...TABLE DATA ADDENDUM AD 6 This is a blank page...
Page 306: ...TD ADDENDUM SECTION 1 FUNCTIONAL MODES AD 1 8 This is a blank page...
Page 322: ...TD ADDENDUM SECTION 8 PROCESSING AND PROGRAM CONTROL EXAMPLES AD 8 10 This is a blank page...
Page 324: ...This is a blank page...
Page 348: ...LIST OF TABLES LT 4 This is a blank page...