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
FLOAT
s,
LONG
s and
Boolean
s 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
Содержание CR1000
Страница 2: ......
Страница 4: ......
Страница 6: ......
Страница 32: ......
Страница 36: ......
Страница 38: ......
Страница 40: ......
Страница 60: ...Section 4 System Quickstart Figure 16 PC200W View Line Graph 60 ...
Страница 96: ......
Страница 98: ...98 ...
Страница 302: ......
Страница 350: ...Section 8 Operation Figure 91 Pulse Sensor Output Signal Types Figure 92 Switch Closure Pulse Sensor 350 ...
Страница 453: ...Section 8 Operation Figure 115 Using the Keyboard Display 453 ...
Страница 454: ...Section 8 Operation 8 8 1 Data Display Figure 116 Displaying Data with the Keyboard Display 454 ...
Страница 456: ...Section 8 Operation Figure 118 Real Time Custom 456 ...
Страница 457: ...Section 8 Operation 8 8 1 3 Final Memory Tables Figure 119 Final Memory Tables 457 ...
Страница 458: ...Section 8 Operation 8 8 2 Run Stop Program Figure 120 Run Stop Program 458 ...
Страница 460: ...Section 8 Operation Figure 122 File Edit 460 ...
Страница 461: ...Section 8 Operation 8 8 4 PCCard Memory Card Display Figure 123 PCCard CF Card Display 461 ...
Страница 478: ......
Страница 506: ......
Страница 536: ......
Страница 636: ......
Страница 642: ......
Страница 644: ......
Страница 676: ......
Страница 677: ......