beautypg.com

2 rainfall intensity – Campbell Scientific CR23X Micrologger User Manual

Page 112

background image

SECTION 8. PROCESSING AND PROGRAM CONTROL EXAMPLES

8-2

06:

Sample (P70)
1:

1

Reps

2:

2

Loc [ 10smpl_mx ]

INPUT LOCATIONS

1 Panl_Temp

15 Temp_i_5

2 10smpl_mx

16 Temp_i_4

11 Temp_i_#1

17 Temp_i_3

12 Temp_i_8

18 Temp_i_2

13 Temp_i_7

19 Temp_i_1

14 Temp_i_6

20 Temp_i

In the above example, all samples for the
maximum are stored in input locations. This is
necessary when an maximum must be output
with each new sample. In most cases,
maximums are desired less frequently than
sampling. For example, it may be necessary to
sample some parameter every 5 seconds and
output every hour a maximum of the previous
three hours' readings. If all samples were
saved, this would require 2160 input locations.
The same value can be obtained by determining
an hourly maximum and determining the
maximum of the hourly maximums for the past
three hours. To do this requires that hourly
maximums be stored in input locations.

Instruction 80 is used to send the 1 hour
maximum to Input Storage and again to send
the 3 hour maximum to Final Storage.

PROGRAM

*

Table 1 Program

01:

5.0

Execution Interval (seconds)

01:

Volt (Diff) (P2)
1:

1

Reps

2:

25

±5000 mV Slow 60 Hz
Rejection Range

3:

3

DIFF Channel

4:

5

Loc [ XX_mg_M3 ]

5:

10

Mult

6:

0

Offset

02:

If time is (P92)
1:

0

Minutes (Seconds --) into a

2:

60

Interval (same units as
above)

3:

10

Set Output Flag High

03:

Set Active Storage Area (P80)
1:

3

Input Storage Area

2:

3

Array ID or Loc [ max_i ]

04:

Maximum (P73)
1:

1

Reps

2:

5

Loc [ XX_mg_M3 ]

05:

Spatial Maximum (P49)
1:

3

Swath

2:

1

First Loc [ max_i_2 ]

3:

4

Avg Loc [ 3_Hr_max ]

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:

4

Loc [ 3_Hr_max ]

09:

If Flag/Port (P91)
1:

10

Do if Output Flag is High
(Flag 0)

2:

30

Then Do

10:

Block Move (P54)
1:

2

No. of Values

2:

2

First Source Loc
[ max_i_1 ]

3:

1

Source Step

4:

1

First Destination Loc
[ max_i_2 ]

5:

1

Destination Step

11:

End (P95)

INPUT LOCATIONS

1 max_i_2
2 max _i_1
3 max _i
4 3_Hr_ max
5 XX_mg_M3

8.2 RAINFALL INTENSITY

In this example, the total rain for the last 15
minutes is output only if any rain has occurred.
The program makes use of the capability to
direct the output of Output Processing
Instructions to Input Storage.