'this is version 36 of a data logger schedule still in development.
'it runs on any DataTaker data logger manufactured by Data Electronics
'of Melbourne, Australia. Schedule developed by M Gunter & Adrian Oakey
'of the Breamlea Operations Group, Alternative Technology Association Inc.

H CLEAR CSCANS CALARMS
/c /D /E /f /k /l /M /n /O /r /T /u /w
P0=10                          'reduce sensitivity for auto-recalibrate
P15=2                          'dont go to sleep
S1=0,108.7                     '0.92 Hz per metre per sec
S2=1.571,7.854,30,1030         '30 OHMS = EAST (90 DEG) = 1030 OHM
3HSC(R,W)                      'reset these chans in case DT has not been
1..10CV(R,W)                   'initialized since the last-run schedule.
BEGIN
RS5S
RC1S
    1+AS(II,=11CV,W) 12CV(W)=12CV+(1-1*11CV)     ' secs in low speed state
    15CV(W)=(16CV>11CV)*1+(16CV<11CV)*1+15CV 16CV(W)=11CV  '?status changed
    2+AS(II,=13CV,W) 14CV(W)=14CV+(1-1*13CV)     ' secs in high speed state
    15CV(W)=(17CV>13CV)*1+(17CV<13CV)*1+15CV 17CV(W)=13CV   '?status changed
RB5S
    3HSC(DF,S1,=10CV,W) 1CV(NL)=10CV/10          'get windspeed every 5 secs
    2CV(NL)=((1CV*(1CV<2CV))+(2CV*(1CV>=2CV)))*(5CV>1)+(1CV*(5CV=1)) 'carry if lowst
    3CV(NL)=((1CV*(1CV>3CV))+(3CV*(1CV<=3CV)))*(5CV>0)+(0*(5CV=0))  'carry if highest
    3R(S2,=30CV,W)                'WIND DIRECTION RESISTANCE BY SPAN, RADIANS
    31CV(W)=31CV+COS(30CV)             'SUM X COMPONENT
    32CV(W)=32CV+SIN(30CV)             'SUM Y COMPONENT
    5CV(W)=5CV+1 'increment counter (need for 30 min. av. w/s calculation)
RA30M                          'logging schedule every 30 minutes
    3HSC(R,S1,=7CV,W) 'span store & reset total ticks in 30 mins (65535 ticks = 39.57 m/sec)
    6CV(FF2)=(7CV/(5CV*10)) 'convert to m/s (using 5CV allows valid 1st logging)
    2CV(FF1)                  'log min w/s in last 30 mins
    3CV(FF1)                  'LOG MAX W/S IN LAST 30 MINS
    'CALCULATE MEAN DIRECTION
    33CV(W)=ATAN(32CV/31CV)*57.29
    'DETERMINE QUADRANT
    33CV(W)=33CV+((31CV>0)AND(32CV<0))*360
    33CV(W)=33CV+((31CV<0)AND(32CV<0))*180
    33CV(W)=33CV+((31CV<0)AND(32CV>0))*180
    33CV(FF0)
    31..33CV(W)=0
    5CV(R,W)                  'reset the RB5S schedule counter
                   'NEW SCHEDULE CALCULATES ENERGY FROM PULSED METER
    1C(=8CV,R,W)  9CV(FF1)=8CV/20  '1.25 Wh/pulse (x40)=50 Wh/pulse =20pulses/kWh
    12CV(W)=12CV/60  12CV(R,FF0)    'minutes in low gear
    14CV(W)=14CV/60  14CV(R,FF0)    'minutes in high gear
    15CV(R,FF0)                     'log no. of on/off events in last half hour
    5F(AV,=18CV,NL)              ' average frequency from inductive sensor
    20CV(FF1)=18CV*.9375            'average shaft speed in half hour
                   'AUTO RESTART AND AUTO STOP
'      ALARM2(1CV<18)AND         ' and 18 m/sec NOW ,and
'      ALARM3(4+AS(II)>0)3DSO    'windgen. not ready -> press remote start.
'      ALARM4(6CV<3)AND          'unproductive windspeed and
'      ALARM5(20CV<>100,99998)4DSO 'shaft speed < 100 RPM -> press remote stop

END
/m /F LOGON G



