EasyManuals Logo
Home>Campbell>Measuring Instruments>CR1000

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 #162 background imageLoading...
Page #162 background image
Section 7. Installation
CRBasic Example 16. Use of Move() to Conserve Code Space
Move(counter(1),6,0,1) 'Reset six counters to zero. Keep array
'filled with the ten most current readings
Move(TempC(2),9,TempC(1),9) 'Shift previous nine readings to make room
'for new measurement
'New measurement:
TCDiff(TempC(1),1,mV2_5C,8,TypeT,PTemp,True,0,_60Hz,1.0,0)
CRBasic Example 17. Use of Variable Arrays to Conserve Code Space
For I = 1 to 20
TCTemp(I) = TCTemp(I) * 1.8 + 32
Next I
7.8.4.15.3 Expressions with Numeric Data Types
FLOATs, LONGs and Booleans are cross-converted to other data types, such as
FP2, by using '='.
Boolean from FLOAT or LONG
When a FLOAT or LONG is converted to a Boolean as shown in CRBasic
example Conversion of FLOAT / LONG to Boolean
(p. 162), zero becomes false (0)
and non-zero becomes true (-1).
CRBasic Example 18. Conversion of FLOAT / LONG to Boolean
'This program example demonstrates conversion of Float and Long data types to Boolean
'data type.
Public Fa As Float
Public Fb As Float
Public L As Long
Public Ba As Boolean
Public Bb As Boolean
Public Bc As Boolean
BeginProg
Fa = 0
Fb = 0.125
L = 126
Ba = Fa 'This will set Ba = False (0)
Bb = Fb 'This will Set Bb = True (-1)
Bc = L 'This will Set Bc = True (-1)
EndProg
FLOAT from LONG or Boolean
When a LONG or Boolean is converted to FLOAT, the integer value is loaded
into the FLOAT. Booleans are converted to -1 or 0. LONG integers greater than
24 bits (16,777,215; the size of the mantissa for a FLOAT) will lose resolution
when converted to FLOAT.
LONG from FLOAT or Boolean
When converted to Long, Boolean is converted to -1 or 0. When a FLOAT is
162

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
BrandCampbell
ModelCR1000
CategoryMeasuring Instruments
LanguageEnglish

Related product manuals