Instructions
UM-0085-B09  DT80 Range User Manual  Page 73 
RG 
  Example 1 
In this program, a vector average is calculated, because it is not meaningful to numerically average wind direction 
angles. The inputs are wind speed and direction. 
BEGIN"Wind-01" 
S1=0,50,0,1000"m/s"    'Wind speed calibration 0–50m/s = 0–1000mV 
S2=0,6.2832,0,1000"radians"  'Wind direction 0–2Pi radians = 0–1000mV 
Y3=0,3.6"km/h"      'Units text for wind speed report 
Y4=0,1"Deg"       'Units text for wind direction report 
3..6CV(W)=0 
RA5S         'Take a reading every 5 seconds 
 1V("rawspeed",S1,W) 
 2V("dir",S2,W) 
 'clamp neg speed values to 0 
 CALC("speed",W)=(&rawspeed<0)?0:&rawspeed 
 3CV("sumX",W)=3CV+MAGDIR2X(&speed,&dir) 
 4CV("sumY",W)=4CV+MAGDIR2Y(&speed,&dir) 
 5CV("count",W)=5CV+1 
 'invalidate reported value if any sample is out of range 
 6CV("invalid",W)=(6CV)OR(&rawspeed<-1)OR(&rawspeed>60)OR(&dir<-1)OR(&dir>7) 
RB1M         'Calculate, report and log every minute 
 'Report average wind speed (999.9 if invalid) 
 7CV(W)=XY2MAG(&sumX,&sumY)/&count 
 CALC("Mean Wind Magnitude",Y3,FF1)=&invalid?999.9:7CV 
 'Report average direction (-1 if no wind, 999 if invalid) 
 8CV(W)=(7CV>0)?R2D(XY2DIR(&sumX,&sumY)):-1 
 CALC("Mean Wind Direction",Y4,FF0)=&invalid?999:8CV 
 3..6CV(W)=0 
LOGON 
END 
  Example 2 
This program scans ten channels and calculates a cross-channel average. 
BEGIN"Wind-02" 
 RA10S 
 1CV(W)=0 'Clear 1CV 
 1..10V(+=1CV,W)     'Sum 10 voltages into 1CV 
 1CV=1CV/10       'Divide by 10 for average 
END 










