Section 4. CRBasic – Native Language Programming
4-2
ModuleTemp is the keyword name of the instruction. There are four
parameters associated with ModuleTemp are:
Dest
ination, the name of the
variable in which to put the temperature;
Rep
etitions, the number of sequential
9050 modules to measure the temperature of;
Aslot
, the slot in the CR9000 that
the analog card is in; and
Integ
ration, the length of time to integrate the
measurement. To place the temperature of the analog module in slot 5 in the
variable RefTemp (using a 10 microsecond measurement integration time) the
code is:
ModuleTemp(RefTemp, 1, 5, 10)
The use of these instructions should become more clear as we go through an
introductory example.
4.1.3 Inserting Comments Into Program
Comments can be inserted into a program by preceding the comment with a
single quote (
'
). Comments can be entered either as independent lines or
following CR9000 code. When the CR9000 compiler sees the
'
it ignores the
rest of the line.
' The declaration of variables starts here.
Public Start(6)
'Declare the start time array
4.2 Programming Sequence
The following table describes the structure of a typical CR9000 program:
Declarations
Make a list of what to measure and calculate.
Declare constants
Within this list, include the fixed constants used,
Declare Public variables
indicate the values that the user is able to view while the program
is running,
Dimension variables
the number of each measurement that will be made,
Define Aliases
and specific names for any of the measurements.
Define data tables.
Describe, in detail, tables of data that will be saved from the
experiment.
Process/store trigger
Set when the data should be stored. Are they stored when some
condition is met? Are data stored on a fixed interval? Are they
stored on a fixed interval only while some condition is met?
Table size
Set the size of the table in CR9000 RAM
Other on-line storage devices
Should the data also be sent to PC card or Flash memory?
Processing of Data
What data are to be output (current value, average, maximum,
minimum, etc.)
Define Subroutines
If there is a process or series of calculations that need to be
repeated several times in the program, it can be packaged in a
subroutine and called when needed rather than repeating all
the code each time.
Summary of Contents for CR9000
Page 6: ...CR9000 Table of Contents iv This is a blank page ...
Page 22: ...CR9000 Overview OV 16 This is a blank page ...
Page 26: ...Section 1 Installation 1 4 CR9000 FIGURE 1 1 3 CR9000 Battery Pack ...
Page 72: ...Section 3 CR9000 Measurement Details 3 28 This is a blank page ...
Page 88: ...Section 5 Program Declarations 5 6 This is a blank page ...
Page 217: ...This is a blank page ...