Campbell-scientific CR9000X Measurement and Control System Manual de usuario Pagina 135

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 442
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 134
Section 4. CRBasic – Native Language Programming
Keywords and predefined constants are reserved for internal
CR9000X use. If a user programmed variable happens to be a
keyword or predefined constant, a runtime or compile error will
occur. To correct the error, simply change the variable. CRBasic
Help also has the list of keywords and pre-defined constants.
NOTE
See Appendix A Keywords and Predefined Constants for a list of keywords
and pre-defined constants.
Common instructions – Instructions and operators used in most BASIC
languages, including program control statements, and logic and
mathematical operators.
Special instructions – Instructions unique to CRBASIC, including
measurement instructions that access measurement channels, and
processing instructions that compress many common calculations used in
CR9000X dataloggers.
These four elements must be properly placed within the program structure.
4.2.2 Numerical Entries
In addition to entering regular base 10 numbers there are 3 additional ways to
represent numbers in a program: scientific notation, binary, and hexadecimal
(Table 4.2.2-1).
TABLE 4.2.2-1 Formats for Entering
Numbers in CRBasic
Format Example Base10 Value
Standard 6.832 6.832
Scientific notation 5.67E-8 5.67X10
-8
Binary: &B1101 13
Hexadecimal &HFF 255
The binary format makes it easy to visualize operations where the ones and
zeros translate into specific commands. For example, a block of ports can be
set with a number, the binary form of which represents the status of the ports
(1= high, 0=low). To set ports 1, 3, 4, and 6 high and 2, 5, 7, and 8 low; the
number is &B00101101. The least significant bit on the right represents port 1.
This is much easier to visualize than entering 72, the decimal equivalent.
4.2.3 Programming Structure
A typical CRBasic program contains:
a) Variable Declarations
b) Data Table Definitions
c) Subroutine Definitions (The use of subroutines is optional)
d) Program(s) including the Scan Interval, Measurements, Processes, Controls, and calls to
Data Tables
4-7
Vista de pagina 134
1 2 ... 130 131 132 133 134 135 136 137 138 139 140 ... 441 442

Comentarios a estos manuales

Sin comentarios