Xylem STORM 3 Basic Programming manual Manual do Utilizador Página 45

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 48
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 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
Vista de página 44
1 2 ... 40 41 42 43 44 45 46 47 48

Comentários a estes Manuais

Sem comentários