Specifications
Section 9. CR1000 Programming
9-21
9.12.3 Names in Parameters
TABLE 9.12-1 lists the maximum length and allowed characters for the names
for Variables, Arrays, Constants, etc. The CRBASIC Editor pre-compiler will
identify names that are too long or improperly formatted.
TABLE 9.12-1. Rules for Names
Name for
Maximum Length
(number of characters)
Allowed characters
Variable or Array 39 Letters A-Z, upper or lower.
Constant 38 case, underscore “_”, and
Alias 39 numbers 0-9. The name must
Data Table Name 20 start with a letter. CRBASIC is
Field name 39 not case sensitive
Field Name
Description
64
9.12.4 Expressions in Parameters
Read more! See Section 9.13 for more information on expressions.
Many parameters allow the entry of expressions. If an expression is a
comparison, it will return -1 if the comparison is true and 0 if it is false
(Section 9.13.4 Logical Expressions). EXAMPLE 9.12-2 shows an example of
th
e use of expressions in parameters in the DataTable instruction, where the
trigger condition is entered as an expression. Suppose the variable TC is a
thermocouple temperature:
EXAMPLE 9.12-2. CRBASIC Code: Use of Expressions in Parameters
‘DataTable(Name, TrigVar, Size)
DataTable(Temp, TC > 100, 5000)
Entering the trigger as the expression “TC > 100” will cause the trigger to be
true and data to be stored when the variable TC is greater than 100.
9.12.5 Arrays of Multipliers and Offsets
A single measurement instruction can measure a series of sensors and apply
individual calibration factors to each sensor as shown in EXAMPLE 9.12-3.
St
oring calibration factors in variable arrays, and placing the array variables in
the multiplier and offset parameters of the measurement instruction, makes this
possible. The measurement instruction uses repetitions to implement this
feature by stepping through the multiplier and offset arrays as it steps through
the measurement input channels. If the multiplier and offset are not arrays, the
same multiplier and offset are used for each repetition.