Appendix c. binary telecommunications – Campbell Scientific CR7 Measurement and Control System User Manual
Page 165

C-1
APPENDIX C. BINARY TELECOMMUNICATIONS
The response time and size of the input buffer of the datalogger must be accounted for when attempting
to write a program to make use of the binary commands. The datalogger may delay up to 100 ms before
responding to a command or between bytes in a response. The input buffer in the CR10, 21X, and CR7
will now hold 64 bytes of commands; earlier versions of the 21X and CR7 software would only buffer 7
bytes.
C.1 TELECOMMUNICATIONS
COMMAND WITH BINARY
RESPONSES
Command
Description
[no. of loc.]F
BINARY DUMP - CR7 sends, in
Final Storage Format (binary,
the number of Final Storage
locations specified (from
current MPTR locations), then
Signature (no prompt).
DATALOGGER J AND K COMMANDS
3142J The 3142J command is used to toggle
datalogger user flags, request Final
Storage data, and to establish the input
locations returned by the K command.
The format of the command is as
follows:
3142J
where
1) "3142J
2) "a" is a 1 byte value representing the user
flags to be toggled. The most significant bit
(MSB), if set, will toggle datalogger user flag
8. Likewise, the 2nd most significant bit, if
set, will toggle user flag 7, and so on to the
least significant bit which, if set, toggles
user flag 1. Toggle means that if a flag is
set, it will be then reset, or if it is reset, it will
be set.
3) "b" is a 1 byte value whose MSB will
determine whether Final Storage Data is
returned after the K command. If the bit is
set, Final Storage Data, if any, will be
returned after the next K command. The
datalogger initially has this bit reset upon
entering telecommunications, but once set
by a J command, it will remain set until
reset by another J command or
telecommunications is terminated.
The 2nd MSB set means a port toggle byte
will follow and port status is to be returned
with the K command. Like the MSB, this bit
is reset upon entering telecommunications,
but remains set once set until reset by
another J command or telecommunications
is terminated.
The remaining bits are reserved.
4) If the 2nd MSB in "b" was set then "c" is a
port toggle byte, otherwise "c,d,...,n" are
each 1 byte binary values each
representing a datalogger Input Storage
location. The data at those locations will be
returned after the next K command. ASCII
code 1 (0000001 binary) represents input
location 1. ASCII codes 2 (00000010
binary) represents input location 2, and so
on. The order of the location requests is not
important. The list is limited, however, to 62
total location requests.
5) "Null" or ASCII code 0 (00000000 binary )
terminates the J command. Alternately,
11111111 binary aborts the J command. If
aborted, flags will not be toggled and
location requests will not be saved.
User
Datalogger
Enters
Echo
3
3
1
1
4
4
2
2
J
J
CR
CR
LF
<
a
a
b
b
c
c
d
d
n
n
Null
Null