Section 7. Installation
303
into an array of values (characters, floats, or longs), such as
Move()
,
MoveBytes()
,
GetVariables()
,
SerialInRecord()
,
SerialInBlock()
. In all cases,
when writing to an array of values, it is important to understand what you are
reading, if you are reading it asynchronously, in other words reading it from some
other task that is polling for the data at the same time as it is being written,
whether that other task is some other machine reading the data, like
LoggerNet
, or
a different sequence, or task, within the same machine. If the process is
relatively fast, like the
Move()
instruction, and an asynchronous process is
reading the data, this can be even worse because the “reading old data” will
happen less often but is more insidious because it is so rare.
7.7.18 String Operations
String operations are performed using CRBasic string functions.
7.7.18.1 String Operators
The table
String Operators
(p. 303)
lists and describes available string operators.
String operators are case sensitive.
String Operators
Operator
Description
&
Concatenates strings. Forces numeric values to strings
before concatenation.
Example
1 & 2 & 3 & "a" & 5 & 6 & 7 = "123a567"
+
Adds numeric values until a string is encountered. When a
string is encountered, it is appended to the sum of the
numeric values. Subsequent numeric values are appended as
strings.
Example:
1 + 2 + 3 + "a" + 5 + 6 + 7 = "6a567"
-
"Subtracts" NULL ("") from the end of ASCII characters for
conversion to an ASCII code (LONG data type).
Example:
"a" - "" = 97
ASCII codes of the first characters in each string are
compared. If the difference between the codes is zero, codes
for the next characters are compared. When unequal codes
or NULL are encountered (NULL terminates all strings), the
difference between the last compared ASCII codes is
returned.
Examples:
Note
—
ASCII code for a = 97, b = 98, c = 99, d = 100, e =
101, and all strings end with NULL.
Difference between
NULL
and
NULL
Summary of Contents for CR800 Series
Page 2: ......
Page 4: ......
Page 6: ......
Page 32: ......
Page 34: ......
Page 54: ......
Page 92: ......
Page 310: ......
Page 446: ...Section 8 Operation 446 8 11 2 Data Display FIGURE 100 CR1000KD Displaying Data ...
Page 448: ...Section 8 Operation 448 FIGURE 102 CR1000KD Real Time Custom ...
Page 449: ...Section 8 Operation 449 8 11 2 3 Final Storage Data FIGURE 103 CR1000KD Final Storage Data ...
Page 450: ...Section 8 Operation 450 8 11 3 Run Stop Program FIGURE 104 CR1000KD Run Stop Program ...
Page 452: ...Section 8 Operation 452 FIGURE 106 CR1000KD File Edit ...
Page 456: ......
Page 462: ......
Page 523: ...Section 11 Glossary 523 FIGURE 116 Relationships of Accuracy Precision and Resolution ...
Page 524: ......
Page 526: ......
Page 556: ......
Page 558: ......
Page 560: ......
Page 597: ......