Xylem STORM 3 Basic Programming manual Manual de usuario Pagina 45

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 48
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de 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
Vista de pagina 44
1 2 ... 40 41 42 43 44 45 46 47 48

Comentarios a estos manuales

Sin comentarios