![background image](http://html1.mh-extra.com/html/campbell/cr200/cr200_instruction-manual_489088137.webp)
Section 11. Programming Resource Library
127
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 IfTime (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
Содержание CR200
Страница 32: ...Section 2 Quickstart Tutorial 22 ...
Страница 45: ...Section 3 Overview 35 3 3 Specifications ...
Страница 46: ...Section 3 Overview 36 ...
Страница 58: ...Section 4 Sensor Support 48 ...
Страница 62: ...Section 5 Measurement and Control Peripherals 52 ...
Страница 78: ...Section 8 CR200 X Configuration 68 ...
Страница 102: ...Section 9 Programming 92 ...
Страница 138: ...Section 11 Programming Resource Library 128 ...
Страница 156: ...Section 16 Support Software 146 ...
Страница 160: ...Section 17 Care and Maintenance 150 ...
Страница 166: ...Section 18 Troubleshooting 156 18 3 3 Diagnosis and Fix Procedures 18 3 3 1 Battery Voltage Test ...
Страница 167: ...Section 18 Troubleshooting 157 18 3 3 2 Charging Circuit Test Solar Panel ...
Страница 168: ...Section 18 Troubleshooting 158 18 3 3 3 Charging Circuit Test Transformer ...
Страница 169: ...Section 18 Troubleshooting 159 18 3 3 4 Adjusting Charging Circuit Voltage ...
Страница 170: ...Section 18 Troubleshooting 160 ...
Страница 184: ...Appendix A Glossary 14 ...
Страница 190: ...Appendix B Status Table and Settings 20 ...
Страница 192: ...Appendix C Serial Port Pin Outs 22 ...
Страница 211: ......