Campbell Scientific CR10 CR10 Measurement and Control - Page 160

Ifx+y, Number

Page 160 highlights

SECTION 12. PROGRAM CONTROL INSTRUCTIONS TABLE 12.4. Example: Loop with Delay -1 Table 1 Programs 01: 10 Sec. Execution Interval 01: P87 01: o 02: 0 Beginning of Loop Delay Loop Count 11: P86 01: 1 Do CallSubroutine 1 12: P89 01: 25 02: 3 03: 6 04: 31 lf XF X Loc DAY >= F Exit Loop if true 13: P95 End 14: P87 01: 1 02: 0 Beginning of Loop Delay Loop Count 27: P86 01: 1 Do CallSubroutine 1 28: P89 01: 25 02., 3 03: 16 o4: 31 lf XF X Loc DAY >= F Exit Loop if true 29: P95 End P87 6 0 P86 1 P89 25 3 5 32 P95 P 3 01: P85 01: 1 02: P18 01: 2 02: 24 03: 25 03: P95 Beginning of Loop Delay Loop Count Do CallSubroutine 1 lf XF X Loc DAY >= F Exit Loop if false End End Table 1 Table 3 Subroutines Beginning of Subroutine Subroutine Number Time Hours into current year (maximum 8784) Mod/by Loc [:DAY 1 End r** 88 IF X COMPARED TO Y *** FUNCTION This lnstruction compares two input locations and, if the result is true, executes the specified Command. The comparison codes are given in Table 12-5. PARAM. DATA NUMBER TYPE 4 02: 2 03: 4 04: 2 DESCRIPTION lnput location for X Comparison code (Table 12-5) Input location for Y Command (Table 3.8-1) TABLE 12-5. Comparison Codes Parameter 1 1 2 3 4 Function IFX=Y IFX+Y IFX>Y IFX

  • 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
12. PROGRAM
CONTROL
INSTRUCTIONS
TABLE
12.4.
-1
01:
10
Example:
Loop
with
Delay
Table
1
Programs
Sec. Execution Interval
Beginning of Loop
Delay
Loop Count
Do
CallSubroutine
1
lf X<=>F
X Loc DAY
>=
F
Exit Loop
if
true
End
Beginning of Loop
Delay
Loop Count
Do
CallSubroutine
1
lf X<=>F
X
Loc DAY
>=
F
Exit Loop
if
true
End
Beginning of Loop
Delay
Loop Count
Do
CallSubroutine
1
lf X<=>F
X
Loc DAY
>=
F
Exit Loop
if
false
End
End
Table
1
Table 3 Subroutines
Beginning
of
Subroutine
Subroutine Number
Time
Hours into current year
(maximum 8784)
Mod/by
Loc
[:DAY
1
End
r**
88
IF
X COMPARED
TO
Y
***
FUNCTION
This
lnstruction compares
two
input locations
and,
if
the
result
is
true,
executes
the
specified
Command.
The comparison
codes
are given
in
Table
12-5.
PARAM.
DATA
NUMBER
TYPE
DESCRIPTION
lnput
location for
X
Comparison code
(Table
12-5)
Input location for
Y
Command
(Table 3.8-1)
TABLE
12-5. Comparison
Codes
12:
01:
02:
03:
04:
13:
01:
01:
02:
11:
01:
14:
01:
02:
27:
01:
28:
01:
02.,
03:
o4:
29:
01:
01:
02:
01:
P87
o
0
P86
1
P89
25
3
6
31
P86
1
P89
25
3
16
31
P95
P87
6
0
P86
1
4
2
4
2
02:
03:
04:
P95
P87
1
0
Parameter
1
1
2
3
4
Function
IFX=Y
IFX+Y
IFX>Y
IFX<Y
P89
25
3
5
32
P95
P
3
P85
1
P18
2
24
25
P95
02:
03:
03:
***
89
IF
X
COMPARED
TO
F
***
FUNCTION
This
Instruclion compares
an
input location to
a
fixed value
and,
if
the
result
is
true,
performs
the specified Command. The
comparison
codes
are given
in
Table
12-5.
PARAM.
DATA
NUMBER
ryPE
DESCRIPTION
02:
4
Input location for X
2
Comparison
code
(Table 12-5)
FP
Fixed value
2
Command (Table 3.8-1)
***
g0
STEP
LOOP
INDEX
***
FUNCTION
When
used within
a
Loop (lnstruction
87),
lnstruction 90
will
increment
the
index
counter
by a specified amount after the first time
through
the
loop, thus affecting all indexed input
location parameters in subsequent instructions.
For example,
if
4
is specified,
the
index
counter
will count up by
4
(0,4,8,12,...) inside
the
loop.
lnstruction 90 does not affect
the
loop
counter
which
still
counts
by
1.
o4:
12-4