EasyManuals Logo

Campbell CR850 User Manual

Campbell CR850
566 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #240 background imageLoading...
Page #240 background image
Section 7. Installation
240
Some smart sensors send strings containing NULL characters. To manipulate a
string that has NULL characters within it (in addition to being terminated with
another NULL), use MoveBytes() instruction.
7.8.13.4 Inserting String Characters
CRBasicExample48. InsertingStringCharacters
Objective:
Use MoveBytes() to change "123456789" to "123A56789"
Given:
StringVar(7) = "123456789" 'Result is
"123456789"
Try (does not work):
StringVar(7,1,4) = "A" 'Result is
"123A<NULL>56789"
Instead, use:
StringVar(7) = MoveBytes(Strings(7,1,4),0,"A",0,1) 'Result is
"123A56789"
7.8.13.5 Extracting String Characters
A specific character in the string can be accessed by using the "dimensional"
syntax; that is, when the third dimension of a string is specified, the third
dimension is the character position.
Table 41. Extracting String Characters
Expression Comments Result
StringVar(3) = "Go Jazz"
Loads string into variable
StringVar(3) = "Go Jazz"
StringVar(4) = StringVar(3,1,4)
Extracts single character
StringVar(4) = "J"
7.8.13.6 String Use of ASCII / ANSII Codes
Table 42. Use of ASCII / ANSII Codes Examples
Expression Comments Result
LongVar (7) = ASCII("#")
35
LongVar (8) = ASCII("*")
42
LongVar (9) = "#"
Cannot be converted to Long with
NULL
NAN
LongVar (1) = "#"-""
Can be converted to Long without
NULL
35

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Campbell CR850 and is the answer not in the manual?

Campbell CR850 Specifications

General IconGeneral
BrandCampbell
ModelCR850
CategoryMeasuring Instruments
LanguageEnglish

Related product manuals