EasyManuals Logo

Campbell CR1000 User Manual

Campbell CR1000
678 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 #287 background imageLoading...
Page #287 background image
Section 7. Installation
7.9.19.6 String Use of ASCII / ANSII Codes
Table 50. 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
7.9.19.7 Formatting Strings
Table 51. Formatting Strings Examples
Expression Result
Str(1)=123e4
Str(2)=FormatFloat(123e4,"%12.2f")
Str(3)=FormatFloat(Values(2)," The battery is %.3g Volts ")
Str(4)=Strings(3,1,InStr(1,Strings(3),"The battery is ",4))
Str(5)=Strings(3,1,InStr(1,Strings(3),"is ",2) + 3)
1230000
1230000.00
“The battery is 12.4 Volts”
12.4 Volts
12.4 Volts
Str(6)=Replace("The battery is 12.4 Volts"," is "," = ")
Str(7)=LTrim("The battery is 12.4 Volts")
Str(8)=RTrim("The battery is 12.4 Volts")
Str(9)=Trim("The battery is 12.4 Volts")
Str(10)=UpperCase("The battery is 12.4 Volts")
The battery = 12.4 Volts
The battery is 12.4 Volts
The battery is 12.4 Volts
The battery is 12.4 Volts
THE BATTERY IS 12.4 VOLTS
Str(12)=Left("The battery is 12.4 Volts",5)
Str(13)=Right("The battery is 12.4 Volts",7)
The b
Volts
CRBasic Example 60. Formatting Strings
'This program example demonstrates the formatting of string variables. To run the
'demonstration, send this program to the CR1000. String formatting will occur
'automatically.
'Objective:
'Extract "12.4 Volts" from the string "The battery is 12.4 Volts"
Public StringVar As String
BeginProg
'Note line continuation character _
StringVar() = Mid("The battery is 12.4 Volts", _
InStr(1,"The battery is 12.4 Volts"," is ",2)+3,Len("The battery is 12.4 Volts"))
EndProg
287

Table of Contents

Questions and Answers:

Question and Answer IconNeed help?

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

Campbell CR1000 Specifications

General IconGeneral
Power Requirements9.6 to 16 VDC
Data Logger Operating SystemCRBasic
Memory4 MB
Analog Inputs16 single-ended or 8 differential
Analog Input Resolution13 bits
Analog Input Range+/-2.5V
Digital I/O8
Pulse Counters2
Communication PortsRS-232
Operating Temperature-25°C to +50°C
Pulse Channels4

Related product manuals