APPENDIX C. BINARY TELECOMMUNICATIONS
C-2
K
The K command returns datalogger time,
user flag status, port status if requested, the
data at the input locations requested in the
J command, and Final Storage Data if
requested by the J command. The format
of the command is K<CR> (K Return). The
datalogger will echo the K and Return and
send a Line Feed. The amount of data that
follows depends on the J command
previously executed; four time bytes, a user
flags byte, four bytes for each input location
requested in the J command, Final Storage
data in Campbell Scientific's binary format if
requested by the J command, and
terminating in 7F 00 HEX and two signature
bytes.
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 expresses the
datalogger port status. The most significant bit
represents Port 8, and so on to the least
significant bit which represents Port1.
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.
Summary of Contents for CR7
Page 2: ...This is a blank page ...
Page 4: ...This is a blank page ...
Page 28: ...CR7 MEASUREMENT AND CONTROL SYSTEM OVERVIEW OV 18 This is a blank page ...
Page 38: ...SECTION 1 FUNCTIONAL MODES 1 10 This is a blank page ...
Page 42: ...SECTION 2 INTERNAL DATA STORAGE 2 4 This is a blank page ...
Page 52: ...SECTION 3 INSTRUCTION SET BASICS 3 10 This is a blank page ...
Page 58: ...SECTION 4 EXTERNAL STORAGE PERIPHERALS 4 6 This is a blank page ...
Page 68: ...SECTION 6 9 PIN SERIAL INPUT OUTPUT 6 6 This is a blank page ...
Page 140: ...SECTION 13 CR7 MEASUREMENTS 13 16 FIGURE 13 5 1 Circuits Used with Instructions 4 9 ...
Page 162: ...APPENDIX A GLOSSARY A 4 This is a blank page ...
Page 164: ...B 2 This is a blank page ...
Page 170: ...APPENDIX C BINARY TELECOMMUNICATIONS C 6 This is a blank page ...
Page 174: ...APPENDIX D CALIBRATION PROCEDURES D 4 FIGURE D 2 2 CR7X CPU Card ...