;{CR510} ;compile for the CR510 unit ; ;======================================================================== ; ;Program: ECI_EX1.CSI, Version 1.1, April 21, 2006 ;Virginia Technologies, Inc. ;Written By: Bob Ross ; ; Example program for using up to 10 ECI-1's on PORT 1 of a CR510 ; Datalogger. ONLY FOR PORT 1 use. To modify for another port, ; *ALL* P105 commands' port # have to be updated. ; ; Uses a "port sniffer" to locate ECI devices on the SDI_12 network. ; The network is "sniffed" at the beginning of every measurement cycle. ; ; The data can be collected into a .DAT type file using ; Campbell Scientific PC based programs such as PC208W ; or Loggernet. The .DAT file can be imported into an EXCEL ECI-1 specific ; template file (ECI_EX1_VIEWER.xls) avaliable for download on the ECI-1 web site ; support page : http://www.vatechnologies.com/eciSupport.htm ; Other related documents include an application note describing the operation ; of this program (APPNOTE_ECI-100.pdf) and a help file related to the EXCEL viewer ; (ECI_EX1_VIEWER_HELP.pdf) ; ;======================================================================== ; ; ;======================================================================== ; ================ Set up table 1's execution interval ================= ;======================================================================== ; *Table 1 Program 01: 10 Execution Interval (seconds) ;======================================================================== ; ================ RUN ONCE ON POWER UP ================= ;======================================================================== ; 1: If (X<=>F) (P89) 1: 1 X Loc [ RUN_ONCE ] @@0 2: 1 = 3: 0.0 F 4: 30 Then Do ; set flag, so this block of code runs once 2: Z=F (P30) 1: 1 F 2: 00 Exponent of 10 3: 1 Z Loc [ RUN_ONCE ] ; ========================================= ; ========== CODE TO RUN ONCE ============= ; ========================================= ; sniff port 1 for ECI units and set flags 3: Do (P86) 1: 1 Call Subroutine 1 4: Do (P86) ; assert flag#8 low (not measuring) 1: 28 Set Flag 8 Low 5: Timer (P26) 1: 0 Reset Timer 6: Z=F (P30) 1: 0.0 F 2: 00 Exponent of 10 3: 114 Z Loc [ hrs_count ] ; ========================================= ; ========================================= ; SET MEASUREMENT CYCLE TIME ( in *HOURS* ) ; 336 = 14 days; 672 = 28 days ; ; During each measurement cycle, each ECI-1 Instrument ; on the SDI-12 bus is instructed to measure 5 parameters ; and return its results ; ; NOTE: MINIMUM time is established as number ; of ECI's x 16 minutes each, rounded UP to ; next whole hour. Violating this requirement will ; cause the program to return erroneous results ; ; EXAMPLE: 3 ECI's x 17 = 51 minutes; so ; shortest measurement cycle = 1 hour. ; ;Please note: Although this program will allow a cycle time as frequently as ;once per hour live electrochemical measurements in concrete ;should be performed no more frequently than once every two weeks. ;Performing measurements more frequently will give erroneous results ;and cause premature corrosion of the ECI-1 working electrode. ; ; ; ========================================= 7: Z=F (P30) ; set default wake up period 1: 336 F ; This is the constant you change to modify the cycle time (whole hours) 2: 00 Exponent of 10 3: 112 Z Loc [ cycle_tim ] @@1 ; ========================================= ; ========================================= ; Setting flag 2 high will cause a test to start ; immediately on power up ; ========================================= 8: Do (P86) 1: 12 Set Flag 2 High 9: End (P95) ;======================================================================== ; System timers (minutes & hours) ;======================================================================== ; update minutes & hours 10: Timer (P26) 1: 108 Loc [ cur_time ] ; if a minute has gone by 11: If (X<=>F) (P89) 1: 108 X Loc [ cur_time ] 2: 3 >= 3: 60 F 4: 30 Then Do 12: Timer (P26) 1: 0000 Reset Timer 13: Z=F (P30) 1: 0.0 F 2: 00 Exponent of 10 3: 108 Z Loc [ cur_time ] 14: Do (P86) ; everything in sub #4 happens once a minute! 1: 4 Call Subroutine 4 15: End (P95) ;======================================================================== ; Main cycle time counter ;======================================================================== ; Is it time to start testing? ; flag 2 is low on power up, so we start testing to see if time begin. ; flag 2 set high when time to start a test cycle ; 16: If Flag/Port (P91) ; 1: 22 Do if Flag 2 is Low 2: 30 Then Do 17: If (X<=>Y) (P88) 1: 114 X Loc [ hrs_count ] @@2 2: 4 < 3: 112 Y Loc [ cycle_tim ] @@3 4: 30 Then Do 18: Do (P86) ; bail out 1: 0 Go to end of Program Table 19: Else (P94) 20: Do (P86) ; dont check main cycle timer if running 1: 12 Set Flag 2 High 21: Z=F (P30) ; reset counter and drop thru to code 1: 0.0 F 2: 00 Exponent of 10 3: 114 Z Loc [ hrs_count ] 22: Z=F (P30) ; reset cts for next iteration 1: 0.0 F 2: 00 Exponent of 10 3: 117 Z Loc [ meas_cts ] ; sniff port 1 for ECI units and RE-set flags for next cycle 23: Do (P86) 1: 1 Call Subroutine 1 24: End (P95) 25: End (P95) ;======================================================================== ; ; check measurement flag (FLAG #8) ; if set, we are measuring, so see if time is up yet. If not, ; bail out and test nothing further! ; ;======================================================================== ; 26: If Flag/Port (P91) 1: 18 Do if Flag 8 is High 2: 30 Then Do 27: If (X<=>F) (P89) ; compare current time to cycle time 1: 117 X Loc [ meas_cts ] 2: 3 >= 3: 17 F ; ECI measurement time in minutes. 4: 30 Then Do ; 28: Do (P86) 1: 28 Set Flag 8 Low 29: Else (P94) 30: Do (P86) 1: 0 Go to end of Program Table ; bail out 31: End (P95) 32: End (P95) ;======================================================================== ; ; cycle thru all enabled channels (using numbering of 1 - 10 instead of ; 0-9 for easier programming! ; see flow chart in app note for details. ; NOTE: Program only gets here if FLAG#8 is NOT set! (NOT measuring!) ; ;======================================================================== ; *************** CHANNEL 1 **************** ; 33: If (X<=>F) (P89) ; if channel's flag is set (enabled) 1: 10 X Loc [ flagch_1 ] 2: 1 = 3: 1 F ; true = 1 (false is -99999) 4: 30 Then Do ; send P105 command to start a test 34: SDI-12 Recorder (P105) 1: 0 SDI-12 Address 2: 0 -- Start Measurement (aM0!) 3: 1 Port 4: 25 Loc [ ch1data_1 ] 5: 1.0 Mult 6: 0.0 Offset 35: If (X<=>F) (P89) ; if this is FIRST loop thru... 1: 8 X Loc [ two_loops ] 2: 1 = 3: 0 F 4: 30 Then Do 36: Do (P86) 1: 18 Set Flag 8 High 37: Z=F (P30) ; set flag, so we execute the ELSE code next loop 1: 1 F 2: 00 Exponent of 10 3: 8 Z Loc [ two_loops ] 38: Else (P94) ; 2nd loop thru, just to execute the P105 above to collect data ; clear channel flag so we don't get in here again 39: Z=F (P30) ; channel flag = 0 1: 0.0 F 2: 00 Exponent of 10 3: 10 Z Loc [ flagch_1 ] 40: Z=F (P30) ; clear flag for next channel 1: 0 F 2: 00 Exponent of 10 3: 8 Z Loc [ two_loops ] 41: Z=F (P30) ; reset cts for next iteration 1: 0.0 F 2: 00 Exponent of 10 3: 117 Z Loc [ meas_cts ] 42: End (P95) 43: Do (P86) ; bail out to end of table (not execute any more code!) 1: 0 Go to end of Program Table 44: End (P95) ; *************** CHANNEL 2 **************** ; 45: If (X<=>F) (P89) ; if channel's flag is set (enabled) 1: 11 X Loc [ flagch_2 ] 2: 1 = 3: 1 F ; true = 1 (false is -99999) 4: 30 Then Do ; send P105 command to start a "CONCURRENT" test 46: SDI-12 Recorder (P105) 1: 1 SDI-12 Address 2: 0 -- Start Measurement (aM0!) 3: 1 Port 4: 30 Loc [ ch2data_1 ] 5: 1.0 Mult 6: 0.0 Offset 47: If (X<=>F) (P89) ; if this is FIRST loop thru... 1: 8 X Loc [ two_loops ] 2: 1 = 3: 0 F 4: 30 Then Do 48: Do (P86) 1: 18 Set Flag 8 High 49: Z=F (P30) ; set flag, so we execute the ELSE code next loop 1: 1 F 2: 00 Exponent of 10 3: 8 Z Loc [ two_loops ] 50: Else (P94) ; 2nd loop thru, just to execute the P105 above to collect data ; clear channel flag so we don't get in here again 51: Z=F (P30) ; channel flag = 0 1: 0.0 F 2: 00 Exponent of 10 3: 11 Z Loc [ flagch_2 ] 52: Z=F (P30) ; clear flag for next channel 1: 0 F 2: 00 Exponent of 10 3: 8 Z Loc [ two_loops ] 53: Z=F (P30) ; reset cts for next iteration 1: 0.0 F 2: 00 Exponent of 10 3: 117 Z Loc [ meas_cts ] 54: End (P95) 55: Do (P86) ; bail out to end of table (not execute any more code!) 1: 0 Go to end of Program Table 56: End (P95) ; *************** CHANNEL 3 **************** ; 57: If (X<=>F) (P89) ; if channel's flag is set (enabled) 1: 12 X Loc [ flagch_3 ] 2: 1 = 3: 1 F ; true = 1 (false is -99999) 4: 30 Then Do ; send P105 command to start a "CONCURRENT" test 58: SDI-12 Recorder (P105) 1: 2 SDI-12 Address 2: 0 -- Start Measurement (aM0!) 3: 1 Port 4: 35 Loc [ ch3data_1 ] 5: 1.0 Mult 6: 0.0 Offset 59: If (X<=>F) (P89) ; if this is FIRST loop thru... 1: 8 X Loc [ two_loops ] 2: 1 = 3: 0 F 4: 30 Then Do 60: Do (P86) 1: 18 Set Flag 8 High 61: Z=F (P30) ; set flag, so we execute the ELSE code next loop 1: 1 F 2: 00 Exponent of 10 3: 8 Z Loc [ two_loops ] 62: Else (P94) ; 2nd loop thru, just to execute the P105 above to collect data ; clear channel flag so we don't get in here again 63: Z=F (P30) ; channel flag = 0 1: 0.0 F 2: 00 Exponent of 10 3: 12 Z Loc [ flagch_3 ] 64: Z=F (P30) ; clear flag for next channel 1: 0 F 2: 00 Exponent of 10 3: 8 Z Loc [ two_loops ] 65: Z=F (P30) ; reset cts for next iteration 1: 0.0 F 2: 00 Exponent of 10 3: 117 Z Loc [ meas_cts ] 66: End (P95) 67: Do (P86) ; bail out to end of table (not execute any more code!) 1: 0 Go to end of Program Table 68: End (P95) ; *************** CHANNEL 4 **************** ; 69: If (X<=>F) (P89) ; if channel's flag is set (enabled) 1: 13 X Loc [ flagch_4 ] 2: 1 = 3: 1 F ; true = 1 (false is -99999) 4: 30 Then Do ; send P105 command to start a "CONCURRENT" test 70: SDI-12 Recorder (P105) 1: 3 SDI-12 Address 2: 0 -- Start Measurement (aM0!) 3: 1 Port 4: 40 Loc [ ch4data_1 ] 5: 1.0 Mult 6: 0.0 Offset 71: If (X<=>F) (P89) ; if this is FIRST loop thru... 1: 8 X Loc [ two_loops ] 2: 1 = 3: 0 F 4: 30 Then Do 72: Do (P86) 1: 18 Set Flag 8 High 73: Z=F (P30) ; set flag, so we execute the ELSE code next loop 1: 1 F 2: 00 Exponent of 10 3: 8 Z Loc [ two_loops ] 74: Else (P94) ; 2nd loop thru, just to execute the P105 above to collect data ; clear channel flag so we don't get in here again 75: Z=F (P30) ; channel flag = 0 1: 0.0 F 2: 00 Exponent of 10 3: 13 Z Loc [ flagch_4 ] 76: Z=F (P30) ; clear flag for next channel 1: 0 F 2: 00 Exponent of 10 3: 8 Z Loc [ two_loops ] 77: Z=F (P30) ; reset cts for next iteration 1: 0.0 F 2: 00 Exponent of 10 3: 117 Z Loc [ meas_cts ] 78: End (P95) 79: Do (P86) ; bail out to end of table (not execute any more code!) 1: 0 Go to end of Program Table 80: End (P95) ; *************** CHANNEL 5 **************** ; 81: If (X<=>F) (P89) ; if channel's flag is set (enabled) 1: 14 X Loc [ flagch_5 ] 2: 1 = 3: 1 F ; true = 1 (false is -99999) 4: 30 Then Do ; send P105 command to start a "CONCURRENT" test 82: SDI-12 Recorder (P105) 1: 4 SDI-12 Address 2: 0 -- Start Measurement (aM0!) 3: 1 Port 4: 45 Loc [ ch5data_1 ] 5: 1.0 Mult 6: 0.0 Offset 83: If (X<=>F) (P89) ; if this is FIRST loop thru... 1: 8 X Loc [ two_loops ] 2: 1 = 3: 0 F 4: 30 Then Do 84: Do (P86) 1: 18 Set Flag 8 High 85: Z=F (P30) ; set flag, so we execute the ELSE code next loop 1: 1 F 2: 00 Exponent of 10 3: 8 Z Loc [ two_loops ] 86: Else (P94) ; 2nd loop thru, just to execute the P105 above to collect data ; clear channel flag so we don't get in here again 87: Z=F (P30) ; channel flag = 0 1: 0.0 F 2: 00 Exponent of 10 3: 14 Z Loc [ flagch_5 ] 88: Z=F (P30) ; clear flag for next channel 1: 0 F 2: 00 Exponent of 10 3: 8 Z Loc [ two_loops ] 89: Z=F (P30) ; reset cts for next iteration 1: 0.0 F 2: 00 Exponent of 10 3: 117 Z Loc [ meas_cts ] 90: End (P95) 91: Do (P86) ; bail out to end of table (not execute any more code!) 1: 0 Go to end of Program Table 92: End (P95) ; *************** CHANNEL 6 **************** ; 93: If (X<=>F) (P89) ; if channel's flag is set (enabled) 1: 15 X Loc [ flagch_6 ] 2: 1 = 3: 1 F ; true = 1 (false is -99999) 4: 30 Then Do ; send P105 command to start a "CONCURRENT" test 94: SDI-12 Recorder (P105) 1: 5 SDI-12 Address 2: 0 -- Start Measurement (aM0!) 3: 1 Port 4: 50 Loc [ ch6data_1 ] 5: 1.0 Mult 6: 0.0 Offset 95: If (X<=>F) (P89) ; if this is FIRST loop thru... 1: 8 X Loc [ two_loops ] 2: 1 = 3: 0 F 4: 30 Then Do 96: Do (P86) 1: 18 Set Flag 8 High 97: Z=F (P30) ; set flag, so we execute the ELSE code next loop 1: 1 F 2: 00 Exponent of 10 3: 8 Z Loc [ two_loops ] 98: Else (P94) ; 2nd loop thru, just to execute the P105 above to collect data ; clear channel flag so we don't get in here again 99: Z=F (P30) ; channel flag = 0 1: 0.0 F 2: 00 Exponent of 10 3: 15 Z Loc [ flagch_6 ] 100: Z=F (P30) ; clear flag for next channel 1: 0 F 2: 00 Exponent of 10 3: 8 Z Loc [ two_loops ] 101: Z=F (P30) ; reset cts for next iteration 1: 0.0 F 2: 00 Exponent of 10 3: 117 Z Loc [ meas_cts ] 102: End (P95) 103: Do (P86) ; bail out to end of table (not execute any more code!) 1: 0 Go to end of Program Table 104: End (P95) ; *************** CHANNEL 7 **************** ; 105: If (X<=>F) (P89) ; if channel's flag is set (enabled) 1: 16 X Loc [ flagch_7 ] 2: 1 = 3: 1 F ; true = 1 (false is -99999) 4: 30 Then Do ; send P105 command to start a "CONCURRENT" test 106: SDI-12 Recorder (P105) 1: 6 SDI-12 Address 2: 0 -- Start Measurement (aM0!) 3: 1 Port 4: 55 Loc [ ch7data_1 ] 5: 1.0 Mult 6: 0.0 Offset 107: If (X<=>F) (P89) ; if this is FIRST loop thru... 1: 8 X Loc [ two_loops ] 2: 1 = 3: 0 F 4: 30 Then Do 108: Do (P86) 1: 18 Set Flag 8 High 109: Z=F (P30) ; set flag, so we execute the ELSE code next loop 1: 1 F 2: 00 Exponent of 10 3: 8 Z Loc [ two_loops ] 110: Else (P94) ; 2nd loop thru, just to execute the P105 above to collect data ; clear channel flag so we don't get in here again 111: Z=F (P30) ; channel flag = 0 1: 0.0 F 2: 00 Exponent of 10 3: 16 Z Loc [ flagch_7 ] 112: Z=F (P30) ; clear flag for next channel 1: 0 F 2: 00 Exponent of 10 3: 8 Z Loc [ two_loops ] 113: Z=F (P30) ; reset cts for next iteration 1: 0.0 F 2: 00 Exponent of 10 3: 117 Z Loc [ meas_cts ] 114: End (P95) 115: Do (P86) ; bail out to end of table (not execute any more code!) 1: 0 Go to end of Program Table 116: End (P95) ; *************** CHANNEL 8 **************** ; 117: If (X<=>F) (P89) ; if channel's flag is set (enabled) 1: 17 X Loc [ flagch_8 ] 2: 1 = 3: 1 F ; true = 1 (false is -99999) 4: 30 Then Do ; send P105 command to start a "CONCURRENT" test 118: SDI-12 Recorder (P105) 1: 7 SDI-12 Address 2: 0 -- Start Measurement (aM0!) 3: 1 Port 4: 60 Loc [ ch8data_1 ] 5: 1.0 Mult 6: 0.0 Offset 119: If (X<=>F) (P89) ; if this is FIRST loop thru... 1: 8 X Loc [ two_loops ] 2: 1 = 3: 0 F 4: 30 Then Do 120: Do (P86) 1: 18 Set Flag 8 High 121: Z=F (P30) ; set flag, so we execute the ELSE code next loop 1: 1 F 2: 00 Exponent of 10 3: 8 Z Loc [ two_loops ] 122: Else (P94) ; 2nd loop thru, just to execute the P105 above to collect data ; clear channel flag so we don't get in here again 123: Z=F (P30) ; channel flag = 0 1: 0.0 F 2: 00 Exponent of 10 3: 17 Z Loc [ flagch_8 ] 124: Z=F (P30) ; clear flag for next channel 1: 0 F 2: 00 Exponent of 10 3: 8 Z Loc [ two_loops ] 125: Z=F (P30) ; reset cts for next iteration 1: 0.0 F 2: 00 Exponent of 10 3: 117 Z Loc [ meas_cts ] 126: End (P95) 127: Do (P86) ; bail out to end of table (not execute any more code!) 1: 0 Go to end of Program Table 128: End (P95) ; *************** CHANNEL 9 **************** ; 129: If (X<=>F) (P89) ; if channel's flag is set (enabled) 1: 18 X Loc [ flagch_9 ] 2: 1 = 3: 1 F ; true = 1 (false is -99999) 4: 30 Then Do ; send P105 command to start a "CONCURRENT" test 130: SDI-12 Recorder (P105) 1: 8 SDI-12 Address 2: 0 -- Start Measurement (aM0!) 3: 1 Port 4: 65 Loc [ ch9data_1 ] 5: 1.0 Mult 6: 0.0 Offset 131: If (X<=>F) (P89) ; if this is FIRST loop thru... 1: 8 X Loc [ two_loops ] 2: 1 = 3: 0 F 4: 30 Then Do 132: Do (P86) 1: 18 Set Flag 8 High 133: Z=F (P30) ; set flag, so we execute the ELSE code next loop 1: 1 F 2: 00 Exponent of 10 3: 8 Z Loc [ two_loops ] 134: Else (P94) ; 2nd loop thru, just to execute the P105 above to collect data ; clear channel flag so we don't get in here again 135: Z=F (P30) ; channel flag = 0 1: 0.0 F 2: 00 Exponent of 10 3: 18 Z Loc [ flagch_9 ] 136: Z=F (P30) ; clear flag for next channel 1: 0 F 2: 00 Exponent of 10 3: 8 Z Loc [ two_loops ] 137: Z=F (P30) ; reset cts for next iteration 1: 0.0 F 2: 00 Exponent of 10 3: 117 Z Loc [ meas_cts ] 138: End (P95) 139: Do (P86) ; bail out to end of table (not execute any more code!) 1: 0 Go to end of Program Table 140: End (P95) ; *************** CHANNEL 10 **************** ; 141: If (X<=>F) (P89) ; if channel's flag is set (enabled) 1: 19 X Loc [ flagch_10 ] 2: 1 = 3: 1 F ; true = 1 (false is -99999) 4: 30 Then Do ; send P105 command to start a "CONCURRENT" test 142: SDI-12 Recorder (P105) 1: 9 SDI-12 Address 2: 0 -- Start Measurement (aM0!) 3: 1 Port 4: 70 Loc [ ch10dat_1 ] 5: 1.0 Mult 6: 0.0 Offset 143: If (X<=>F) (P89) ; if this is FIRST loop thru... 1: 8 X Loc [ two_loops ] 2: 1 = 3: 0 F 4: 30 Then Do 144: Do (P86) 1: 18 Set Flag 8 High 145: Z=F (P30) ; set flag, so we execute the ELSE code next loop 1: 1 F 2: 00 Exponent of 10 3: 8 Z Loc [ two_loops ] 146: Else (P94) ; 2nd loop thru, just to execute the P105 above to collect data ; clear channel flag so we don't get in here again 147: Z=F (P30) ; channel flag = 0 1: 0.0 F 2: 00 Exponent of 10 3: 19 Z Loc [ flagch_10 ] 148: Z=F (P30) ; clear flag for next channel 1: 0 F 2: 00 Exponent of 10 3: 8 Z Loc [ two_loops ] 149: Z=F (P30) ; reset cts for next iteration 1: 0.0 F 2: 00 Exponent of 10 3: 117 Z Loc [ meas_cts ] 150: End (P95) 151: Do (P86) ; bail out to end of table (not execute any more code!) 1: 0 Go to end of Program Table 152: End (P95) ;========================== SAVE DATA ================================= ; we get here only after all channels are tested! ; toggle a flag so we only write once! ;======================================================================== 153: Do (P86) ; call write to storage routine 1: 3 Call Subroutine 3 ;========================== THE FINAL ROUTINES ========================== ; we get here only after all channels are tested! ;======================================================================== 154: Do (P86) ; start main cycle timer again for next cycle 1: 22 Set Flag 2 Low 155: Z=F (P30) ; reset counter for insurance, so cycle timer starts fresh 1: 0.0 F 2: 00 Exponent of 10 3: 114 Z Loc [ hrs_count ] 156: Z=F (P30) ; clear flag for next cycle 1: 0 F 2: 00 Exponent of 10 3: 8 Z Loc [ two_loops ] ;======================================================================== ;======================================================================== ; FINISHED WITH THIS CYCLE... ;======================================================================== ;======================================================================== ;========================= TABLE 2 ====================================== ; ; Set up table 2's execution interval ; Table 2 not used in this example ; ;======================================================================== *Table 2 Program 02: 0.0000 Execution Interval (seconds) ;======================================================================== ;========================= TABLE 3 SUBROUTINES ========================== ;======================================================================== *Table 3 Subroutines ; ========================== PORT SNIFFER ============= 1: Beginning of Subroutine (P85) 1: 1 Subroutine 1 ; Check to see what is attached to port using UNUSED measurement ; command. SDI-12 spec says if no measurement exists for a specified ; number, to return a packet (basically an ACK). This returned packet ; doesn't change any input locations, so we can't test if anything was returned. ; HOWEVER, the CR510 puts "-99999" in the 1st input location of addresses ; that TIMED OUT. Now we know what devices are NOT present, which is ; fine! ; ; So -99999 = NOT PRESENT; 1 = PRESENT ; ;================ CHANNEL 0 ===================== 2: SDI-12 Recorder (P105) 1: 0 SDI-12 Address 2: 9 Start Measurement (aM9!) 3: 1 Port 4: 10 Loc [ flagch_1 ] ; 5: 1.0 Mult 6: 0.0 Offset ;================ CHANNEL 1 ===================== 3: SDI-12 Recorder (P105) 1: 1 SDI-12 Address 2: 9 Start Measurement (aM9!) 3: 1 Port 4: 11 Loc [ flagch_2 ] 5: 1.0 Mult 6: 0.0 Offset ;================ CHANNEL 2 ===================== 4: SDI-12 Recorder (P105) 1: 2 SDI-12 Address 2: 9 Start Measurement (aM9!) ; 3: 1 Port 4: 12 Loc [ flagch_3 ] 5: 1.0 Mult 6: 0.0 Offset ;================ CHANNEL 3 ===================== 5: SDI-12 Recorder (P105) 1: 3 SDI-12 Address 2: 9 Start Measurement (aM9!) ; 3: 1 Port 4: 13 Loc [ flagch_4 ] 5: 1.0 Mult 6: 0.0 Offset ;================ CHANNEL 4 ===================== 6: SDI-12 Recorder (P105) 1: 4 SDI-12 Address 2: 9 Start Measurement (aM9!) ; 3: 1 Port 4: 14 Loc [ flagch_5 ] 5: 1.0 Mult 6: 0.0 Offset ;================ CHANNEL 5 ===================== 7: SDI-12 Recorder (P105) 1: 5 SDI-12 Address 2: 9 Start Measurement (aM9!) ; 3: 1 Port 4: 15 Loc [ flagch_6 ] 5: 1.0 Mult 6: 0.0 Offset ;================ CHANNEL 6 ===================== 8: SDI-12 Recorder (P105) 1: 6 SDI-12 Address 2: 9 Start Measurement (aM9!) ; 3: 1 Port 4: 16 Loc [ flagch_7 ] 5: 1.0 Mult 6: 0.0 Offset ;================ CHANNEL 7 ===================== 9: SDI-12 Recorder (P105) 1: 7 SDI-12 Address 2: 9 Start Measurement (aM9!) ; 3: 1 Port 4: 17 Loc [ flagch_8 ] 5: 1.0 Mult 6: 0.0 Offset ;================ CHANNEL 8 ===================== 10: SDI-12 Recorder (P105) 1: 8 SDI-12 Address 2: 9 Start Measurement (aM9!) ; 3: 1 Port 4: 18 Loc [ flagch_9 ] 5: 1.0 Mult 6: 0.0 Offset ;================ CHANNEL 9 ===================== 11: SDI-12 Recorder (P105) 1: 9 SDI-12 Address 2: 9 Start Measurement (aM9!) ; 3: 1 Port 4: 19 Loc [ flagch_10 ] 5: 1.0 Mult 6: 0.0 Offset ; ;================ CHANGE FLAGS TO '1' ===================== 12: Beginning of Loop (P87) 1: 0000 Delay 2: 10 Loop Count 13: Step Loop Index (P90) 1: 1 Step 14: If (X<=>F) (P89) 1: 10 -- X Loc [ flagch_1 ] ; 2: 1 = 3: 0 F 4: 30 Then Do 15: Z=F (P30) 1: 1 F 2: 00 Exponent of 10 3: 10 -- Z Loc [ flagch_1 ] 16: End (P95) 17: End (P95) 18: End (P95) ; =============== WRITE TO STORAGE ROUTINES ================== 19: Beginning of Subroutine (P85) 1: 3 Subroutine 3 20: Do (P86) ; just a signal to watch 1: 13 Set Flag 3 High ; ********* get the common stuff ***************** ; 21: Read ID (P117) ; grab datalogger ID 1: 6 Loc [ logger_ID ] 22: Batt Voltage (P10) 1: 110 Loc [ BATTERY ] 23: Internal Temperature (P17) 1: 4 Loc [ DL_TEMP ] ;*********************************************************************** ; AT THIS TIME YOU HAVE ALL DATA! Everything from this point down ; you can format as you wish. Array ID = 1 to represent PORT 1 ;*********************************************************************** ; ************ set up array ID pointer *************** 24: Do (P86) 1: 10 Set Output Flag High (Flag 0) ; assign specific memory locations for each channel! 25: Set Active Storage Area (P80) ; 1: 1 Final Storage Area 1 2: 1 Array ID 26: Sample (P70) 1: 1 Reps 2: 6 Loc [ logger_ID ] 27: Resolution (P78) ;selects High Resolution for the output to final storage 1: 1 High Resolution 28: Real Time (P77) 1: 1110 Year,Day,Hour/Minute (midnight = 0000) 29: Sample (P70) 1: 1 Reps 2: 110 Loc [ BATTERY ] 30: Sample (P70) 1: 1 Reps 2: 4 Loc [ DL_TEMP ] ; ; *********** These data are common to ALL writes... ************** ; 31: Resolution (P78) ;selects High Resolution for the output to final storage 1: 1 High Resolution 32: Sample (P70) ;writes the 5 measurements to final storage 1: 5 Reps 2: 25 Loc [ ch1data_1 ] 33: Sample (P70) ;writes the 5 measurements to final storage 1: 5 Reps 2: 30 Loc [ ch2data_1 ] 34: Sample (P70) ;writes the 5 measurements to final storage 1: 5 Reps 2: 35 Loc [ ch3data_1 ] 35: Sample (P70) ;writes the 5 measurements to final storage 1: 5 Reps 2: 40 Loc [ ch4data_1 ] 36: Sample (P70) ;writes the 5 measurements to final storage 1: 5 Reps 2: 45 Loc [ ch5data_1 ] 37: Sample (P70) ;writes the 5 measurements to final storage 1: 5 Reps 2: 50 Loc [ ch6data_1 ] 38: Sample (P70) ;writes the 5 measurements to final storage 1: 5 Reps 2: 55 Loc [ ch7data_1 ] 39: Sample (P70) ;writes the 5 measurements to final storage 1: 5 Reps 2: 60 Loc [ ch8data_1 ] 40: Sample (P70) ;writes the 5 measurements to final storage 1: 5 Reps 2: 65 Loc [ ch9data_1 ] 41: Sample (P70) ;writes the 5 measurements to final storage 1: 5 Reps 2: 70 Loc [ ch10dat_1 ] 42: End (P95) ;============================================================== ; =================== minute timer ========================= ;============================================================== ; Everything in here happens once per minute! 43: Beginning of Subroutine (P85) 1: 4 Subroutine 4 ; ===== WARNING! DO NOT REMOVE THIS CODE OR HOURS WILL BREAK! ======= 44: Z=Z+1 (P32) ; increment counter 1: 115 Z Loc [ minutes ] @@4 45: If (X<=>F) (P89) ; accumulat = 0 every 60 counts 1: 115 X Loc [ minutes ] 2: 3 >= 3: 60 F 4: 30 Then Do 46: Do (P86) ; everything in sub #5 happens once an hour! 1: 5 Call Subroutine 5 47: Z=F (P30) 1: 0.0 F 2: 00 Exponent of 10 3: 115 Z Loc [ minutes ] 48: End (P95) ;============================================================== ;========== YOUR MINUTES CODE GOES HERE ======================= ;============================================================== 49: Z=Z+1 (P32) ; increment counter used for measurement time 1: 117 Z Loc [ meas_cts ] @@6 ;============================================================== 50: End (P95) ; end sub #4 ;============================================================== ; =================== hour timer ========================= ;============================================================== ; Everything in here happens once per hour! 51: Beginning of Subroutine (P85) 1: 5 Subroutine 5 52: Z=Z+1 (P32) ; increment hours counter 1: 116 Z Loc [ hours ] ;============================================================== ; ========== YOUR HOURS CODE GOES HERE ===================== ;============================================================== 53: Z=Z+1 (P32) ; increment counter used to compare to cycle time 1: 114 Z Loc [ hrs_count ] @@5 ;============================================================== 54: End (P95) End Program -Input Locations- 1 RUN_ONCE 1 1 1 2 m_timer 1 0 0 3 flag_meas 1 0 0 4 DL_TEMP 1 1 1 5 curr_chan 1 0 0 6 logger_ID 1 1 1 7 ok_2_stor 1 0 0 8 two_loops 1 10 21 9 _________ 0 0 0 10 flagch_1 3 2 2 11 flagch_2 3 1 2 12 flagch_3 3 1 2 13 flagch_4 3 1 2 14 flagch_5 3 1 2 15 flagch_6 3 1 2 16 flagch_7 3 1 2 17 flagch_8 3 1 2 18 flagch_9 3 1 2 19 flagch_10 3 1 2 20 _________ 0 0 0 21 _________ 0 0 0 22 _________ 0 0 0 23 _________ 0 0 0 24 _________ 0 0 0 25 ch1data_1 3 1 1 26 ch1data_2 3 1 0 27 ch1data_3 3 1 0 28 ch1data_4 3 1 0 29 ch1data_5 3 1 0 30 ch2data_1 7 1 2 31 ch2data_2 11 1 0 32 ch2data_3 11 1 0 33 ch2data_4 11 1 0 34 ch2data_5 3 1 0 35 ch3data_1 3 1 1 36 ch3data_2 3 1 0 37 ch3data_3 3 1 0 38 ch3data_4 3 1 0 39 ch3data_5 3 1 0 40 ch4data_1 3 1 1 41 ch4data_2 11 1 0 42 ch4data_3 11 1 0 43 ch4data_4 11 1 0 44 ch4data_5 3 1 0 45 ch5data_1 3 1 1 46 ch5data_2 11 1 0 47 ch5data_3 11 1 0 48 ch5data_4 11 1 0 49 ch5data_5 3 1 0 50 ch6data_1 3 1 1 51 ch6data_2 11 1 0 52 ch6data_3 11 1 0 53 ch6data_4 11 1 0 54 ch6data_5 3 1 0 55 ch7data_1 3 1 1 56 ch7data_2 11 1 0 57 ch7data_3 11 1 0 58 ch7data_4 11 1 0 59 ch7data_5 3 1 0 60 ch8data_1 3 1 1 61 ch8data_2 11 1 0 62 ch8data_3 11 1 0 63 ch8data_4 11 1 0 64 ch8data_5 3 1 0 65 ch9data_1 3 1 1 66 ch9data_2 11 1 0 67 ch9data_3 11 1 0 68 ch9data_4 11 1 0 69 ch9data_5 3 1 0 70 ch10dat_1 3 1 1 71 ch10dat_2 11 1 0 72 ch10dat_3 11 1 0 73 ch10dat_4 11 1 0 74 ch10dat_5 3 1 0 75 _________ 6 0 0 76 _________ 10 0 0 77 _________ 10 0 0 78 _________ 10 0 0 79 _________ 18 0 0 80 _________ 6 0 0 81 _________ 0 0 0 82 _________ 0 0 0 83 _________ 0 0 0 84 _________ 0 0 0 85 _________ 0 0 0 86 _________ 0 0 0 87 _________ 0 0 0 88 _________ 0 0 0 89 _________ 0 0 0 90 _________ 0 0 0 91 _________ 0 0 0 92 _________ 0 0 0 93 _________ 0 0 0 94 _________ 0 0 0 95 _________ 0 0 0 96 _________ 0 0 0 97 _________ 0 0 0 98 _________ 0 0 0 99 _________ 0 0 0 100 _________ 0 0 0 101 _________ 0 0 0 102 _________ 0 0 0 103 _________ 0 0 0 104 _________ 0 0 0 105 _________ 0 0 0 106 _________ 0 0 0 107 cycle_cts 1 0 0 108 cur_time 1 1 2 109 accumulat 1 0 0 110 BATTERY 1 1 1 111 one 1 0 0 112 cycle_tim 1 1 1 113 wake_timr 1 0 0 114 hrs_count 1 1 4 115 minutes 1 1 2 116 hours 1 0 1 117 meas_cts 1 1 12 -Program Security- 0000 0000 0000 -Mode 4- 0 1 2 3 4 5 6 -Final Storage Area 2- 0 -CR10X ID- 100 -CR10X Power Up- 0