Campbell Scientific PWS100 PWS100 Present Weather Sensor - Page 83

The PWS100

Page 83 highlights

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

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134

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