Campbell Scientific CR10 CR10 Measurement and Control - Page 212

FF FF

Page 212 highlights

APPENDIX C. BINARY TELECOMMUNICATIONS User Enters K CR Datalogger Echo K CR LF Time Minutes byte 1 Time Minutes byte 2 Time Tenths byte 1 Time Tenths byte 2 Flags byte Ports byte (if requested) Datal byte 1 Datal byte 2 Datal byte 3 Datal byte 4 Data2 byte 1 Data2bg.e 2 Data2 byte 3 Data2 byte 4 DataN byte 1 DataN byte 2 DataN byte 3 DataN byte 4 Final Storage Data bytes 0111111 1 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 0101 1001 (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. lf a bit is set, the user flag is set in the datalogger. The optional ports byte (currently on return if requested by a CR10 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, lNC. Floating Point Format. The format is decoded to the following: Sign(Mantis52*2(ExPonent)1 The Data byte 1 contains the Sign and the Exponent. The most significant bit represents the Sign; if reset the Sign is positive. Subtract 40 hex from the 7 least significant bits to obtain the signed exponent. Data bytes 2lo 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 (.5 decimal) to FF FF FF HEX (1 bit less than 1 decimal, 1-2'2\. As an example,4180 00 00 HEX = +(.5.2(+1)) =.5*2 = 1 decimal. Note Exceptions: 00 FF 00 00 FF FF 00 HEX= 0 decimal FF HEX= -99999 lf appropriately requested by a J command, Final Storage data, if any, will immediately follow the input location data. Refer to the datalogger manual for a description of how to decode Final Storage data in CSI's binary data format. Final Storage data will be limited to not more than 1024 bytes per K command. The K command data is terminated with 7F 00 HEX (a unique binary format code) followed by two signature bytes. Refer to the datalogger manual for the meaning and calculation of the signature bytes. The signature in this case is a function of the first time byte through the 7F 00 HEX bytes. Calculate the signature of the bytes received and compare with the signature to determine the validity of the transmission. C.2 FINAL STORAGE FORMAT CR10 data is formatted as either 2 byte LO Resolution or 4 byte Hl Resolution values. The first two bytes of an Output Array contain a code (FC Hex) noting the start of the Output and the Output Array lD, followed by the 2 or 4 byte data values. At the end of the data sent in response to the telecommunications F 2 byte signature is sent (see below). c-2

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184
  • 185
  • 186
  • 187
  • 188
  • 189
  • 190
  • 191
  • 192
  • 193
  • 194
  • 195
  • 196
  • 197
  • 198
  • 199
  • 200
  • 201
  • 202
  • 203
  • 204
  • 205
  • 206
  • 207
  • 208
  • 209
  • 210
  • 211
  • 212
  • 213
  • 214
  • 215
  • 216
  • 217
  • 218
  • 219
  • 220
  • 221
  • 222
  • 223
  • 224
  • 225
  • 226
  • 227
  • 228
  • 229
  • 230
  • 231
  • 232
  • 233
  • 234
  • 235
  • 236
  • 237
  • 238

APPENDIX
C.
BINARY TELECOMMUNICATIONS
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
0101
1001 (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.
lf
a
bit
is
set,
the
user
flag
is
set
in
the datalogger.
The optional ports byte (currently
on
return if
requested by a CR10 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,
lNC.
Floating Point
Format.
The
format
is
decoded
to the following:
Sign(Mantis52*2(ExPonent)1
The
Data byte
1
contains
the
Sign and
the
Exponent. The
most significant bit represents
the
Sign; if reset the Sign is
positive.
Subtract
40
hex from the
7
least significant bits
to
obtain
the signed exponent.
Data bytes
2lo
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
(.5
decimal)
to
FF FF
FF
HEX
(1
bit less
than
1
decimal,
1-2'2\.
As an
example,4180
00
00
HEX
=
+(.5.2(+1))
=.5*2
=
1
decimal.
Note Exceptions:
00
HEX=
FF
HEX=
0
decimal
-99999
lf appropriately requested by
a
J command,
Final Storage data,
if
any,
will
immediately
follow
the
input location
data.
Refer to
the
datalogger manual for
a
description of how to
decode Final Storage data in CSI's binary data
format.
Final Storage data will be limited
to
not
more
than
1024 bytes
per
K
command.
The
K
command data
is
terminated
with
7F 00
HEX (a unique binary format code) followed by
two signature
bytes.
Refer to the datalogger
manual for
the
meaning and calculation
of
the
signature
bytes.
The signature
in
this
case
is
a
function
of
the first
time
byte through
the
7F
00
HEX
bytes.
Calculate
the
signature
of
the
bytes
received and compare with
the
signature
to determine the validity
of
the transmission.
C.2
FINAL STORAGE
FORMAT
CR10 data
is
formatted as either
2
byte LO
Resolution or 4 byte
Hl
Resolution
values.
The
first two bytes of an Output Array contain
a
code
(FC Hex) noting the start
of
the Output
and the Output
Array
lD, followed
by
the 2 or
4
byte data
values.
At the end
of
the data sent
in
response to the
telecommunications
F
2
byte signature is sent (see below).
User
Enters
K
CR
Datalogger
Echo
K
CR
LF
Time
Minutes byte
1
Time
Minutes byte
2
Time
Tenths
byte
1
Time
Tenths
byte
2
Flags byte
Ports byte (if requested)
Datal
byte
1
Datal
byte
2
Datal
byte
3
Datal
byte
4
Data2 byte
1
Data2bg.e
2
Data2 byte
3
Data2 byte
4
DataN
byte
1
DataN byte
2
DataN byte
3
DataN byte
4
Final Storage Data bytes
0111111 1
binary byte
00000000 binary byte
Signature byte
1
Signature byte
2
00 00
00
FF FF
FF
c-2