![background image](http://html1.mh-extra.com/html/campbell/cr200/cr200_instruction-manual_489088093.webp)
Section 9. Programming
83
If Flag = True Then
DisableVar = True
End If
Else
DisableVar = False
EndIf
'Call Data Tables and Store Data
CallTable (OscAvgData)
NextScan
EndProg
Read More!
For a complete list of output processing instructions, see
Data
Storage Output Processing
(p. 94).
9.7.2
Subroutines
Subroutines allow a section of code to be called by multiple processes in the
main body of a program. Subroutines are defined before the main program body
of a program. Program
CRBASIC EXAMPLE. Use of a Subroutine
p. 83 shows
the use of a subroutine to repeatedly perform a calculation.
CRBASIC EXAMPLE 10.
Use of a Subroutine
'Declare Variables and Units
Public Temp(4), I, Temp_F(4)
'Subroutine to convert temperature in degrees C to degrees F
Sub ConvertCtoF
For I = 1 to 4
Temp_F = Temp(I)*1.8 + 32
Next I
EndSub
'Main Program
BeginProg
Scan (1,Sec)
Therm109 (Temp(),4,1,Ex1,1.0,0)
'convert Temperatures to F using Subroutine:
Call ConvertCtoF
NextScan
EndProg
9.8 Program Execution Timing
CR200(X) programs are built within a Scan () / NextScan structure, with only
variable and data table declarations outside the Scan () / NextScan structure. In
these programs, Scan () / NextScan creates an infinite loop, each periodic pass
through the loop being synchronized to the CR200(X) clock. Scan () parameters
allow modification of the period. As shown in
CRBASIC EXAMPLE. BeginProg
/ Scan / NextScan / EndProg Syntax
(p. 84) , aside from declarations, the
CRBASIC program may be relatively short.
Содержание 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: ......