PWS100 Present Weather Sensor - Campbell Scientific
PWS100 Present Weather Sensor - Campbell Scientific
PWS100 Present Weather Sensor - Campbell Scientific
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
Section 7. Operation<br />
relative gains or losses of the two clocks that the logger will over time either<br />
receive an extra transmission from the sensor or not get a transmission from the<br />
sensor in a given period. Apart from accepting this as being inevitable the only<br />
solution to this is to get the sensor to output more frequently than you need the<br />
logger to receive data and have the logging system work with the latest<br />
transmission, but this is not always ideal or possible.<br />
Polling the sensor for data gives full control of the timing of measurements to<br />
the logging system, as with the <strong>PWS100</strong> it can be asked to output a meassage<br />
for a given time up until the instant the poll command is issued. The <strong>PWS100</strong><br />
processes the data in its buffer for that period and generates the message “on<br />
the fly”. Apart from needing both transmit and receive connections to the<br />
logger the only disadvantage of this technique is there may be a slight delay<br />
(typically less than one second) whilst the <strong>PWS100</strong> prepares the message in<br />
response to the poll command.<br />
Two simple example programs for a CR1000 <strong>Campbell</strong> <strong>Scientific</strong> datalogger.<br />
A more powerful, documented program that includes advanced setup, CRC<br />
checks can be downloaded from:<br />
www.campbellsci.co.uk/downloads<br />
The following is an example program for the <strong>Campbell</strong> <strong>Scientific</strong> CR1000<br />
datalogger using automated output settings (see section 7.5.1). Note that the<br />
aliases are set for the output as defined in the program, these should be altered<br />
to suit the individual outputs selected.<br />
'CR1000 Series Datalogger<br />
'<strong>Campbell</strong> <strong>Scientific</strong> Ltd. <strong>PWS100</strong> <strong>Present</strong> <strong>Weather</strong> <strong>Sensor</strong><br />
'Example of data capture in a single message output<br />
'automatically by a sensor connected to COM1 on the logger<br />
'Declare General Variables<br />
Public Temp, PWS_Bytes<br />
'Incoming <strong>PWS100</strong> Data buffer<br />
Public InString As String * 500<br />
'Final <strong>PWS100</strong> Data - define the array large enough to match the<br />
'number of fields in the message<br />
Public <strong>PWS100</strong>data(11)<br />
'Define aliases so the results are easier to identify<br />
'Need to match the fields selected in the message<br />
Alias <strong>PWS100</strong>data(1) = MessageID<br />
Alias <strong>PWS100</strong>data(2) = PWSID<br />
Alias <strong>PWS100</strong>data(3) = Visibility<br />
Alias <strong>PWS100</strong>data(4) = PWS<br />
Alias <strong>PWS100</strong>data(5) = NWS<br />
Alias <strong>PWS100</strong>data(6) = Intensity<br />
Alias <strong>PWS100</strong>data(7) = Accumulation<br />
Alias <strong>PWS100</strong>data(8)= DayCount<br />
Alias <strong>PWS100</strong>data(9) = Hour<br />
Alias <strong>PWS100</strong>data(10) = Minute<br />
Alias <strong>PWS100</strong>data(11) = Second<br />
'Declare Constants<br />
Const STX = &H02<br />
Const ETX = &H03<br />
DataTable (<strong>PWS100</strong>,True,-1)<br />
Sample (11,<strong>PWS100</strong>data(),IEEE4)<br />
EndTable<br />
7-47