beautypg.com

Parameter 2 - configuration code, Parameter 3 - cts / delay before send, Parameter 4 – port configuration – Campbell Scientific CR10X Measurement and Control System User Manual

Page 235

background image

APPENDIX B. CONTROL PORT SERIAL I/O INSTRUCTION 15

B-3

PARAMETER 2 - CONFIGURATION CODE

The configuration code is a two digit number
specifying the input format, logic level, baud
rate, and optional decimal delimiter.

ASCII

This option causes the CR10X 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.

RS-232 LOGIC

The second digit of Parameter 2 can be 0, 1, 3,
5 or 7 to receive RS-232 input. Logical 1 is low
voltage and logic 0 is high voltage. Voltage
input to the CR10X control ports must not
exceed 0 to +5 volts.

TTL LOGIC

The second digit of Parameter 2 can be set to 0
1, 2, 4 or 6 to receive TTL input. Logical 1 is
high voltage and logic 0 is low voltage.

PARAMETER 3 - CTS / DELAY BEFORE SEND

If Parameter 3 is zero (0), the CR10X waits for
the Clear To Send to come high before sending
output. If Clear To Send does not come high
within the time specified in Parameter 9, output
does not occur and -99999 is placed in the Input
Memory Location specified in Parameter 10.

If Parameter 3 is non-zero, this parameter
specifies the length of a delay in units of 0.01
seconds between asserting Request To Send
and sending output. A CTS line is not used.

PARAMETER 4 – PORT CONFIGURATION

With single digit codes, Parameter 4 specifies
the control port used by the first repetition. The
first control port is the RTS/DTR line.

A two-digit parameter (AB) indicates the control
ports that will be used by the first repetition (A+1