Programming, 1 cr1000 program – Campbell Scientific IRS21 Road Weather User Manual
Page 22

IRS21 Lufft Intelligent Road Surface Sensor
The data returned consists of the polling command and ASCII data. Spaces
separate the data points.
In typical operation the sensor is run in table two in mixed array loggers, and
slow sequence in PakBus loggers. The interval for the sensor is two minutes.
6. Programming
The sensor is first powered with the DTR line set high. Then the RTS is set
low to send data to the sensor. In this case the polling command will be sent to
the sensor. As soon as the polling command is sent, RTS is set high to get data
back from the sensor. In as short a time as is possible by the programming.
RTS is set high to receive the data. Then the receive filter is sent to the SDM-
SIO4, and data is retrieved by the logger.
In both programs below the SDM-SIO4 is set up with code at the start of the
program. This ensures that if there is a reset or power is lost, the startup will
configure the SDM-SIO4 without having to connect to the SDM-SIO4 to
configure the device.
The calculations after reading the SDM-SIO4 are used to convert raw data
measurements from the sensor to measurements such as degrees, and film
thickness.
6.1 CR1000 Program
Although this example program is for the CR1000, other CRBasic dataloggers
are programmed similarly.
'CR1000 Series Datalogger
'To create a different opening program template, type in new
'instructions and select Template | Save as Default Template
'date:
'program author:
'Declare Public Variables
'Example:
Public sio4result,counter,a
Public sensordata(8)
dim reqdata(17)
dim datafilter(18)
dim portset(22)
alias sensordata(1)=temperature1
alias sensordata(2)=temperature2
alias sensordata(3)=SurTmp0
alias sensordata(4)=SurSal0
alias sensordata(5)=SurFrePn0
alias sensordata(6)=SurWatDp0
alias sensordata(7)=SurSta0
alias sensordata(8)=PavSenEr0
18