Campbell Scientific PWS100 Present Weather Sensor User Manual

Page 85

Advertising
background image

Section 7. Operation

'Open Serial Port to the PWS100
SerialOpen (Com1,115200,3,0,10000)


'Commands can be included here to setup the sensor
'if it has not been preconfigured


Scan (60,Sec,0,0)
'Poll for message 0 from the PWS100 using msend

'In this case getting a message for the last 60 s of data
'First flush the buffer
SerialFlush (Com1)

SerialOut (Com1,"msend 0 60 0" & CR,"",0,0)

'Read in the data waiting for up to two seconds
'for the response
SerialIn (InString,Com1,200,LF,2000)

'If we received something parse the data and store
If Len(InString) >0 Then
SplitStr (PWS100data(),InString," ",11,0)

CallTable PWS100
EndIf
NextScan
EndProg

7-49

Advertising