APPENDIX B. BINARY TELECOMMUNICATIONS
B-2
User
Datalogger
Enters
Echo
K
K
CR
CR
LF
Time Minutes byte 1
Time Minutes byte 2
Time Tenths byte 1
Time Tenths byte 2
Flags byte
Ports byte (if requested)
Data1 byte 1
Data1 byte 2
Data1 byte 3
Data1 byte 4
Data2 byte 1
Data2 byte 2
Data2 byte 3
Data2 byte 4
DataN byte 1
DataN byte 2
DataN byte 3
DataN byte 4
Final Storage Data bytes
01111111 binary byte
00000000 binary byte
Signature byte 1
Signature byte 2
Time Minutes byte 1 is most significant.
Convert from binary to decimal. Divide by 60 to
get hours, the remainder is minutes. For
example, 00000001 01011001 (01 59 HEX) is
345 decimal minutes or 5:45.
Time Tenths byte 1 is most significant. Convert
from binary to decimal. Divide by 10 to get
seconds and tenths of seconds. For example,
00000001 11000110 (01 C6 HEX) is 454
decimal or 45.4 seconds. Thus the datalogger
time for 01 59 01 C6 HEX is 5:45:45.4.
The Flags byte expresses datalogger user flag
status. The most significant bit represents Flag
8, and so on to the least significant bit which
represents Flag 1. If a bit is set, the user flag is
set in the datalogger.
The optional ports byte (currently on return if
requested by a CR510 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.
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.
Summary of Contents for CR510
Page 2: ...This is a blank page ...
Page 4: ...This is a blank page ...
Page 10: ...This is a blank page ...
Page 44: ...SECTION 1 FUNCTIONAL MODES 1 14 This is a blank page ...
Page 56: ...SECTION 3 INSTRUCTION SET BASICS 3 8 ...
Page 104: ...SECTION 8 PROCESSING AND PROGRAM CONTROL EXAMPLES 8 8 This is a blank page ...
Page 128: ...SECTION 10 PROCESSING INSTRUCTIONS 10 8 This is a blank page ...
Page 144: ...SECTION 12 PROGRAM CONTROL INSTRUCTIONS 12 10 This is a blank page ...
Page 172: ...SECTION 14 INSTALLATION AND MAINTENANCE 14 10 This is a blank page ...
Page 176: ...APPENDIX A GLOSSARY A 4 This is a blank page ...
Page 184: ...This is a blank page ...
Page 188: ...APPENDIX D DATALOGGER INITIATED COMMUNICATIONS D 4 This is a blank page ...
Page 196: ...APPENDIX F MODBUS ON THE CR10 X AND CR510 F 4 This is a blank page ...
Page 197: ...APPENDIX G TD OPERATING SYSTEM ADDENDUM FOR CR510 CR10X AND CR23X MANUALS ...
Page 198: ...This is a blank page ...
Page 200: ...This is a blank page ...
Page 206: ...TABLE DATA ADDENDUM AD 6 This is a blank page ...
Page 222: ...TD ADDENDUM SECTION 1 FUNCTIONAL MODES AD 1 8 This is a blank page ...
Page 238: ...TD ADDENDUM SECTION 8 PROCESSING AND PROGRAM CONTROL EXAMPLES AD 8 10 This is a blank page ...
Page 240: ...This is a blank page ...