;{CR10X} ; ;Judd Communications Depth Sensor with ;Digital Output option, programming example ;Wiring ;Red +12V ;Black G ;Clear G ;Green C1 ;White C3 ;Brown Not used ;----------------------------------------------- *Table 1 Program 01: 3 Execution Interval (seconds) 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: 60 Interval (same units as above) 3: 01 Call Subroutine 1 ;The following command will allow the user to activate ;the depth sensor by using the "F1" Flag while ;monitoring the input locations using by Graph TERM ;program or the Connect button in PC208W. 3: If Flag/Port (P91) 1: 11 Do if Flag 1 is High 2: 01 Call Subroutine 1 ;------------------------------------------------ ;Log sensor output once an hour 4: If time is (P92) 1: 0 Minutes (Seconds --) into a 2: 60 Interval (same units as above) 3: 10 Set Output Flag High 5: Set Active Storage Area (P80) 1: 1 Final Storage Area 1 2: 101 Array ID or Loc [ _________ ] 6: Real Time (P77) 1: 1110 Year,Day,Hour/Minute 7: Sample (P70) 1: 1 Reps 2: 1 Loc [ Battery ] 8: Sample (P70) 1: 1 Reps 2: 2 Loc [ DSTempF ] 9: Sample (P70) 1: 1 Reps 2: 3 Loc [ DSTime ] 10: Sample (P70) 1: 1 Reps 2: 4 Loc [ DSDepth ] 11: Sample (P70) 1: 1 Reps 2: 5 Loc [ DSRetries ] ;------------------------------------------- ;Table 2 not used *Table 2 Program 02: 0.0000 Execution Interval (seconds) ;------------------------------------------- *Table 3 Subroutines 1: Beginning of Subroutine (P85) 1: 1 Subroutine 1 ;Turn Depth Sensor ON using Control port 1 2: Do (P86) 1: 41 Set Port 1 High ;Wait 2.75 seconds for ASCII sentence from sensor ;Data is input to Control port 3. Control port 2 ;is used by the P15 instruction as a DTR line. ;Nothing is connected to Control port 2 3: Port Serial I/O (Special) (P15) 1: 1 Reps 2: 1 ASCII/RS-232, 1200 Baud 3: 1 delay (0.01 seconds) 4: 2 First Control Port 5: 6 Output Loc [ Dummy ] 6: 0 No. of Locs to Send 7: 10 Termination Character 8: 26 Maximum Characters 9: 275 CTS/Input Wait 10: 2 Loc [ DSTempF ] 11: 1.0 Mult 12: 0.0 Offset ;Turn Depth Sensor OFF 4: Do (P86) 1: 51 Set Port 1 Low ;Convert Air Temp from Kelvin x 2, to Farenheit ;From K to C 5: Z=X*F (P37) 1: 2 X Loc [ DSTempF ] 2: .5 F 3: 2 Z Loc [ DSTempF ] 6: Z=X+F (P34) 1: 2 X Loc [ DSTempF ] 2: -273 F 3: 2 Z Loc [ DSTempF ] ;From C to F 7: Z=X*F (P37) 1: 2 X Loc [ DSTempF ] 2: 1.8 F 3: 2 Z Loc [ DSTempF ] 8: Z=X+F (P34) 1: 2 X Loc [ DSTempF ] 2: 32 F 3: 2 Z Loc [ DSTempF ] ;Convert Distance measured from millimeters to ;inches, and convert to a negative number 9: Z=X*F (P37) 1: 4 X Loc [ DSDepth ] 2: -.03937 F 3: 4 Z Loc [ DSDepth ] ;Convert distance measured to depth ; Depth = Distance to ground - Distance measured ;10: Z=X+F (P34) ; 1: 4 X Loc [ DSDepth ] ; 2: 0 F <<<<<<<<<<<<<<<<<< DISTANCE TO GROUND GOES HERE!!! ; 3: 4 Z Loc [ DSDepth ] 10: End (P95) End Program -Input Locations- 1 Battery 1 1 1 2 DSTempF 1 5 5 3 DSTime 1 1 0 4 DSDepth 1 2 1 5 DSRetries 1 1 0 6 Dummy 1 1 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