12-18-2014 06:33 AM
I have to simulate a central heating system. A heater is turned on, room temp rises to 'upper limit'; heater is turned off when upper limit is reached. When heater is off, temp drops until lower limit is reached then heater is turned on again. I'm scratching my head!! have tried various case structures but cant get it to run continually. Whats the best way to do this? PS, im a noob! 🙂
12-18-2014 06:39 AM
There are many ways you can control this. If you can attach the code that you have developed, we can help you sort this in the same way you are approaching with the logic.
12-18-2014 06:43 AM
thats my problem. I need help with the logic to approach the properly without over complicating it. Any advice?
12-18-2014 06:53 AM
Let me give you a simple logic.
12-18-2014 07:02 AM
I've never used the in range tool, thank you.
I also need help, say, input 'initial room temp' the increment or decrement to simulate the heaters being on or off. I tried a while loop with increment but it only adds 1, one time, even in a while loop. Ive connected an 'equal to' to stop but never gets that far. 😞
12-18-2014 07:19 AM - edited 12-18-2014 07:20 AM
Use a shift register to keep the current heater state (since you only want the state to change when you go outside of the limits). From there, the Select function helps keep things straight.
12-18-2014 07:22 AM
chilemad wrote:
I also need help, say, input 'initial room temp' the increment or decrement to simulate the heaters being on or off. I tried a while loop with increment but it only adds 1, one time, even in a while loop. Ive connected an 'equal to' to stop but never gets that far. 😞
You could use another shift register that holds how much your temperature should increment. So when the heater is ON, you set it to a positive number. When the heater is OFF, set it to a negative number. In a real system, the temperature is constantly changing.
12-18-2014 07:36 AM
i need to simulate temp rising and falling.
enter initial temp. if temp is below upper limit, heater comes on. when upper limit is reached, heater turns off but then I need temp to decrement until a 'lower limit' is reached. once lower limit is reached, 'heater comes on' then temp increments until it reached upper limit again.
my trouble started at the circuit using an initial fixed temp. my circuit incremented the initial temp, just once. I need my circuit to read the initial temp once then deal with the incremented value on the next loop. how can I get my program to read the initial temperature once?
12-18-2014 07:57 AM - edited 12-18-2014 07:57 AM
You should be using a shift register to hold your current temperature. You should just initialize that shift register before the loop.
12-18-2014 08:08 AM
my mind is blown! lol so feeding the temp into the register only takes the value into account once?