;{CR10X} ;Demonstration program to show how to use the ;Judd Communications depth senor. ; ;Wiring diagram: ; ;Wire Purpose Datalogger ;____________________________________ ;Clear Shield G ;Black Power - G ;Red Power + +12V ;Green On/Off C1 ;White Signal + 3H ;Brown Signal - 3L ; ; *Table 1 Program 01: 5.0 Execution Interval (seconds) ; ;------------------------------------------------------- ;Input Processing ;------------------------------------------------------- 1: Batt Voltage (P10) 1: 1 Loc [ Battery ] ; ;The depth sensor sampling routine works best as a ;subroutine. The following command will call ;subroutine #1 once an hour. 2: If time is (P92) 1: 0 Minutes (Seconds --) into a 2: 1 Interval (same units as above) 3: 1 Call Subroutine 1 ; ;The following command will allow the user to activate ;the depth sensor by pressing the "F1" key while ;monitoring the input locations using the TERM or ;Graph TERM program. 3: If Flag/Port (P91) 1: 11 Do if Flag 1 is High 2: 1 Call Subroutine 1 ; ;------------------------------------------------------- ;Final Storage, or Output Processing ;------------------------------------------------------- ; ;If Somebody left the depth sensor on, turn it off 4: If time is (P92) 1: 0 Minutes (Seconds --) into a 2: 60 Interval (same units as above) 3: 30 Then Do 5: If Flag/Port (P91) 1: 11 Do if Flag 1 is High 2: 21 Set Flag 1 Low 6: End (P95) ; ;-------------------------------------------------------- ;Send hourly data to final storage ;Array ID, Julian day, Time, Air Temp, Depth 7: If time is (P92) 1: 0 Minutes (Seconds --) into a 2: 1 Interval (same units as above) 3: 10 Set Output Flag High ; ;Assign an output array ID of 101 8: Set Active Storage Area (P80) 1: 1 Final Storage Area 1 2: 101 Array ID or Loc [ _________ ] 9: Real Time (P77) 1: 120 Day,Hour/Minute (2400 at midnight) 10: Average (P71) 1: 1 Reps 2: 3 Loc [ Air_TempF ] 11: Sample (P70) 1: 1 Reps 2: 4 Loc [ Depth ] ; ;------------------------------------------------------- ;Table 2 not used ;------------------------------------------------------- *Table 2 Program 02: 0.0 Execution Interval (seconds) ; ;------------------------------------------------------- ;Subroutines ;------------------------------------------------------- *Table 3 Subroutines ; ;Assign the depth sensor subroutine a number, note that ;this number and the calling number need to be the same. 1: Beginning of Subroutine (P85) 1: 1 Subroutine 1 ; ;Turn ON the depth sesor 2: Do (P86) 1: 41 Set Port 1 High ; ;wait 0.8 seconds for the sensor to output the ;Air Temp. 3: Excitation with Delay (P22) 1: 1 Ex Channel 2: 80 Delay W/Ex (units = 0.01 sec) 3: 0 Delay After Ex (units = 0.01 sec) 4: 0 mV Excitation ; ;Air Temp is output in milliVolts, scaled to Kelvin, ;and then convert to Celsius. 4: Volt (Diff) (P2) 1: 1 Reps 2: 5 ñ 2500 mV Slow Range 3: 3 DIFF Channel 4: 2 Loc [ Air_TempC ] 5: .2 Mult 6: -273 Offset ; ;Air Temp is also converted and saved in Fahrenheit 5: Z=X*F (P37) 1: 2 X Loc [ Air_TempC ] 2: 1.8 F 3: 3 Z Loc [ Air_TempF ] 6: Z=X+F (P34) 1: 3 X Loc [ Air_TempF ] 2: 32 F 3: 3 Z Loc [ Air_TempF ] ; ;The depth sensor needs another 1.8 seconds to make up ;to 10 measurements and perform error checking and ;temperature compensation. ; 7: Excitation with Delay (P22) 1: 1 Ex Channel 2: 180 Delay W/Ex (units = 0.01 sec) 3: 0 Delay After Ex (units = 0.01 sec) 4: 0 mV Excitation ; ;Distance is output in milliVolts, scaled to inches, and ;then converted to depth by subtracting the distance ;measured from the reference distance. ; ;Use a multiplier of -.19685 for output in inches ;and -.5 for ouput in centimeters. 8: Volt (Diff) (P2) 1: 1 Reps 2: 5 ñ 2500 mV Slow Range 3: 3 DIFF Channel 4: 4 Loc [ Depth ] 5: .19685 Mult; Convert to inches 6: 0 Offset; Sensor mounted 46" above ground ; ;Turn OFF depth sensor. 9: Do (P86) 1: 51 Set Port 1 Low ; ;The end of subroutine 1, return to main program 10: End (P95) End Program -Input Locations- 1 Battery 0 0 0 2 Air_TempC 0 0 0 3 Air_TempF 0 0 0 4 Depth 0 0 0 5 _________ 0 0 0 6 _________ 0 0 0 7 _________ 0 0 0 8 _________ 0 0 0 9 _________ 0 0 0 10 _________ 0 0 0 11 _________ 0 0 0 12 _________ 0 0 0 13 _________ 0 0 0 14 _________ 0 0 0 15 _________ 0 0 0 16 _________ 0 0 0 17 _________ 0 0 0 18 _________ 0 0 0 19 _________ 0 0 0 20 _________ 0 0 0 21 _________ 0 0 0 22 _________ 0 0 0 23 _________ 0 0 0 24 _________ 0 0 0 25 _________ 0 0 0 26 _________ 0 0 0 27 _________ 0 0 0 28 _________ 0 0 0 -Program Security- 0000 0000 0000 -Mode 4- -Final Storage Area 2- 0 -CR10X ID- 0 -CR10X Power Up- 3