Campbell CR300 Series Operator's Manual page 81

Hide thumbs Also See for CR300 Series:
Table of Contents

Advertisement

Name
Argument
Description
Boolean
Boolean
Signed integer
Bool8
Bool8
NSEC
Time stamp
NSEC
String
ASCII string
String
CRBasic Example B-7. Use of the Disable Variable
'This program example demonstrates the use of the 'disable' variable, or DisableVar, which
'is a parameter in many output processing instructions. Use of the 'disable' variable
'allows source data to be selectively included in averages, maxima, minima, etc. If the
''disable' variable equals -1, or true, data are not included; if equal to 0, or false,
'data are included. The 'disable' variable is set to false (0) by default.
'Declare Variables and Units
Public
Oscillator
Public
Flag(1)
As Boolean
Public
DisableVar
'Define Data Tables
DataTable(OscAvgData,True,-1)
DataInterval(0,1,Min,10)
Average(1,Oscillator,FP2,DisableVar)
EndTable
'Main Program
BeginProg
Scan(1,Sec,1,0)
TABLE B-3. Data Types in Final-Data Memory
Word Size
(Bytes)
Use to store true or false states, such
as states of flags and control ports. 0
is always false. –1 is always true.
Depending on the application, any
4
other number may be interpreted as
true or false. See Appendix B.9,
Expressions
memory, consider using UINT2 or
BOOL8.
8 bits (0 or 1) of information. Uses
less space than 32-bit Boolean.
Integer
1
Holding the same information in
Boolean will require 256 bits.
Divided up as four bytes of seconds
since 1990 and four bytes of
8
nanoseconds into the second. Used to
record and process time data.
See caution.
String size is defined by the CR300
operating system and CRBasic
Minimum: 3
program.
(4 with null
terminator)
When converting from String to
Float, numerics at the beginning of a
Default: 24
string convert, but conversion stops
Maximum:
when a non-numeric is encountered.
limited only
If the string begins with a non-
to the size of
numeric, the Float will be NAN. If
available
the string contains multiple numeric
CR300
values, the SplitStr() instruction can
memory.
be used to parse out the numeric
values. Refer to CRBasic Editor
Help.
As Long
As Boolean
Appendix B. Introduction to CRBasic Programming
Notes
. To save
(p. B-13)
1
Unless declared otherwise, string size is 24
bytes or characters. String size is allocated
in multiples of four bytes; for example,
String * 25, String * 26, String * 27, and
String * 28 allocate 28 bytes (27 usable).
Minimum string size is 4 (3 usable). See
CRBasic Editor Help for more information.
Maximum length is limited only by
available CR300 memory.
Resolution / Range
True = –1 or any number ≥ 1
False = any number ≥ 0 and < 1
True = 1, False = 0
1 nanosecond
B-11

Advertisement

Table of Contents
loading

This manual is also suitable for:

Cr300-rf407Cr300-rf412Cr300-rf422

Table of Contents