Controlling 1 output from 2 programs

I am setting up a T10 for 3h/2c with humidity control. (No fan due to it running all the time, but I will have a fan proof to keep heating or cooling from running without proof)

The one I got I’ll need to add an RH sensor, but that’s ok, and irrelevant for this post.

I have the cooling/heating staging in mind. I’m running it all off one program (program 1), based on setpoint. If the space temp rises 1deg above or below setpoint, it will initiate whatever needs to run at the time.

This allows the rising/lowering of setpoint by end user via front buttons, but the basic staging stays the same and heats/cools depending on space need.

Now, I need humidity control. Which will be a 2nd program.

If my humidity setpoint is 55%RH, and the humidity rises above setpoint, I will activate 1 stage cooling to bring it down, regardless of program 1 status (no call/call for cool)

Now, here is the big question.

Consider the following:

SET is at 72degF
RHSET is at 55%RH

Current conditions:
Space Temp 72.2degF
Space RH 58.2%

Program 1:
Cool1 on at SET+1
Cool2 on at SET+2
ReclaimHeat on at SET-1
GasHeat1 on at SET-2
GasHeat2 on at SET-3

Program 1 is idle. (No call for cool or heat)
Program 2 brings on Cool1 due to high humidity.
Space temp drops to 70.4. Will Program 1 bring on ReclaimHeat?

Please disregard not having time delays or rounding stop short cycling. I got that. This is about the basic operation.

Just a possible method for you to try.
In the second program, command ‘ON’ a variable (set up as On/Off or ‘Off/On’). Then in the main program check the status of the variable and command the output based on the condition of the variable.

Also, in your main program, the last line of code that commands the output rules the day so structure your code so that the most important result of the output is placed in the last line that commands the output.

Prg 2 looks at RH% and if needed sets var RHCOOL to “on” if above and “off” if below setpoint.

Prg 1 has a “IF RHCOOL = ON OR SPACE > SET THEN START COOL1” for the first stage of cool.

If other parameters in Prg 1 align with set points, it will hear/cool accordingly.

Is that what you were pointing toward?

Yes, I think that you understand. If a line of code gets too complicated in decision making, keep in mind that you can break the code down into simpler lines using the built-in priority - the last line in the program that commands any type of point is in control of that point. This priority arrangement makes writing code much less complicated.

I would never command one point from two programs because it will complicate troubleshooting and you will probably find that your control problem was caused by the two programs commanding the same point.

That dual control issues is why I was asking. Thanks for the input.

I knew you were aware - I just know others may read this and not know.
You’re welcome.

Thanks for chiming in Bret, I definitely agree with you on keeping the logic in one program or you’ll have a heckuva time debugging the program later on.

Also agree with keeping the logic short, one concept per line. If there’s some complicated logic to be evaluated, say you want to take several parameters and timers into account in deciding if heating is allowed, do that in another section of the program and store the results in a VAR called HEATMODE. Then use HEATMODE in short one liners elsewhere in your program. You can also place HEATMODE on the displays, trend logs and so on for easy debugging.

1 Like