Display of countdown time

Maurice,
I can probably work this out myself but I notice that you often have great suggestions for economical Control Basic routines…

I have a 60degC hot water recirculation (pipe-warming) pump I am planning to cycle on/off for periods of about 5mins/5mins. I had the clever idea I could increase the Off-time in proportion to outdoor temp (since heat losses will be lower). Maybe the off-time might increase from 5mins for 0deg ambient up to 10 mins for 30degC ambient. I can play with the proportionality.

I also had the idea the HMI could display the time remaining for the active part of the cycle so I can see whats happening..

My starting point has been a simple TIME-ON and TIME-OFF cycle. But I dont know of a way of monitoring those timers

I had thpught about setting up the on & off times to start with a preset value (adjusted by Temp) and then count down to zero, then switch over - maybe using two For-Next loops.

And then I thought, I bet Maurice will have a smarter idea. Any suggestions?

Well thanks for the nice remarks about the helpful suggestions. And yeah, you can modulate the PWM based on a PID is where I think you are headed.

I can recall a PWM example on this forum, will search it in a sec…
Found it.

I’d go deeper in this example when I have more time but here’s the general idea:

  1. Create the time-on and time-off variables so you can see the inner workings of the timers on your displays and such.

  2. Create a PID based on the hot water setpoint and the hot water temperature.

  3. Program the heater to be on according to the time-on and PID calculations.

  4. Debug the system and make sure it can maintain setpoint well.

  5. Finally, create the outdoor reset forumula to adjust the hot water setpoint based on the outdoor air, pretty sure there’s an example here on the forum.

Thanks. I don’t plan/need to make a “real” controller - just a primitive nudge-adjustment. I don’t have any process input measurement to control a PID.

Nevertheless, considering your item 1…

I have already defined variables (time range) as the preset times for the pump - eg VAR10 (= On-time) & VAR11 (= Off-time). I was thinking to dynamically vary VAR11 to get the rough result I want. Then use the classic on-off cycle…

40 IF TIME-ON (PUMP) > VAR10 THEN STOP PUMP
50 IF TIME-OFF (PUMP) > VAR11 THEN START PUMP

I dont understand how I can monitor the timer “count-down”. The time setting variables do not change as the timer runs. I “assumed” there is some other “counter/timer” running in the background somewhere - and that’s the one I want to monitor.

A related question: Some PLCs have internal “tick” timers running (eg 1ms, 1 sec, 1min) that can be used throughout a program for count-up or down timers.
Is there any equivalent function in T3000? - eg access the heartbeat??

This is not a super important feature of my program, so not worth a lot of effort. My starting point is just fixed on/off times

You mention: I “assumed” there is some other “counter/timer” running in the background somewhere - and that’s the one I want to monitor.

Indeed there is a background timer associated with the counter timer, you cannot see it but it can be used in your programs:

10 IF TIME-ON( OUT1 ) > 0:0:10 THEN STOP OUT1

With this program there is nowhere to see the current situation, the T3 controller knows and keeps track how long out1 has been on and will stop it after 10 seconds.

When I am working on a building I’ll create a variable to show the timeon situation, this variable can be placed on the graphical screens for debugging and just generally for good practice. Say you have a button in the room to turn the lights on for 10 minutes or so, you will definitely want to have a timer variable on your display to show the time remaining.

10 IF+ SWITCH1 THEN VAR1 = 0:10:00 <Reset the override timer
20 IF INTERVAL( 0:0:01) THEN VAR1 = VAR1 - 0:0:01 <decrement the override timer
30 IF VAR1 <= 0:0:01 THEN VAR1 = 0:0:0 < Stop the countdown when it hits zero
40 IF VAR1 > 0:0:0 AND NOT SCHEDULE THEN START LIGHT1 <if the timer is positive and the schdule is off then turn on the lights after hours.
50 …more logic

VAR1 shows how much time is left on the override timer and should be placed on your graghics so the user can see the timers. VAR1 should also be logged in the trend logs.