Xylem STORM 3 Basic Programming manual Instrukcja Użytkownika Strona 45

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 48
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 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
Przeglądanie stron 44
1 2 ... 40 41 42 43 44 45 46 47 48

Komentarze do niniejszej Instrukcji

Brak uwag