
the files that Short Cut creates are a great source for programming code to start a new program
or add to an existing custom program.
NOTE:
Short Cut cannot edit programs after they are imported and edited in CRBasic Editor.
AShort Cut tutorial is available in QuickStart (p. 1). If you wish to import Short Cut code into
CRBasic Editor to create or add to a customized program, follow the procedure in Importing
Short Cut code into CRBasic Editor (p. 17). Programming basics for CRBasic data loggers are
provided in the following section. A downloadable example program is available at
www.campbellsci.com/downloads/cs250dm-program-example.
7.5.1 RS-485 programming
The RS-485 output can be directly read by a CR6-series, CR1000X-series, or Modbus RTU RS-485
network. Other Campbell Scientific data loggers can use an MD485 multidrop interface to read
the RS-485 output. Refer to the MD485 manual for information about using the MD485.
A CR6 or CR1000X data logger programmed as a Modbus Master can retrieve the values stored in
the Input Registers (Modbus register map (p. 12)). To do this, the CRBasic program requires
SerialOpen() followed by ModbusMaster(). The SerialOpen instruction has the
following syntax:
SerialOpen (ComPort, Baud, Format, TXDelay, BufferSize, Mode)
The Format parameter is typically set to logic 1 low; even parity, one stop bit, 8 data bits. The
Mode parameter should configure the ComPort as RS-485 half-duplex, transparent.
The ModbusMaster() instruction has the following syntax:
ModbusMaster (Result, ComPort, Baud, Addr, Function, Variable, Start, Length,
Tries, TimeOut, [ModbusOption])
The Addr parameter must match the sensor Modbus address. The Modbus address must be
unique and may need to be changed if another sensor on the terminal has the same address. The
default value for the Modbus address is the last two digits of the sensor serial number, with
exceptions for serial numbers ending in 00 and 01. These exceptions default to Modbus addresses
of 110 and 111, respectively. The default Modbus address and serial settings are printed on the
cable. To collect all of the CS250DM values, the Start parameter needs to be 1 and the
Length parameter needs to be 5. ModbusOption is an optional parameter described in the
CRBasic Editor Help.
CS250DM PT-1000 Class A, Precision Air Temperature Sensor 11