beautypg.com

Campbell Scientific CR23X Micrologger User Manual

Page 247

background image

APPENDIX B. CONTROL PORT SERIAL I/O INSTRUCTION 15

B-3

Configuration Code

The configuration code is a two digit parameter in the
form of XY, which specifies the input and output
format. For detailed information about the
configurations, see Configuration Codes Description.

X

Description

0

RS-232 ASCII

1

RS-232 ASCII Hex pair

2

RS-232 Binary

3

TTL ASCII

4

TTL ASCII Hex pair

5

TTL Binary

Y

Description

0

300 baud

1

1200 baud

2

2400 baud

3

4800 baud

4

9600 baud*

5

19200 baud*

6

38400 baud*

7

76800 baud*

*CSI 9-Pin RS-232 Port Only

NOTE: Instruction 15 control port
configurations can only allow combinations
of 1200 and 2400 baud when used with 300
baud in the same datalogger program. The
baud rate of 4800 cannot be used with 300
baud. Combinations of 1200, 2400, and
4800 baud are allowed.

ASCII

This option causes the CR23X to receive and
decode an ASCII string of numbers into one or
more data values. Data are assumed to consist
of an optional sign ("+" or "-") followed by digits
and an optional decimal point. Any other
character that is not the termination character
(Parameter 7) is assumed to be a delimiter
between data values; however, the decimal
point itself can be configured as a delimiter by a
6X or 7X configuration code enabling user to
read higher resolution sensor data. Any digits
before a "+" or "-" are discarded. The data is
input assuming 1 start bit, 8 data bits, no parity
and 1 stop bit, with the 8th (parity) bit ignored.
All 8 bits are checked for the terminator
character (Parameter 7).

Example: The input string

"-123.456,+1000,0000,2333,.0001*"

is converted to

-123.456, 1000.0, 0.0, 2333.0 and 0.0001

and placed in input locations starting at the
location specified in Parameter 10. The
termination character is "*" (ASCII equivalent
42).

Scientific notation is not valid. The string
"+1.23E-12" is converted into two numbers:
1.23 and -12.0. The "E" is interpreted as a data
point delimiter.

Hexadecimal Pairs in ASCII Representation

This option decodes ASCII representation of
hexadecimal code into decimal values. The
value from each pair is stored in separate input
locations starting with the location specified in
Parameter 10. The data is input assuming 1
start bit, 8 data bits, no parity and 1 stop bit,
with the 8th (parity) bit ignored. All 8 bits are
checked for the terminator character
(Parameter 7).

Example: The input string

"7F7E0A0B0C1E"

is translated into

127, 126, 10, 11, 12, 30.

The pair "7F" is equal to 7*16+15 = 112 + 15 =
127. Any character with a decimal value below
48 (ASCII character 0) terminates the string.
terminates the string in this example.

Binary to Decimal Equivalent

This option receives and converts each 8 bit
byte to its decimal equivalent (0-255). The data
is input assuming 8 data bits, no parity and 1
stop bit.

Example: The ASCII input string

"7F7E0A0B0C1E"

is translated into

55, 70, 55, 69, 48, 65, 48, 66, 48, 67, 49,
69, 13, 10

and stored in successive input locations. Note
this is the only option that does not discard the
8th (parity) bit.