;{CR10X} ;A programming example showing how the Judd Communications ;Datalogger Display can be used with a CR10X or a CR10 equipped with the ;optional P15 Control Port Serial command and the P65 Bulk Load command. ; ;Wiring Diagram ;Color CR10X Datalogger Connection ;Red +12V ;Black Ground ;Clear Ground ;White Control Port 8 ; ;Sample the Day, Time, Battery voltage, and datalogger Temp every 5 seconds ;------------------------------------------------------- *Table 1 Program 01: 5.0 Execution Interval (seconds) ;The next three steps get the Day and Time and store them in ;input locations 1 and 2. 1: Do (P86) 1: 10 Set Output Flag High 2: Set Active Storage Area (P80) 1: 3 Input Storage Area 2: 1 Array ID or Loc [ Day ] 3: Real Time (P77) 1: 220 Day,Hour/Minute (prev day at midnight, 2400 at midnight) 4: Batt Voltage (P10) 1: 3 Loc [ Battery ] 5: Internal Temperature (P17) 1: 4 Loc [ TempC ] ;----------------------------------------------------- ;Input locations 6 and 7 are used to store the LCD1 cursor control codes 6: Z=F (P30) 1: 01 F 2: 0 Exponent of 10 3: 6 Z Loc [ CtrlA ] 7: Z=F (P30) 1: 02 F 2: 0 Exponent of 10 3: 7 Z Loc [ CtrlB ] ;Load the ASCII character numbers for the label "DAY " 8: Bulk Load (P65) 1: 68 F 2: 65 F 3: 89 F 4: 32 F 5: 32 F 6: 32 F 7: 32 F 8: 32 F 9: 10 Loc [ DayLbl ] ;Load the ASCII character numbers for the label "TIME " 9: Bulk Load (P65) 1: 84 F 2: 73 F 3: 77 F 4: 69 F 5: 32 F 6: 32 F 7: 32 F 8: 32 F 9: 18 Loc [ TimeLbl ] ;Load the ASCII character numbers for the label "BATTERY " 10: Bulk Load (P65) 1: 66 F 2: 65 F 3: 84 F 4: 84 F 5: 69 F 6: 82 F 7: 89 F 8: 32 F 9: 26 Loc [ BatLbl ] ;Load the ASCII character numbers for the label "TEMPßC " 11: Bulk Load (P65) 1: 84 F 2: 69 F 3: 77 F 4: 80 F 5: 223 F 6: 67 F 7: 32 F 8: 32 F 9: 34 Loc [ TempLbl ] ;----------------------------------------------- ;Output an ASCII 01 character to clear the LCD1 display. 12: Port Serial I/O (Special) (P15) 1: 1 Reps 2: 01 ASCII/RS-232, 1200 Baud 3: 1 delay (0.01 seconds) 4: 7 First Control Port 5: 6 Output Loc [ CtrlA ] 6: 1 No. of Locs to Send 7: 0 Termination Character 8: 0 Maximum Characters 9: 1 CTS/Input Wait 10: 8 Loc [ Dummy ] 11: 1 Mult 12: 0 Offset ;Output the labels to the first row of the LCD1 display. 13: Port Serial I/O (Special) (P15) 1: 1 Reps 2: 01 ASCII/RS-232, 1200 Baud 3: 1 delay (0.01 seconds) 4: 7 First Control Port 5: 10 Output Loc [ DayLbl ] 6: 32 No. of Locs to Send 7: 0 Termination Character 8: 0 Maximum Characters 9: 1 CTS/Input Wait 10: 8 Loc [ Dummy ] 11: 1 Mult 12: 0 Offset ;Output an ASCII 02 character to move the cursor to the beginning ;of the second line of the LCD1 display. 14: Port Serial I/O (Special) (P15) 1: 1 Reps 2: 01 ASCII/RS-232, 1200 Baud 3: 1 delay (0.01 seconds) 4: 7 First Control Port 5: 7 Output Loc [ CtrlB ] 6: 1 No. of Locs to Send 7: 0 Termination Character 8: 0 Maximum Characters 9: 1 CTS/Input Wait 10: 8 Loc [ Dummy ] 11: 1 Mult 12: 0 Offset ;Output the values for Day, Time, Battery, & TempC to the LCD1 display. ;Note the two dash characters associated with parameter 6. They indicate ;that the values will be output in the ASCII decimal equivelants. To toggle on ;the dashes, posistion the cursor on parameter 6 and either press the "F4" key ;or the "-" key for older versions of EDLOG. 15: Port Serial I/O (Special) (P15) 1: 1 Reps 2: 01 ASCII/RS-232, 1200 Baud 3: 1 delay (0.01 seconds) 4: 7 First Control Port 5: 1 Output Loc [ Day ] 6: 4 -- No. of Locs to Send 7: 0 Termination Character 8: 0 Maximum Characters 9: 1 CTS/Input Wait 10: 8 Loc [ Dummy ] 11: 1 Mult 12: 0 Offset ;---------------------------------------------------- ;Log the battery voltage and module temperature once an hour 16: If time is (P92) 1: 0 Minutes (Seconds --) into a 2: 60 Interval (same units as above) 3: 10 Set Output Flag High ;Set the array ID to 100 17: Set Active Storage Area (P80) 1: 1 Final Storage Area 1 2: 100 Array ID or Loc [ _________ ] ;Output Array, Year, Day, Time, Battery, TempC 18: Real Time (P77) 1: 1110 Year,Day,Hour/Minute 19: Average (P71) 1: 1 Reps 2: 3 Loc [ Battery ] 20: Average (P71) 1: 1 Reps 2: 4 Loc [ TempC ] ;----------------------------------------------- *Table 2 Program 02: 0.0 Execution Interval (seconds) *Table 3 Subroutines End Program -Input Locations- 1 Day 0 2 1 2 Time 0 0 1 3 Battery 0 1 2 4 TempC 0 1 1 5 _________ 0 0 0 6 CtrlA 0 2 2 7 CtrlB 0 2 1 8 Dummy 4 0 11 9 _________ 0 0 0 10 DayLbl 0 1 1 11 _________ 0 0 1 12 _________ 0 0 1 13 _________ 0 0 1 14 _________ 0 0 1 15 _________ 0 0 1 16 _________ 0 0 1 17 _________ 0 0 1 18 TimeLbl 0 0 1 19 _________ 0 0 1 20 _________ 0 0 1 21 _________ 0 0 1 22 _________ 0 0 1 23 _________ 0 0 1 24 _________ 0 0 1 25 _________ 0 0 1 26 BatLbl 0 0 1 27 _________ 0 0 1 28 _________ 0 0 1 29 _________ 0 0 1 30 _________ 0 0 1 31 _________ 0 0 1 32 _________ 0 0 1 33 _________ 0 0 0 34 TempLbl 0 0 1 35 _________ 0 0 1 36 _________ 0 0 1 37 _________ 0 0 1 38 _________ 0 0 1 39 _________ 0 0 1 40 _________ 0 0 1 41 _________ 0 0 2 -Program Security- 0000 0000 0000 -Mode 4- -Final Storage Area 2- 0