PDA

View Full Version : Frozen program


KEB
11/03/2006, 10:36 PM
What will cause a program to stop running. I changed some lines of code for my heaters and chiller and updated the programs but the controled heaters remained in the off position even with the temp far below the call for heat temp. Only after placing the heaters in manual/On did the program start to function. I then placed them back in auto and they remained on, I then forced them off by turning the chiller on (If Timer COL = ON Then HET OFF) and the program worked. When they were not working the status box showed them off but the database events and reports graph showed then as ON.
any ideas?

Acroholic
11/04/2006, 06:04 AM
go ahead and post your heating/cooling program..this will help figure it out.....

KEB
11/04/2006, 07:27 AM
This is the program. it runs now, but it would not start by itself and remained off for several hours. updating the programs did not start it. The only thing I changed was adding the lines not allowing the heater/chiller to run when the other was on. I have a AC3 pro with 84 lines of code and 23 timers. This has me very worried, I have to know what went wrong so it cant happen again. The program ran OK all night.

KEB
11/04/2006, 07:29 AM
I forgot to paste the code above:

If Tmp > 78.1 Then COL ON
If Tmp > 84.0 Then COL OFF
If Tmp < 77.8 Then COL OFF
If Timer HET = ON Then COL OFF
If Timer HE2 = ON Then COL OFF
If Timer SK1 = OFF Then COL OFF
Max Change 010 M Then COL OFF
If Tmp < 74.8 Then HET ON
If Tmp > 75.0 Then HET OFF
If Tmp < 70.0 Then HET OFF
If Timer COL = ON Then HET OFF
If Tmp < 74.7 Then HE2 ON
If Tmp > 75.0 Then HE2 OFF
If Tmp < 70.0 Then HE2 OFF
If Timer COL = ON Then HE2 OFF

Acroholic
11/04/2006, 08:08 AM
whoa....thats a lot of code for heating/chilling....you could do with a lot less, looks to me you can accomplish the same thing with half the code.......gonna take a bit of time to figure out what you are trying to accomplish here....maybe someone else will chime in here in the meantime....

Acroholic
11/04/2006, 10:18 AM
<a href=showthread.php?s=&postid=8476978#post8476978 target=_blank>Originally posted</a> by KEB
If Tmp > 78.1 Then COL ON
If Tmp > 84.0 Then COL OFF
If Tmp < 77.8 Then COL OFF
If Timer HET = ON Then COL OFF
If Timer HE2 = ON Then COL OFF
If Timer SK1 = OFF Then COL OFF
Max Change 010 M Then COL OFF
If Tmp < 74.8 Then HET ON
If Tmp > 75.0 Then HET OFF
If Tmp < 70.0 Then HET OFF
If Timer COL = ON Then HET OFF
If Tmp < 74.7 Then HE2 ON
If Tmp > 75.0 Then HE2 OFF
If Tmp < 70.0 Then HE2 OFF
If Timer COL = ON Then HE2 OFF

This seems more reasonable to me....Keep it simple

If Tmp < 74.8 Then HET ON
If Tmp > 75.0 Then HET OFF
If Tmp < 74.7 Then HE2 ON
If Tmp > 75.0 Then HE2 OFF
If Tmp > 78.1 Then COL ON
If Tmp < 77.8 Then COL OFF
Max Change 010 M Then COL OFF

What is this SK1?
If Timer SK1 = OFF Then COL OFF

Keeping this sucker kinda cool, huh?
Maybe someone else will chime in also....

KEB
11/04/2006, 11:19 AM
SK1 is the skimer pump that also pumps tru the chiller. The other lines of code were for failsafe if temp sensor fails and to keep chiller/heaters off if the other is on. The tank is in basement where it is cool and heaters run constant if I try to run tank much warmer. I hope i am not running it too cool?
I still dont know why the program frooze up!! any ideas?

jdieck
11/04/2006, 12:59 PM
<a href=showthread.php?s=&postid=8476978#post8476978 target=_blank>Originally posted</a> by KEB
I forgot to paste the code above:

If Tmp > 78.1 Then COL ON
If Tmp > 84.0 Then COL OFF
If Tmp < 77.8 Then COL OFF
If Timer HET = ON Then COL OFF
If Timer HE2 = ON Then COL OFF
If Timer SK1 = OFF Then COL OFF
Max Change 010 M Then COL OFF
If Tmp < 74.8 Then HET ON
If Tmp > 75.0 Then HET OFF
If Tmp < 70.0 Then HET OFF
If Timer COL = ON Then HET OFF
If Tmp < 74.7 Then HE2 ON
If Tmp > 75.0 Then HE2 OFF
If Tmp < 70.0 Then HE2 OFF
If Timer COL = ON Then HE2 OFF

This is what I would do:
Simplify by removing the locks between HET and HE2 and COL, mostly not needed as the temperatures will not overlap
also by removing the over and under temperature shut offs, in other words the COL will be on as far as the temp will be higher and HET will be on as far as the temperature is lower.
I would also narrow the range of variation to increase stability and spearate a bit more the level at which HET and HE2 stat up for a smoother transition.

If Tmp < 77.5 Then HET ON
If Tmp > 78.0 Then HET OFF
If Tmp < 77.0 Then HE2 ON
If Tmp > 76.0 Then HE2 OFF
If Tmp > 79.0 Then COL ON
If Tmp < 78.5 Then COL OFF
If Timer SK1 = OFF Then COL OFF


As usually enough heat is provided by lighting and pumps the tank will most likely operate on the COL range during the day (if not all day) and on the HET range at night (on cold nights) and HE2 is just back up to HET and probably will rarely turn on.
This is will stay within 78.5 and 79.0 deg during day (if not all day)and between 77.5 and 78.0 deg on cold nights.

It will also turn off the chiller if the skimmer is turned off and turn it on if the COL conditions are true when the skimmer is on but with no delay. I think the delay may either turn it off after a while even if the skimmer is on and the COL conditions are true or may turn it on after a while even if the skimmer is off.

Usually the program freezes when the database is being accessed via aquanotes, I really do not know what causes this.

KEB
11/04/2006, 07:32 PM
The program froze up again. the heaters would not come on. I had to take the If timer ... lines of code out then it started working again.
Does any body know why this is happening?

jdieck
11/04/2006, 07:44 PM
Probably it is not recognizing the: "IF Timer SK1 then.. " instruction.
Try removing it and program the COL with the similar timer or conditions as the SK1

Example:
If you have a line to turn on the skimmer when feeding that say:
IF Feed Cycle then SK1 OFF

Add one that say:
IF Feed Cycle then COL OFF

If this fails try updating the firmware. I am sure Curt will chime in on Monday see what he recommends.

clp
11/04/2006, 11:00 PM
The problem is you have a circular loop. You've got 'If timer' statements in which COL depends on HET, and HET depends on COL. After a program modification all the timers start in the undefined state. They will remain in the undefined state until a program statement is true. The last statement (highest priority) for both COL and HET is a 'If Timer' type statement which depends on the other timer state. If the timer COL is unkown, then the 'If timer' makes it output timer also unknown. COL, HET, and HT2 will be unknown until you manual turn on or off the COL, HET or HT2. The solution is to rearrange the statements to:

If Tmp > 78.1 Then COL ON
If Timer HET = ON Then COL OFF
If Timer HE2 = ON Then COL OFF
If Tmp > 84.0 Then COL OFF
If Tmp < 77.8 Then COL OFF
If Timer SK1 = OFF Then COL OFF
Max Change 010 M Then COL OFF
If Tmp < 74.8 Then HET ON
If Timer COL = ON Then HET OFF
If Tmp > 75.0 Then HET OFF
If Tmp < 70.0 Then HET OFF
If Tmp < 74.7 Then HE2 ON
If Timer COL = ON Then HE2 OFF
If Tmp > 75.0 Then HE2 OFF
If Tmp < 70.0 Then HE2 OFF

BTW, those timer statements are actually redundant and not required as your temp on/off set points don't overlap. I'd just remove them as they just make the program more complex, and offer no benefit.

Curt

clsanchez77
11/04/2006, 11:09 PM
A few good suggestions and examples posted here, this is what I have:

If Tmp > RT + 1.0 Then CHL ON
If Tmp > RT + 1.5 Then MH1 OFF
Max Change 025 M Then MH1 OFF
If Tmp > RT + 1.5 Then MH2 OFF
Max Change 035 M Then MH2 OFF
If Tmp > RT + 2.0 Then VHO OFF
Max Change 015 M Then VHO OFF
If Tmp < RT - 1.0 Then CHL OFF
If Tmp < RT - 2.0 Then HTR ON
If Tmp > RT + 1.0 Then HTR OFF


Note the chiller and heater are in a sump with about 15 gallons of water, connected to a 90 gallon tank. While the program statements implies I allow for a 2 degree variation in cycles, this actually only keeps the chiller on for 15 minutes and off for 30 minutes and the display tank has nearly no variation in temperature.

MH1, MH2 and VHO are lights and the lights off set points allow for the chiller to 'catch up' in the event it falls behind (such as after a power outage). Max Change statements prevent lights from cycling on and off, the different max change times just prevent them from all turning on at the same time.

Chris

jdieck
11/04/2006, 11:10 PM
OMG Curt, you are working overtime!

KEB
11/05/2006, 08:50 AM
Thanks Curt, I guess I earned the dumb programer of the year award, designing a program into an endless loop!