Xylem STORM 3 Basic Programming manual Manuale Utente Pagina 45

  • Scaricare
  • Aggiungi ai miei manuali
  • Stampa
  • Pagina
    / 48
  • Indice
  • SEGNALIBRI
  • Valutato. / 5. Basato su recensioni clienti
Vedere la pagina 44
43
Example Programs
REM Determines true wind direction as a bouy rotates,
REM based off recorded compass and wind direction
GETVALUE SENSOR “Compass”, WindDirVal
GETVALUE SENSOR “WD”, CompassVal
TrueWindDirVal = WindDirVal + CompassVal
IF (TrueWindDirVal >= 360) THEN
TrueWindDirVal = TrueWindDirVal - 360
END IF
CompassCorrection.bas
REM Calculates the running average for a specific sensor
SensorName$ = “SystemTemperature”
Measurements = 4
CombinedValue = 0
FOR n = 1 TO Measurements
GETVALUE SENSOR SensorName$ n, SensorValue
CombinedValue = CombinedValue + SensorValue
NEXT n
AverageValue = CombinedValue / Measurements
SensorAvg.bas
REM Finds the maximum measurement of the given sensors last n values
SensorName$ = “TempC”
Measurements = 4
MaximumValue = -99999
FOR n = 1 TO Measurements
GETVALUE SensorName$ n, SensorValue
IF (SensorValue > MaximumValue) THEN
MaximumValue = SensorValue
END IF
NEXT n
SensorMax.bas
Vedere la pagina 44
1 2 ... 40 41 42 43 44 45 46 47 48

Commenti su questo manuale

Nessun commento