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 #163 background imageLoading...
Page #163 background image
Section 7. Installation
converted to a LONG, it is truncated. This conversion is the same as the INT
function (Arithmetic Functions
(p. 568) ). The conversion is to an integer equal to or
less than the value of the float; for example, 4.6 becomes 4 and 4.6 becomes 5).
If a FLOAT is greater than the largest allowable LONG (+2,147,483,647), the
integer is set to the maximum. If a FLOAT is less than the smallest allowable
LONG (–2,147,483,648), the integer is set to the minimum.
Integers in Expressions
LONGs are evaluated in expressions as integers when possible. CRBasic example
Evaluation of Integers
(p. 163) illustrates evaluation of integers as LONGs and
FLOATs.
CRBasic Example 19. Evaluation of Integers
'This program example demonstrates the evaluation of integers.
Public I As Long
Public X As Float
BeginProg
I = 126
X = (I+3) * 3.4
'I+3 is evaluated as an integer, then converted to Float data type before it is
'multiplied by 3.4.
EndProg
Constants Conversion
Constants are not declared with a data type, so the CR1000 assigns the data type
as needed. If a constant (either entered as a number or declared with CONST) can
be expressed correctly as an integer, the compiler will use the type that is most
efficient in each expression. The integer version is used if possible, for example, if
the expression has not yet encountered a FLOAT. CRBasic example Constants to
LONGs or FLOATs
(p. 163) lists a programming case wherein a value normally
considered an integer (10) is assigned by the CR1000 to be As FLOAT.
CRBasic Example 20. Constants to LONGs or FLOATs
'This program example demonstrates conversion of constants to Long or Float data types.
Public L As Long
Public F1 As Float
Public F2 As Float
Const ID = 10
BeginProg
F1 = F2 + ID
L = ID * 5
EndProg
In CRBasic example Constants to LONGs or FLOATs (p. 163), I is an integer. A1
and A2 are FLOATS. The number 5 is loaded As FLOAT to add efficiently with
constant ID, which was compiled As FLOAT for the previous expression to avoid
an inefficient runtime conversion from LONG to FLOAT before each floating
point addition.
163

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