beautypg.com

88 if x compared to y, 89 if x compared to f, 90 step loop index – Campbell Scientific CR510 Basic Datalogger User Manual

Page 137: 91 if flag / port / modem

background image

SECTION 12. PROGRAM CONTROL INSTRUCTIONS

12-3

current values (samples at the time of output) of
locations 2-10.

Loops can be nested. Indexed locations within
nested loops are indexed to the inner most loop
that they are within. The maximum nesting
level in the CR510 is 11 deep. This applies to If
Then/Else comparisons and Loops or any
combination thereof. An If Then/Else
comparison which uses the Else Instruction (94)
counts as being nested 2 deep.

PARAM.

DATA

NUMBER

TYPE

DESCRIPTION

01:

4

Delay

02:

4

Iteration count

*** 88 IF X COMPARED TO Y ***

FUNCTION
This Instruction compares two input locations
and, if the result is true, executes the specified
Command. The comparison codes are given in
Table 12-3.

PARAM.

DATA

NUMBER

TYPE

DESCRIPTION

01:

4

Input location for X

02:

2

Comparison code
(Table 12-5)

03:

4

Input location for Y

04:

2

Command (Table 12-2)

TABLE 12-3. Comparison Codes

Parameter 1

Function

1

IF X = Y

2

IF X

Y

3

IF X

Y

4

IF X < Y

*** 89 IF X COMPARED TO F ***

FUNCTION
This Instruction 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-3.

PARAM.

DATA

NUMBER

TYPE

DESCRIPTION

01:

4

Input location for X

02:

2

Comparison code
(Table 12-3)

03:

FP

Fixed value

04:

2

Command (Table 12-2)

*** 90 STEP LOOP INDEX ***

FUNCTION
When used within a Loop (Instruction 87),
Instruction 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.
Instruction 90 does not affect the loop counter
which still counts by 1.

PARAM.

DATA

NUMBER

TYPE

DESCRIPTION

01:

2

Increment for the loop
index counter

*** 91 IF FLAG / PORT / MODEM ***

FUNCTION
This Instruction checks the status of one of the
ten Flags, one of the two ports, or the serial I/O
port modem enable and conditionally performs
the specified Command. Ports can be indexed
(--) with the C key.

The first Parameter specifies the condition to check:

1X

Execute command if Flag X is high

2X

Execute command if Flag X is low

40

Execute command if modem is on

4P

Execute command if port P is high

50

Execute command if modem is off

5P

Execute command if port P is low

where P = 1 or 2

PARAM.

DATA

NUMBER

TYPE

DESCRIPTION

01:

2

Flag or Port condition to
check

02:

2

Command (Table 12-2)