Vaisala and LabVIEW

Today we solved a problem we've had with the data from our Vaisala WX510 weather station at the Santa Margerita Ecological Reserve. We'd periodically get zeros, spikes or just erroneous data in the RDV viewer and didn't understand why.

Background: The Vaisala is connected to the main serial port on the cRIO, and is programmed to send updates automatically at approximately one-second intervals. 9600N81, no flow control.

To determine what the problem was, we used the classic printf debugging, where a small routine checked for nonsense data and sent the input to a syslog server at UCSD. (More below)

The primary issue was that the Vaisala was overrunning the serial buffer on the cRIO. (Producer-consumer bug). To solve this we
a) Rewrote the parsing code to use regular expressions and added checking for the errors seen to date (missing equals sign, null value)
b) Rolled the parser into a subroutine that will now try up to 20 times to get a valid parse
c) Check for and ignore zero-byte reads (timeouts)
d) Increased the sampling rate to keep up

See http://dataturbine.org/content/syslog%2C-solaris%2C-debian-and-labview for more info on the syslog stuff that we used to capture and display bad parse data.