![Campbell CS240 Скачать руководство пользователя страница 18](http://html1.mh-extra.com/html/campbell/cs240/cs240_product-manual_3915813018.webp)
7.4.1.2 Converting resistance measurement to temperature
The
PRTCalc()
instruction converts the ratio Rs/Ro to temperature, where Rs is the measured
resistance of the RTD, and Ro is the resistance of the RTD at 0 degrees Celsius (1000 Ω).
A typical
PRTCalc()
instruction is:
PRTCalc
(PRTtemp,1,Rs/1000,1,1,0)
If the
BrHalf
instruction (2-wire configuration) was used to measure resistance, the following
expression also must precede the
PRTCalc
instruction:
Rs=CS240X*(1000+R
c
)/(1–CS240X)–R
c
Where CS240X value returned by the
BrHalf
instruction and R
c
is the cable resistance provided
on the cable label.
7.4.2 CS240DM programming
NOTE:
Programming basics for the CR6 and CR1000X data loggers are provided in this section.
Contact Campbell Scientific if using a data logger that requires an MD485 interface.
A CR6 or CR1000X data logger programmed as a Modbus Master can retrieve the values stored in
the CS240DM Input Registers (
(p. 18)). To do this, the CRBasic program
requires a
SerialOpen()
instruction followed by the
ModbusMaster()
instruction.
The
SerialOpen
instruction has the following syntax:
SerialOpen
(ComPort, Baud, Format, TXDelay, BufferSize, Mode )
The
Format
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 CS240DM Modbus address. Each Modbus address must be
unique on a Modbus network. 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. To collect all of the
CS240 and CS240DM PT-1000 Class A, Back-of-Module Temperature Sensors
15