Campbell Scientific CR10 CR10 Measurement and Control - Page 118
To 0-540, Chart
View all Campbell Scientific CR10 manuals
Add to My Manuals
Save this manual to your list of manuals |
Page 118 highlights
SECTION 8. PROCESSING AND PROGRAM CONTROL EXAMPLES 09: P 01: 4 02: 30 03: 5 10: P92 01: 0 02: 60 03: 10 11: P69 01: 1 02: 180 03: 00 04: 1 05: 2 12: P71 01: 2 A2: 3 13: P 103SDM-AO4 Reps Address Loc WS output lf time is minutes into a minute interval Set high Flag 0 (output) Wind Vector Rep Samples per sub-interval Polar Sensor/(S ,D1, SD1) Wind Speed/East Loc WS Wind Direction/North Loc 0-360 wD Average Reps Loc Ta End Table 1 8.7 CONVERTING 0.360 WIND DIRECTION OUTPUT TO 0-540 FOR STRIP CHART lf 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 (see previous example), the following algorithm can be used to change a 0-360 degree input to 0-540. (lf you have a 0-540 pot, it can be used with the CR10 since the Wind Vector Instruction, 69, will work with this output.) 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 27O, the vane has shifted through 180 degrees and does not need to be altered. lf the previous 0-540 reading was greater than 270, 360 degrees is added. This example is written as a subroutine which is used by the previous example to output an analog voltage to a strip chart. Input Location Labels: 2:0-360 WD 6:0-540 out 10:0-540 WD *3 01: P85 01: 1 Table 3 Subroutines Beginning of Subroutine Subroutine Number 02: P89 01: 10 02: 3 03: 270 O4: 30 lf XF X Loc 0-540 WD >= F Then Do 03: P86 01: 11 Do Set high Flag 1 04: P94 Else 05: P86 01: 21 Do Set low Flag 1 06: P95 End 07: P31 01: 2 O2: 10 Z=X X Loc 0-360 WD Z Loc [:0-540 WD] 08: P89 01: 10 o2: 4 03: 180 o4: 30 lf XF X Loc 0-540 WD F Then Do 09: P91 01: 11 02: 30 lf Flag/Port Do if flag 1 is high Then Do 10: P34 01: 10 02: 360 03: 10 Z=X+F X Loc 0-540 WD F Z Loc [:0-540 WD] 11: P31 01: 10 02: 6 Z=X X Loc 0-540 WD Z Loc [:0-540 out] P95 End 13: P9s End 't4: P95 End 15: P End Table 3 8-8