beautypg.com

Campbell Scientific CR10X Measurement and Control System User Manual

Page 111

background image

SECTION 8. PROCESSING AND PROGRAM CONTROL EXAMPLES

8-3

Every 15 minutes, the total rain is sent to Input
Storage. If the total is not equal to 0, output is
redirected to Final Storage Area 1, the time is
output and the total is sampled.

PROGRAM

*

Table 1 Program

01:

60.0

Execution Interval (seconds)

01:

Pulse (P3)
1:

1

Reps

2:

1

Pulse Input Channel

3:

2

Switch Closure

4:

1

Loc [ Precip_mm ]

5:

.254

Mult

6:

0

Offset

02:

If time is (P92)
1:

0

Minutes (Seconds --) into a

2:

15

Interval (same units as above)

3:

10

Set Output Flag High

03:

Set Active Storage Area (P80)
1:

3

Input Storage Area

2:

2

Array ID or Loc [ 15min_tot ]

04:

Totalize (P72)
1:

1

Reps

2:

1

Loc [ Precip_mm ]

05:

IF (X<=>F) (P89)
1:

2

X Loc [ 15min_tot ]

2:

2

<>

3:

0

F

4:

30

Then Do

06:

Set Active Storage Area (P80)
1:

1

Final Storage Area 1

2:

25

Array ID or Loc
[ _________ ]

07:

Real Time (P77)
1: 0110

Day,Hour/Minute

08:

Sample (P70)
1:

1

Reps

2:

2

Loc [ 15min_tot ]

09:

End (P95)

INPUT LOCATIONS

1 Precip_mm
2 15min_tot

8.3 USING CONTROL PORTS AND

LOOP TO RUN AM416
MULTIPLEXER

This example uses an AM416 to measure 16
copper-constantan thermocouples and 16
Model 223 soil moisture blocks. The sensors
are read every ten minutes and the average
value output once an hour. The multiplexer is
housed in an AM-ENCT enclosure to minimize
thermocouple errors created by thermal
gradients. A 107 Temperature Probe is
centrally located on the multiplexer board and
used as a thermocouple temperature reference.

The AM416 switches the 223 moisture block out
of the circuit when it is not being measured.
This eliminates the need for the blocking
capacitors used in the model 227 soil moisture
block. The 223 blocks are about one fifth the
cost of the 227 blocks.

Control ports are used to reset the AM416 and
clock it through its channels. The sequence of
the program is:

• Measure the 107 probe located at the

AM416 for TC temperature reference.

• CR10X sets the port high which resets the

AM416.

• A loop is entered; within each pass:

• The port clocking the AM416 is pulsed.

• Delay to ensure relay is closed.

• The connected TCs and moisture blocks

are measured.

• CR10X sets the port controlling AM416 reset

low.

• Soil moisture measurements are converted

to block resistances.

The input location in which the temperature and
soil moisture measurements are stored is
indexed to the loop counter (Instruction 87,
Section 12). An indexed location is
incremented by one with each pass through the
loop. For example, on the first pass
temperature is stored in Location 2, and soil
moisture in Location 18. On the second pass
temperature is stored in Location 3, and soil
moisture in Location 19. After 16 loop passes,
temperature and soil moisture measurements
occupy Locations 2 through 17 and 18 through
33, respectively.

Connections are shown in Figure 8.3-1.