8 serial input / output, 9 peer-to-peer pakbus communications – Campbell Scientific CR200/CR200X-series Dataloggers User Manual
Page 117

Section 10. CRBASIC Programming Instructions
10.8 Serial Input / Output
Sends the values from program variables or other characters out through a
communications port.
Syntax
Print (PrintPort, PrintBaud, PrintParams)
SerialInput
Reads a serial sensor connected to the CR200(X)'s RS232 port.
Syntax
SerialInput (Dest, Max_Values, Termination_Char,
FilterString)
10.9 Peer-to-Peer PakBus Communications
Read More! See
PakBus Overview
(p. 133) for more information. Also see
Campbell Scientific PakBus® Networking Guide available at
www.campbellsci.com
.
Peer-to-peer PakBus® instructions enable the datalogger to communicate with
other PakBus® devices. Instructions specify a COM port and a PakBus®
address. If the route to the device is not yet known, a direct route through the
specified COM port is first tried.
The PakBus® Address is a variable that can be used in CRBASIC like any other
variable.
The ComPort specifies the communications port that will be used to
communicate with the host device. Enter one of the following commands:
•
RF
•
RS232
In general, PakBus® instructions write a result code to a variable indicating
success or failure. Success sets the result code to 0. Otherwise, the result code
increments. If communication succeeds but an error is detected, a negative result
code is set. See CRBASIC Editor Help for an explanation of error codes.
The Timeout parameter in these instructions is in units of 0.01 seconds. If 0 is
used, then the default timeout defined by the time of the best route is used. Use
PakBusGraph "Hop Metrics" to calculate this time.
These communication instructions wait for a response or timeout before the
program moves on to the next instruction.
105