Beginprog / Endprog; Scan() / Nextscan; Programming Instructions - Campbell CR300 Series Operator's Manual

Hide thumbs Also See for CR300 Series:
Table of Contents

Advertisement

Appendix B. Introduction to CRBasic Programming
'Reset and Increment Counter
If
Oscillator = 2
Oscillator = Oscillator + 1
'Process and Control
If
Oscillator = 1
If
Flag(1) = True
DisableVar = True
EndIf
Else
DisableVar = False
EndIf
'Call Data Tables and Store Data
CallTable(OscAvgData)
NextScan
EndProg
B.6 BeginProg / EndProg
B.7 Scan() / NextScan
B.8 Programming Instructions
B-12
Then
Oscillator = 0
Then
BeginProg defines the beginning of statements defining CR300 actions. Any
instructions between BeginProg and Scan() are only executed when the
datalogger first runs the program. EndProg marks the end of the program.
Simple CR300 programs are often built entirely within a single Scan() /
NextScan structure, with only variable and data table declarations outside the
scan. Scan() / NextScan creates an infinite loop. Each periodic pass through
the loop is synchronized to the CR300 clock. Scan() determines how
frequently instructions in the program are executed, as shown in the following
CRBasic code snip:
'Scan(Interval, Units, BufferSize, Count)
Scan(1,Sec,1,0)
'CRBasic instructions go here
ExitScan
Scan() has four parameters:
Interval — the interval between scans. Interval is 1 ms ≤ Interval ≤ 1
day.
Units — the time unit for the interval.
BufferSize — not used in the CR300, but left in for compatibility
reasons.
Count — number of scans to make before proceeding to the
instruction following NextScan. A count of 0 means to continue
looping forever (or until ExitScan).
Common instructions (called "commands" in BASIC) and operators used in
most BASIC languages, including program control statements and logic and
mathematical operators, can also be used in CRBasic.

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cr300-rf407Cr300-rf412Cr300-rf422

Table of Contents