My coding at it's worst! I should clean this up a bit, but it runs... You have to use the internal COM port on the Sutron 8210 as your Radio/Modem port. Switch SW1 [next to the com port MUST be ALL OPEN SW3=O SW4=O]. Loop pins 1 to 4 [to activate the port] and pins 7 to 8 [RTS CTS]. A simple 3 wire RS-232 circuit [Txd RxD Gnd] to the Modem. DO NOT EXCEED 9600 Baud!!!!! [or you will get in 'trouble']. Not fancy - but works... 1 power 1:Open "COM:":settimeout 25:Control 11,9600:Control 1 2 GoSub 99 3 a=Measure(STAGE):b=Measure(RTU1):c=Measure(PMP1STAT):d=Measure(PHASE1):e=Measure(RTU2):f=Measure(PMP2STAT):g=Measure(PHASE2):h=Measure(ACPWR):i=Measure(PUMP1):j=Measure(PUMP2):For z=1 to 24:?:Next z 4 ? " ***Status of Remote Pump System ";w%2z;":";x%2z;":";y%2z;" ";v%2z;"-";u%2z;"-";t!4!0;"***" 5 ? " Lake Level = ";a!3!2;" Ft. ","Set Point Level = ";:k=0:If #StPt=0 Then ? "OFF ";:GoTo 10 6 If #StPt>8 Then k=#StPt-a:? #StPt!3!2;" Ft. ";:GoTo 10 7 If #StPt>0 Then n=o-Time:n=n/60:If n>0 Then ? n!3!1;" Minutes ";:GoTo 10 8 ? " TIMER MODE "; 10 ? "AC Status = ";:If h=1 Then ? "OK":GoTo 13 11 ? "BAD":? " ***WARNING*** Loss of AC Power - Safety Shutdown***":GoTo 83 13 If b=0 Then If c=1 Then ? " ***WARNING*** Pump#1 OFFLINE - Pump#1 Indicates ON***":GoTo 83 14 If e=0 Then If f=1 Then ? " ***WARNING*** Pump#2 OFFLINE - Pump#2 Indicates ON***":GoTo 83 17 ? " Pump#1 Phase Status = ";:If d=1 Then ? "GOOD";:GoTo 19 18 ? "BAD ":b=1:GoSub 88 19 ? " Pump#2 Phase Status = ";:If g=1 Then ? "GOOD":GoTo 21 20 ? "BAD ":e=1:GoSub 90 21 If c=i Then GoTo 23 22 ? " ***WARNING**** One of the Modules for Pump#1 are Bad.":? " Pump#1 Drive Module[0] does NOT Match Pump#1 Status Module[10] State.":b=1 23 If f=j Then GoTo 25 24 ? " ***WARNING**** One of the Modules for Pump#2 are Bad.":? " Pump#2 Drive Module[1] does NOT Match Pump#2 Status Module[13] State.":e=1 25 ? " Pump#1 Operational Status = ";:If b=0 Then ? "OFFLINE";:GoTo 27 26 ? "ONLINE "; 27 ? " Pump#1 Actual Status = POWERED ";:If c=1 Then ? "ON":GoTo 29 28 ? "OFF" 29 ? " Pump#2 Operational Status = ";:If e=0 Then ? "OFFLINE";:GoTo 31 30 ? "ONLINE "; 31 ? " Pump#2 Actual Status = POWERED ";:If f=1 Then ? "ON":GoTo 40 32 ? "OFF" 40 If #StPt=0 Then GoTo 70 41 If #StPt>8 Then GoTo 50 ' Lake level Controller 42 If #StPt>0 Then GoTo 60 ' Time Controller 43 ? " ***Set Point CORRUPTED - Resetting to ZERO***":#StPt=0:GoTo 70 50 If k>.1 Then If l=0 Then l=1:GoTo 96 ' turn on pumps for lake setpoint 51 n=Int(a*100):o=Int(#StPt*100):If n>=o Then If m=0 Then l=0:GoTo 97 ' turn off pumps - maintain setpoint 52 GoTo 70 60 If l=0 Then l=2:n=#StPt*3600:o=Time+n:GoTo 96 ' turn on pumps for time setpoint 61 n=Time:If n>o Then #StPt=0:l=0:GoTo 97 ' turn off pumps - kill setpoint 70 ?:?:? " Input Number Function for Remote Pump System" 71 ? " 1 = Change Set Point 4 = Shutdown SetPoint Controller" 72 ? " 2 = Pump#1 ON 5 = Pump#1 OFF" 73 ? " 3 = Pump#2 ON 6 = Pump#2 OFF":?:? "Num#> ";:z=0:z=Input 75 If z=33 Then GoTo 98 76 If z=49 Then ? "Enter 'xxx.xx' or '000.00' for Set Point OFF [Input will NOT Echo]":? "Num#> ";:#StPt=Input(6):?:? "Set Point Set to ";#StPt!3!2:l=0:o=0:GoTo 98 77 If z=50 Then GoSub 84:GoTo 98 78 If z=51 Then GoSub 86:GoTo 98 79 If z=52 Then ? " SET POINT SHUTDOWN SEQUENCE":? " Set Point Mode - OFF":#StPt=0:l=0:m=0:GoTo 97 80 If z=53 Then GoSub 88:GoTo 98 81 If z=54 Then GoSub 90:GoTo 98 82 GoTo 98 83 #StPt=0:l=0:m=0:b=1:e=1:GoSub 88:GoSub 90:? " ***EMERGENCY SHUTDOWN SEQUENCE COMPLETED - Pump[s] OFF***":GoTo 98 84 If b=1 Then pulse- 1,0:? " ***Pump#1 ON***" 85 Return 86 If e=1 Then pulse- 2,0:? " ***Pump#2 ON***" 87 Return 88 If b=1 Then pulse 1,0:? " ***Pump#1 OFF***" 89 Return 90 If e=1 Then pulse 2,0:? " ***Pump#2 OFF***" 91 Return 96 ? " ***Set Point Controller is Turning ON Enabled PUMP Motors***":m=0:GoSub 84:GoSub 86:GoTo 98 97 ? " ***Set Point Controller is Turning OFF Enabled PUMP Motors***":m=1:GoSub 88:GoSub 90 98 power 0:Close:Stop 99 z=Time mod 86400:w=Int(z/3600):x=Int(z mod 3600/60):y=Int(z mod 60):z=Date(Time):t=Int(z/10000):u=Int((z-t*10000)/100):v=z-(t*10000+u*100):Return 100 For z=1 to 8:pulse z,0:Next z:#StPt=0:l=0:m=0:GoTo 98 65101 GoTo 100 ' If Recording turned off -or- setup modified FORCE THE PUMPS OFF and KILL the Set Point Controller ----Delete ALL Information On this Line and below BEFORE Loading into 8210------------------------ 3FLLC Pump Control Program 4/3/02 3:35PM DWGunderson - Hoover Dam - Special Projects Office This program is designed to be Automatically executed every 30 seconds. Tiny BASIC will be Scheduled to run in the Measurement Setup Menu [see below]. The Internal com port is used to interface into a Freewave SS Radio/Modem running at 9600 Baud. In this application, the controlling PC is 10 miles away. The PC will be running PROCOMM or HyperTerm On it's local serial port. The RTU will output new information every 30 seconds to the PC. The Operator has 25 seconds to Input a Command to the RTU If needed. Control is Done in two different Modes. The determining factor is a valid level in #StPt. If #StPt = 0 Set Point is disabled and the Pumps can be run Manually. If there is a value in Set Point the value is compared to the number 8.0 . If the number is .gt. 0.0 and less than 8.001 the number is assumed to be the desired 'ON time' [in hours]. This enables the Set Point to be used in a dual role. Any number greater than 8.0 is assumed to be a lake level. Anything less than 8.0 is considered a Time. I used the 8.0hr maximum as a 'safety' - kind of a watering timer... This value can be modified to accomodate user requirements. If used as a Timer - Set Point will display the 'remaining time' for the pump[s] to be On. For Set point[s] above 8.00 we look at the literal value in Set Point as a level. If the Lake Level is below the Set Point level the Pumps are Queried For on-Line status. On-Line Pump[s] are Then turned On until Lake level matches Set Point level.A deadband of 0.10 foot is assumed. Pump Protection is also considered. Error conditions such as Loss of AC Power or Phase Errors will FORCE a Pump to be turned off at the RTU. ANY Set Point[s] that were enabled during this detected Error will be FORCED OFF as well. The interactive program will NOT Accept Input during any FATAL error[s]. Protection For Off-Line Pumps are also considered. If a Pump is found to be in the 'On' state and is off-Line at the same Time - the Pump will be FORCED OFF. The program will also test the integrity of it's Output Modules. If the Output Module state does NOT match the Input state - an ERROR Message is issued. The Program also tests for changes to the controller's SETUP or if Tiny BASIC is turned off [RECORDING OFF]. If this is the case - the Pumps are FORCED OFF and the Set Point Controller is Forced off. Every attempt has been made to make operation 'fool proof' as far as the Tiny BASIC Control is concerned. Rule of Thumb - If MAJOR Errors exist, the Pump[s] are FORCED off. Faulted conditions will Render an Error Message. Soft failures are permitted - until a Tech can be dispatched to Fix the problem. ----Variable Usage-------------------------------------------------------------------------------- a = lake STAGE Reading xxx.xx ft n = \ Set Point #StPt > 8.0 LAKE Set Point Level b = Pump 1 online Reading 1=ONLINE o = / variables #StPt < 8.0 TIMER Set Point Level c = Pump 1 ON Status 1=ON p = OPTO-22 Module Assy d = Pump 1 Phase Error 1=Err q = Slot Sensor Name e = Pump 2 online Reading 1=ONLINE r = 0 Out1 PUMP1 f = Pump 2 ON Status 1=ON s = 1 Out2 PUMP2 g = Pump 2 Phase Error 1=Err t = YYYY\ 9 Imp2 RTU1 h = ACPWR OK 1=OK u = MM \ Time 10 Imp3 PMP1STAT i = Pump 1 Output Module 1=ON v = DD > Variables 11 Imp4 PHASE1 j = Pump 2 Output Module 1=ON w = HH / 12 Imp5 RTU2 k = Set Point Target Err xx.xx ft x = MM / 13 Imp6 PMP2STAT l = Set Point Mtr ON Flag y = SS / 14 Imp7 PHASE2 m = Set Point Mtr OFF Flag z = Multiple use Variable 19 Imp12 ACPWR ----8210/8200 ASCII setup file-------------------------------------------------------------------- ; MAIN SETUP ; EEROM SETUP ; SENSOR SETUP - Analog1 ; SENSOR SETUP - Out1 Version=V40 TermMode=USER Sensor=Analog1 Sensor=Out1 UnitID=3FLLC UserRate=9600 SensorNo=1 SensorNo=48 Interval=00:15:00 RadioRate=9600 Name=STAGE Name=PUMP1 TimeBetween=00:00:10 ComRate=9600 EnableOn=Yes EnableOn=Yes SampleTime=00:14:51 DumpRate=9600 SampleOn=Yes SampleOn=No AverageTime=00:00:00 SDIRate=1200 LogOn=Yes LogOn=Yes ExcitationTime=00:00:00 EnterRequired=No AverageOn=No AverageOn=No Averages=10 DumpMode=ALL-BIN SensorInterval=00:00:00 SensorInterval=00:00:00 LoggingRate=1 UserTimeout=20060 Slope=2.8875 Slope=1.0 ExcitationMode=OFF ExtPwrDelay=1 Offset=203.233358259 Offset=0.0 Enabled=No AnalogDelay=5 DisplayOffset=0 DisplayOffset=0 BasicInterval=00:00:30 DruckDelay=5 RightDigits=2 RightDigits=0 BasicTime=00:00:00 BasicSize=4 --------------------------------------------------------------------------------------------------- ; SENSOR SETUP - Out2 ; SENSOR SETUP - Inp2 ; SENSOR SETUP - Inp3 ; SENSOR SETUP - Inp4 Sensor=Out2 Sensor=Inp2 Sensor=Inp3 Sensor=Inp4 SensorNo=49 SensorNo=57 SensorNo=58 SensorNo=59 Name=PUMP2 Name=RTU1 Name=PMP1STAT Name=PHASE1 EnableOn=Yes EnableOn=Yes EnableOn=Yes EnableOn=Yes SampleOn=No SampleOn=No SampleOn=No SampleOn=No LogOn=Yes LogOn=Yes LogOn=Yes LogOn=Yes AverageOn=No AverageOn=No AverageOn=No AverageOn=No SensorInterval=00:00:00 SensorInterval=00:00:00 SensorInterval=00:00:00 SensorInterval=00:00:00 Slope=1.0 Slope=1.0 Slope=1.0 Slope=1.0 Offset=0.0 Offset=0.0 Offset=0.0 Offset=0.0 DisplayOffset=0 DisplayOffset=0 DisplayOffset=0 DisplayOffset=0 RightDigits=0 RightDigits=0 RightDigits=0 RightDigits=0 ---------------------------------------------------------------------------------------------------- ; SENSOR SETUP - Inp5 ; SENSOR SETUP - Inp6 ; SENSOR SETUP - Inp7 ; SENSOR SETUP - Inp12 Sensor=Inp5 Sensor=Inp6 Sensor=Inp7 Sensor=Inp12 SensorNo=60 SensorNo=61 SensorNo=62 SensorNo=67 Name=RTU2 Name=PMP2STAT Name=PHASE2 Name=ACPWR EnableOn=Yes EnableOn=Yes EnableOn=Yes EnableOn=Yes SampleOn=No SampleOn=No SampleOn=No SampleOn=No LogOn=Yes LogOn=Yes LogOn=Yes LogOn=Yes AverageOn=No AverageOn=No AverageOn=No AverageOn=No SensorInterval=00:00:00 SensorInterval=00:00:00 SensorInterval=00:00:00 SensorInterval=00:00:00 Slope=1.0 Slope=1.0 Slope=1.0 Slope=1.0 Offset=0.0 Offset=0.0 Offset=0.0 Offset=0.0 DisplayOffset=0 DisplayOffset=0 DisplayOffset=0 DisplayOffset=0 RightDigits=0 RightDigits=0 RightDigits=0 RightDigits=0