Hi,
getting started on my DIY home HVAC project, and trying to tie all my components together using a T3-TB, it’s only hooked to power and ethernet for now as I’m trying to figure out how best to use it.
Trying to run a simple program, but it is not behaving as expected, and I can’t find a way to debug it.
I’m wondering if there isn’t a couple of fundamentals I’m missing. (I do have a strong programming background, but much less hvac/electrical experience)
The test program I wrote was just to test boolean transitivity from input to variables, to outputs.
So let’s say I have HEAT_CALL an input, TVAR1 an intermediary (global) variable, and HEAT_LNK an output.
I want to have TVAR1 and HEAT_LNK to be true when HEAT_CALL is true, and false otherwise.
one way to achieve such a thing is to do something along the lines of:
20 IF HEAT_CAL THEN TVAR1 = 1 ELSE TVAR1 = 0
30 IF TVAR1 THEN HEAT_LNK = 1 ELSE HEAT_LNK = 0
or a shortened version:
20 TVAR1 = HEAT_CAL
30 HEAT_LNK = TVAR1
based on the led display of the device, and manually setting the input, the behaviour I’m expecting is to have the input light up at the same time as the output, but I’m getting the opposite…
1 - I initially thought this could come from the on/off vs off/on selection of units, as for custom units it seems that we can inverse the led display, but in my tests selecting on/off vs off/on for any combination of input/variable/outputs had no effect on the final bevahiour…
I’m starting to think this distinction might just apply at the electrical level (ie, open/close circuit for input or 0/13v output voltage), and that from a programming standpoint the boolean values are not inverted, and the led always will behave the same no matter the ordering, but would love to get a bit of clarification on it, as in that case the distinction doesn’t make sense to me for variables… Also I initially thoughts outputs were dry contacts I could directly use directly in a 24vac circuit, but looks like they actually provide either 0 or 13vdc ? what’s my best option to turn it into dry contacts? I could use an additional multi channel relay board, but if there is some sort of add on it would keep things more compact and tidy.
2 - Back to the initial “bug”: Digging a bit more into it for this post, the surprising boolean logic behaviour seems to come from some sort of caching issue for global variables: if I use a temporary variable instead of a global one, then the program works as expected. Is this a bug or an important distinction between local and global variables I need to understand?
Also, what’s the best way to “debug” variables? the state change doesn’t appear in the variable table as far as I can tell when a manual change is triggered. Would setting up graphics allow me to see those changes in close to real time ? (same question for outputs).
3- since I’m here, can I ask for more details on the WAIT instruction ? The doc mention that outputs are actually effective until the program exits it’s current iteration, but looking at the WAIT example in the doc, I assume that outputs are actually written to, and relay switched while the program is waiting… is that indeed the case? how does that affect the behaviour of variables ? is there any other instructions/commands that results in the outputs being flushed?
Thank you,
Chris