04.01.2015 Views

CR1000 Manual - Campbell Scientific

CR1000 Manual - Campbell Scientific

CR1000 Manual - Campbell Scientific

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Section 7. Installation<br />

7.7.1 Writing and Editing Programs<br />

7.7.1.1 Short Cut Editor and Program Generator<br />

Short Cut is easy-to-use, menu-driven software that presents the user with lists of<br />

predefined measurement, processing, and control algorithms from which to<br />

choose. The user makes choices, and Short Cut writes the CRBasic code required<br />

to perform the tasks. Short Cut creates a wiring diagram to simplify connection of<br />

sensors and external devices. Quickstart Tutorial (p. 33) works through a<br />

measurement example using Short Cut.<br />

For many complex applications, Short Cut is still a good place to start. When as<br />

much information as possible is entered, Short Cut will create a program template<br />

from which to work, already formatted with most of the proper structure,<br />

measurement routines, and variables. The program can then be edited further<br />

using CRBasic Program Editor.<br />

7.7.1.2 CRBasic Editor<br />

<strong>CR1000</strong> application programs are written in a variation of BASIC (Beginner's<br />

All-purpose Symbolic Instruction Code) computer language, CRBasic (<strong>Campbell</strong><br />

Recorder BASIC). CRBasic Editor is a text editor that facilitates creation and<br />

modification of the ASCII text file that constitutes the <strong>CR1000</strong> application<br />

program. CRBasic Editor is a component of LoggerNet (p. 570), RTDAQ, and<br />

PC400 datalogger-support software (p. 77) packages.<br />

Fundamental elements of CRBasic include:<br />

• Variables - named packets of <strong>CR1000</strong> memory into which are stored values<br />

that normally vary during program execution. Values are typically the result<br />

of measurements and processing. Variables are given an alphanumeric name<br />

and can be dimensioned into arrays of related data.<br />

• Constants - discrete packets of <strong>CR1000</strong> memory into which are stored<br />

specific values that do not vary during program executions. Constants are<br />

given alphanumeric names and assigned values at the beginning declarations<br />

of a CRBasic program.<br />

Note Keywords and predefined constants are reserved for internal <strong>CR1000</strong> use. If<br />

a user-programmed variable happens to be a keyword or predefined constant, a<br />

runtime or compile error will occur. To correct the error, simply change the<br />

variable name by adding or deleting one or more letters, numbers, or the<br />

underscore (_) from the variable name, then recompile and resend the program.<br />

CRBasic Editor Help provides a list of keywords and pre-defined constants.<br />

• Common instructions - Instructions (called "commands" in BASIC) and<br />

operators used in most BASIC languages, including program control<br />

statements, and logic and mathematical operators.<br />

• Special instructions - Instructions (called "commands" in BASIC) unique to<br />

CRBasic, including measurement instructions that access measurement<br />

channels, and processing instructions that compress many common<br />

calculations used in <strong>CR1000</strong> dataloggers.<br />

These four elements must be properly placed within the program structure.<br />

109

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!