Campbell CR200 Manuel de l'opérateur Page 141

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 210
  • Table des matières
  • DEPANNAGE
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 140
Section 11. Programming Resource Library
Time instructions in the TrigVar parameter of the DataTable declaration. Since
DataInterval is not used, the table size cannot be autoallocated and table size
should be carefully considered before being set to a specific number of records.
CRBASIC EXAMPLE 20. CRBASIC EXAMPLE. Programming for two data intervals in
one data table
'CRBASIC program to write to a single table with two different time
'intervals.
'Declare Public Variables
Public T109_C(2), Counter, deltaT
Public int_fast, int_slow
'Data Tables
'Table output on two intervals depending on condition.
'note the parenthesis around the TriggerVariable AND statements
DataTable (TwoInt,(int_fast AND IfTime(0,5,Sec)) OR (int_slow AND IfTi
me (0,15,sec)),1000)
Sample (2,T109_C())
Maximum (1,counter(1),False,False)
Minimum (1,counter(1),False,False)
Maximum (1,deltaT,False,False)
Minimum (1,deltaT,False,False)
Average (1,deltaT,false)
EndTable
'Main Program
BeginProg
Scan (1,Sec)
counter(1) = counter(1) + 1
'Thermistor measurement
Therm109 (T109_C(),2,1,Ex1,1.0,0)
'calculate the difference in thermistor temperatures
deltaT = T109_C(1)-T109_C(2)
'when the difference in temperatures is >=3 turn LED on
'and trigger the data table's faster interval
If deltaT >= 3 Then
PortSet (1,1)
int_fast = -1
int_slow = 0
Else
PortSet (C1,0)
int_fast = 0
int_slow = -1
EndIf
'Call Output Tables
CallTable TwoInt
NextScan
EndProg
127
Vue de la page 140
1 2 ... 136 137 138 139 140 141 142 143 144 145 146 ... 209 210

Commentaires sur ces manuels

Pas de commentaire