Vaisala PTB210 SERIES Manuel d'instructions Page 50

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 137
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 49
4.5.2 Expressions
Expressions are used as operators or numbers that produce a value or a result. The
programming of the automatic weather station requires such expressions in terms
of converting strings into numeric values as well as to save a squared sum over the
scan interval.
String Expressions
CRBASIC allows the addidtion and concatenation of string variables to variables of
all types using + operators. The serial output of the digitlal pressure sensor PTB210
is picked up as string which inevitably leads to problems having calculations with
it.
AirPressString = AirPress(1) + "," + AirPress(2)
SplitStr(AirPressNum(1),AirPressString,",",2,0)
AirPressString is an array of two serial pressure readings which is splited into two
equal numeric values assigned to the variables AirPressNum(1) and AirPressNum(2).
From now on every kind of mathematical instruction can be executed.
Mathematical and Logical Expressions
Mahtematical operations are written out as if they are algebraically. For example
the calculation of the squared value of pressure readings looks like following:
AirPress_SQ_1 = AirPressNum(1) * AirPressNum(1)
AirPress_SQ_2 = AirPressNum(2) * AirPressNum(2)
The squared sum is defined in the data tables with the following expression:
Totalize(1,AirPress_SQ_1,IEEE4,False)
Totalize(1,AirPress_SQ_2,IEEE4,False)
This progression is applied to every reading.
A simple logical expression in the form of a counter for measured data perinterval
was already given in section 4.5 on page 46.
50
Vue de la page 49
1 2 ... 45 46 47 48 49 50 51 52 53 54 55 ... 136 137

Commentaires sur ces manuels

Pas de commentaire