Converting 0-360 Wind Direction Output To 0-540 For Strip Chart - Campbell CR510 Operator's Manual

Datalogger
Hide thumbs Also See for CR510:
Table of Contents

Advertisement

SECTION 8. PROCESSING AND PROGRAM CONTROL EXAMPLES
PROGRAM
*
Table 1 Program
01:
10.0
01:
Pulse (P3)
1:
1
2:
1
3:
2
4:
10
5:
.254
6:
0
02:
Pulse (P3)
1:
1
2:
3
3:
2
4:
11
5:
.254
6:
0
03:
If time is (P92)
1:
0
2:
60
3:
10
04:
Real Time (P77)
1: 0110
05:
Totalize (P72)
1:
2
2:
10
INPUT LOCATIONS
10 Precip_1
11 Precip_2
8.5 CONVERTING 0-360 WIND
DIRECTION OUTPUT TO 0-540 FOR
STRIP CHART
If 0-360 degree wind direction is output to a strip
chart the discontinuity at 0/360 will cause the pen
to jump back and forth full scale when the winds
are varying from the north. In the days of strip
charts this was solved with a 0-540 degree pot on
the wind vane (direction changes from 540 to 180
and from 0 to 360 so the pen only jumps once
when the wind is out of the north or south).
When faced with the necessity of strip chart
output, the following algorithm can be used to
change a 0-360 degree input to 0-540. (If you
have a 0-540 pot, it can be used with the
CR510 since the Wind Vector Instruction, 69,
will work with this output.)
8-4
Execution Interval (seconds)
Reps
Pulse Input Channel
Switch Closure
Loc [ Precip_1 ]
Mult
Offset
Reps
Pulse Channel 3
Switch Closure
Loc [ Precip_2 ]
Mult
Offset
Minutes (Seconds --) into a
Interval (same units as above)
Set Output Flag High
Day,Hour/Minute
Reps
Loc [ Precip_1 ]
To change 0-360 degrees to the 0-540 degrees,
360 degrees must sometimes be added to the
reading when it is in the range of 0 to 180. The
following algorithm does this by assuming that if
the previous reading was less than 270, the vane
has shifted through 180 degrees and does not
need to be altered. If the previous 0-540 reading
was greater than 270, 360 degrees is added.
This example is written as a subroutine which is
used to output an analog voltage to a strip
chart.
*
Table 3 Subroutines
01:
Beginning of Subroutine (P85)
1:
1
Subroutine 1
02:
IF (X<=>F) (P89)
1: 10
X Loc [ 0_540_WD ]
2:
3
>=
3: 270
F
4: 30
Then Do
03:
Do (P86)
1: 11
Set Flag 1 High
04:
Else (P94)
05:
Do (P86)
1: 21
Set Flag 1 Low
06:
End (P95)
07:
Z=X (P31)
1:
2
X Loc [ 0_360_WD ]
2: 10
Z Loc [ 0_540_WD ]
08:
IF (X<=>F) (P89)
1: 10
X Loc [ 0_540_WD ]
2:
4
<
3: 180
F
4: 30
Then Do
09:
If Flag/Port (P91)
1: 11
Do if Flag 1 is High
2: 30
Then Do
10:
Z=X+F (P34)
1: 10
X Loc [ 0_540_WD ]
2: 360
F
3: 10
Z Loc [ 0_540_WD ]
11:
Z=X (P31)
1: 10
X Loc [ 0_540_WD ]
2:
6
Z Loc [ 0_540_out ]

Advertisement

Table of Contents
loading

Table of Contents