Campbell Scientific CR1000KD CR800 and CR850 Measurement and Control Systems - Page 109
CRBasic Editor
View all Campbell Scientific CR1000KD manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 109 highlights
Section 7. Installation sensors and external devices. Quickstart Tutorial (p. 33) works through a measurement example using Short Cut. For many complex applications, Short Cut is still a good place to start. When as much information as possible is entered, Short Cut will create a program template from which to work, already formatted with most of the proper structure, measurement routines, and variables. The program can then be edited further using CRBasic Program Editor. 7.7.1.2 CRBasic Editor CR800 application programs are written in a variation of BASIC (Beginner's Allpurpose Symbolic Instruction Code) computer language, CRBasic (Campbell Recorder BASIC). CRBasic Editor is a text editor that facilitates creation and modification of the ASCII text file that constitutes the CR800 application program. CRBasic Editor is a component of LoggerNet (p. 548), RTDAQ, and PC400 datalogger-support software (p. 76) packages. Fundamental elements of CRBasic include: • Variables - named packets of CR800 memory into which are stored values that normally vary during program execution. Values are typically the result of measurements and processing. Variables are given an alphanumeric name and can be dimensioned into arrays of related data. • Constants - discrete packets of CR800 memory into which are stored specific values that do not vary during program executions. Constants are given alphanumeric names and assigned values at the beginning declarations of a CRBasic program. Note Keywords and predefined constants are reserved for internal CR800 use. If a user-programmed variable happens to be a keyword or predefined constant, a runtime or compile error will occur. To correct the error, simply change the variable name by adding or deleting one or more letters, numbers, or the underscore (_) from the variable name, then recompile and resend the program. CRBasic Editor Help provides a list of keywords and pre-defined constants. • Common instructions - Instructions (called "commands" in BASIC) and operators used in most BASIC languages, including program control statements, and logic and mathematical operators. • Special instructions - Instructions (called "commands" in BASIC) unique to CRBasic, including measurement instructions that access measurement channels, and processing instructions that compress many common calculations used in CR800 dataloggers. These four elements must be properly placed within the program structure. 7.7.1.2.1 Inserting Comments into Program Comments are non-executable text placed within the body of a program to document or clarify program algorithms. As shown in CRBasic example Inserting Comments (p. 110), comments are inserted into a program by preceding the comment with a single quote ('). Comments can be entered either as independent lines or following CR800 code. When the CR800 compiler sees a single quote ('), it ignores the rest of the line. 109