Updating an older program for measuring a, D appendix b – Campbell Scientific WINDSONIC 2-D Sonic Wind Sensors User Manual

Page 41

Advertising
background image

Appendix B. Updating an Older
Program for Measuring a WindSonic1
With the New Settings

In February 2013, the settings of the WindSonic1 sensor were changed to
improve operation in cold temperatures. The communication baud rate has
been changed from 38,400 to 9600 baud, and the data output structure has been
changed to the manufacturer’s default. Section 6.4, Campbell Scientific
Factory Default Settings for the WindSonic1
, lists the newer default settings.

Sensors with the new settings can be identified by a small white painted dot
next to the connector on the underside of the sensor. New sensor cables
include both a yellow and white heat shrink label; older sensor cables had two
white heat shrink labels. Because cables are interchangeable between new and
old sensors, the best check is to look for the painted dot.

Sensors with newer settings will NOT work with older
programs written for sensors set to 38,400 baud or Short
Cut version 3.0 or older.

CAUTION

Older WindSonic1 programs can be changed by using CRBasic Editor or by
cutting and pasting relevant sections from the updated manual. For additional
support, contact Campbell Scientific at (435) 227-9000 or email
[email protected].

Programming examples shown below come from the old and new WindSonic
manuals. Programs are not complete, but show the relevant sections to be
changed.

Old CR1000 Program (Section 6.1 of 7/10 WindSonic manual)

(Public variables change. Data table structure stays the same.)

Public windsonic(4)
Alias windsonic(1) = wind_direction

Alias windsonic(2) = wind_speed
Alias windsonic(3) = diag
Alias windsonic(4) = nmbr_bytes_rtrnd

Units wind_direction = degrees
Units wind_speed = m/s

Units diag = unitless
Dim in_bytes_str As String * 21
Dim checksum_flg As Boolean

Dim disable_flg As Boolean
Dim n
Units n = arb

BeginProg
n = 1
SerialOpen (Com1,38400,3,0,49)

Scan (1,Sec,3,0)
SerialInRecord (Com1,in_bytes_str,&h02,0,&h0D0A,nmbr_bytes_rtrnd,00)
wind_direction = Mid (in_bytes_str,3,3)

wind_speed = Mid (in_bytes_str,7,6)
diag = Mid (in_bytes_str,16,2)

checksum_flg = ( (HexToDec (Mid (in_bytes_str,20,2))) EQV (CheckSum(in_bytes_str,9,18)) )
disable_flg = (NOT (checksum_flg) OR (nmbr_bytes_rtrnd=0) OR (diag<>0))

B-1

Advertising