Argument Types; Expressions; B-8. Measurement Instruction Syntax - Campbell CR300 Series Operator's Manual

Hide thumbs Also See for CR300 Series:
Table of Contents

Advertisement

CRBasic Example B-8. Measurement Instruction Syntax
'This program example demonstrates the use of a single measurement instruction. In this
'case, the program measures the temperature of the CR300 processing board.
Public
RefTemp
'Declare variable to receive instruction
BeginProg
Scan(1,Sec,3,0)
PanelTemp(RefTemp,60)
NextScan
EndProg
B.8.1 Argument Types
B.9 Expressions
Appendix B. Introduction to CRBasic Programming
In addition to BASIC syntax, instructions are included in CRBasic to facilitate
measurement and control and to store data. CRBasic Editor Help contains a
comprehensive list of these instructions. Measurement instructions set up
CR300 hardware to make measurements and store results in variables. Control
instructions set up CR300 hardware to provide outputs depending on triggers.
Data storage instructions process measurements into averages, maxima,
minima, standard deviation, etc.
Each instruction is a keyword followed by a series of informational parameters
needed to complete the procedure. For example, the instruction for measuring
CR300 panel temperature is:
PanelTemp(Dest,f
)
N1
PanelTemp is the instruction name. Two parameters follow: Dest, a
destination variable name in which the temperature value is stored; and f
notch frequency to use. To place the panel temperature measurement in the
variable RefTemp, filtering out 60 Hz noise, the syntax is as shown in CRBasic
Example B-8.
'Instruction to make measurement
Most CRBasic commands or instructions, have subcommands or parameters.
Parameters are populated by the programmer with arguments. Many
instructions have parameters that allow different types of arguments. Common
argument types are listed below. Allowed argument types are specifically
identified in the description of each instruction in CRBasic Editor Help.
Constant
Variable
Array
Expression
Name or list of Names
CRBasic allows for mathematical and logical expressions. Mathematical
operations are written much as they are algebraically. For example, to convert
Celsius temperature to Fahrenheit, the syntax is:
TempF = TempC • 1.8 + 32
, the
N1
B-13

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cr300-rf407Cr300-rf412Cr300-rf422

Table of Contents