Campbell Scientific CR10 CR10 Measurement and Control - Page 51

Set Basics

Page 51 highlights

SECTION 3. INSTRUCTION SET BASICS The instructions used to program the CRl0 are divided into four types: lnpuUOutput (l/O), Processing, Output Processing, and Program Control. l/O Instructions are used to make measurements and store the readings in input locations or to initiate analog or digital port output. Processing lnstructions pertorm mathematical operations using data from lnput Storage locations and place the results back into specified lnput Storage locations. Output Processing lnstructions provide a method for generating time or event dependent data summaries from processed sensor readings residing in specified lnput Storage tocations. Program Control lnstructions are used to direct program execution based on time and or conditionalfests on input data and to direct output to external devices. lnstructions are identified by a number. There are a fixed number of parameters associated with each instruction to give the CRl0 the information required to execute the instruction. The set of instructions available in the CRl0 is determined by the PROM (Programmable Read Only Memory) inside the CR|0. Appendix B lists the PROM options available. 3.1 PARAMETER DATA TYPES There are 3 different data types used for lnstruction parameters: Floating Point (FP), 4 digit integers (4), and 2 digit integers (2). The parameter data type is identified in the listings of the instruction parameters in Sections 9-12. Different data types are used to allow the CR10 to make the most efficient use of its memory. Floating Point parameters are used to enter numeric constants for calibrations or mathematical operations. While it is only possible to enter 5 digits (magnitude +.00001 to +99999.), the internalformat has a much greater range (1xlO-191e 9;1918, Section 2.2.1). Instruction 30 can be used to enter a number in scientific notation into an input location. 3.2 REPETITIONS The repetitions parameter on many of the l/O, Processing, and Output Processing Instructions is used to repeat the instruction on a number of sequential Input Channels or Input Storage locations. For example, if you are making 4 differentialvoltage measurements on the same voltage range, wire the inputs to sequential channels and enter the Differential Voltage Measurement lnstruction once with 4 repetitions, rather than entering 4 separate measurement instructions. The instruction will make 4 measurements starting on the specified channel number and continuing through the 3 succeeding differentialchannels. The results will be stored in the specified input location and the 3 succeeding input locations. Averages for all 4 measurements can be calculated by entering the Average Instruction with 4 repetitions. When several of the same type of measurements will be made, but the calibrations of the sensors are different, it requires less time to make the measurements using one measurement with repetitions and then apply the calibrations with a scaling array (lnst. 53) than it does to enter the instruction several times in order to use a different multiplier and offset. This is due to set up and calibration time for each measurement instruction. However, if time is not a constraint, separate instructions may make the program easier to follow. 3.3 ENTERING NEGATIVE NUMBERS After keying in a number, press C or "-" to change the number's sign. On floating point numbers a minus sign (-) will appear to the left of the number. Excitation voltages in millivolts for l/O lnstructions are 4 digit integers; when C is keyed 2 minus signs (-) will appear to the right of the number indicating a negative excitation. Even though this display is the same as that indicating an indexed input location, (Section 3.4) there is no indexing effect on excitation voltage. 3.4 INDEXING INPUT LOCATIONS AND PORTS When used within a loop, the parameters for input locations and the commands to set, toggle, or pulse a port can be Indexed to the loop counter. The loop counter is added to the indexed value to determine the actual lnput Location or Port the instruction acts on. Normally the loop counter is incremented by 1 after each pass through the loop. lnstruction 3-1

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140
  • 141
  • 142
  • 143
  • 144
  • 145
  • 146
  • 147
  • 148
  • 149
  • 150
  • 151
  • 152
  • 153
  • 154
  • 155
  • 156
  • 157
  • 158
  • 159
  • 160
  • 161
  • 162
  • 163
  • 164
  • 165
  • 166
  • 167
  • 168
  • 169
  • 170
  • 171
  • 172
  • 173
  • 174
  • 175
  • 176
  • 177
  • 178
  • 179
  • 180
  • 181
  • 182
  • 183
  • 184
  • 185
  • 186
  • 187
  • 188
  • 189
  • 190
  • 191
  • 192
  • 193
  • 194
  • 195
  • 196
  • 197
  • 198
  • 199
  • 200
  • 201
  • 202
  • 203
  • 204
  • 205
  • 206
  • 207
  • 208
  • 209
  • 210
  • 211
  • 212
  • 213
  • 214
  • 215
  • 216
  • 217
  • 218
  • 219
  • 220
  • 221
  • 222
  • 223
  • 224
  • 225
  • 226
  • 227
  • 228
  • 229
  • 230
  • 231
  • 232
  • 233
  • 234
  • 235
  • 236
  • 237
  • 238

SECTION
3.
INSTRUCTION
SET BASICS
The
instructions
used to
program
the
CRl0
are divided into four types: lnpuUOutput
(l/O),
Processing,
Output
Processing, and Program
Control.
l/O
Instructions
are
used
to
make measurements and
store
the readings in
input
locations or
to
initiate
analog
or digital
port
output.
Processing
lnstructions
pertorm
mathematical operations using data from
lnput
Storage locations
and
place
the
results
back
into
specified
lnput
Storage
locations.
Output
Processing
lnstructions
provide
a
method
for
generating
time
or event dependent data summaries from
processed
sensor readings residing in
specified lnput Storage
tocations.
Program
Control
lnstructions
are
used to direct
program
execution based
on
time and
or
conditionalfests
on
input
data and to direct output to external devices.
lnstructions
are identified by
a
number.
There are
a
fixed
number
of
parameters
associated with each
instruction
to
give
the
CRl0
the information required
to
execute
the
instruction.
The
set
of
instructions
available
in
the
CRl0
is determined by the PROM (Programmable Read Only Memory) inside the
CR|0.
Appendix
B
lists
the PROM options available.
3.1
PARAMETER DATA TYPES
There are 3 different data
types
used
for
lnstruction parameters:
Floating Point (FP),
4
digit integers
(4), and 2
digit
integers
(2).
The
parameter data
type
is identified
in
the
listings
of
the
instruction
parameters
in Sections 9-12.
Different data types
are
used to allow
the
CR10
to
make
the
most
efficient
use
of
its memory.
Floating Point parameters
are
used
to enter
numeric constants for
calibrations or
mathematical
operations. While
it
is
only
possible
to
enter 5
digits
(magnitude +.00001
to
+99999.),
the internalformat
has
a
much
greater range (1xlO-191e 9;1918, Section
2.2.1).
Instruction 30
can
be used
to
enter a
number in
scientific
notation into
an
input
location.
3.2
REPETITIONS
The
repetitions parameter
on
many of
the
l/O,
Processing, and
Output
Processing Instructions
is used
to
repeat
the
instruction on
a
number of
sequential
Input Channels
or
Input Storage
locations.
For
example,
if
you are
making
4
differentialvoltage
measurements on
the
same
voltage
range, wire
the
inputs to sequential
channels and enter
the
Differential Voltage
Measurement lnstruction once with
4
repetitions,
rather
than
entering 4
separate
measurement
instructions. The
instruction
will
make
4
measurements starting on
the
specified channel
number and continuing
through
the 3 succeeding
differentialchannels.
The
results
will
be stored
in
the specified input location and the
3
succeeding input
locations.
Averages for all 4
measurements
can
be
calculated
by entering
the
Average
Instruction
with 4
repetitions.
When
several
of
the
same
type
of
measurements
will be
made, but
the
calibrations
of
the
sensors are
different,
it
requires less time
to
make
the
measurements
using
one
measurement
with
repetitions and
then
apply the calibrations
with
a scaling array
(lnst.
53)
than
it
does to enter
the
instruction
several
times
in order
to
use a different
multiplier and
offset.
This is due to set up and
calibration time
for each
measurement
instruction.
However,
if
time
is not
a
constraint,
separate
instructions may make
the
program
easier to follow.
3.3
ENTERING NEGATIVE NUMBERS
After
keying in
a
number, press C
or
"-"
to
change
the
number's
sign.
On
floating
point
numbers a minus sign
(-)
will
appear to
the
left
of
the
number.
Excitation
voltages
in millivolts
for l/O
lnstructions are
4
digit
integers; when C
is keyed
2
minus
signs
(-)
will
appear to
the
right
of
the
number indicating
a
negative
excitation.
Even though this display
is
the same
as
that
indicating
an
indexed input location,
(Section 3.4)
there
is no indexing effect on
excitation voltage.
3.4
INDEXING
INPUT LOCATIONS AND
PORTS
When
used within
a
loop,
the
parameters
for
input
locations and the commands
to
set,
toggle, or
pulse
a
port can
be
Indexed to the
loop
counter.
The
loop
counter
is
added to
the
indexed value to determine
the actual
lnput
Location
or
Port
the
instruction acts on.
Normally the loop
counter
is incremented
by
1
after each pass through
the
loop.
lnstruction
3-1