Campbell Scientific CR6 CR6 Measurement and Control System - Page 161
Expressions in Arguments, 8.3.10 Expression Types
View all Campbell Scientific CR6 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 161 highlights
Section 7. Installation Table 27. Rules for Names Name Category1 Maximum Length (number of characters) Allowed characters Variable or array 39 Constant Units Alias Station name Data-table name Field name 38 38 Letters A to Z, a to z, _ (underscore), and numbers 0 to 9. Names must start with a letter 39 or underscore. CRBasic is not case sensitive. Units are excepted from the above rules. Since 64 units are strings that ride along with the data, 20 they are not subjected to the stringent syntax checking that is applied to variables, constants, 39 subroutines, tables, and other names. Field-name description 64 1Variables, constants, units, aliases, station names, field names, data table names, and file names can share identical names; that is, once a name is used, it is reserved only in that category. See the section Predefined Constants (p. 143) for another naming limitation. 7.8.3.9 Expressions in Arguments Read More See Expressions (p. 161) for more information on expressions. Many CRBasic instruction parameters allow the entry of arguments as expressions. If an expression is a comparison, it will return -1 if if true and 0 if false. See Logical Expressions (p. 164) ). The following code snip shows the use of an expressions as an argument in the TrigVar parameter of the DataTable() instruction: 'DataTable(Name, TrigVar, Size) DataTable(Temp, TC > 100, 5000) When the trigger is TC > 100, a thermocouple temperature greater than 100 sets the trigger to True and data are stored. 7.8.3.10 Expression Types An expression is a series of words, operators, or numbers that produce a value or result. Expressions are evaluated from left to right, with deference to precedence rules. The result of each stage of the evaluation is of type Long (integer, 32 bits) if the variables are of type Long (constants are integers) and the functions give integer results, such as occurs with INTDV(). If part of the equation has a floating point variable or constant (24 bits), or a function that results in a floating point, the rest of the expression is evaluated using floating-point, 24-bit math, even if the final function is to convert the result to an integer, so precision can be lost; for example, INT((rtYear-1993)*.25). This is a critical feature to consider when, 1) trying to use integer math to retain numerical resolution beyond the limit of floating point variables, or 2) if the result is to be tested for equivalence against another value. See section Floating-Point Arithmetic (p. 162) for limits. Two types of expressions, mathematical and programming, are used in CRBasic. A useful property of expressions in CRBasic is that they are equivalent to and often interchangeable with their results. 161