apostolakisl Posted January 2, 2011 Posted January 2, 2011 I have succesfully used "is not" lots of times in a "status" program but was just playing with it as a "control" program. The goal was to have a program run anytime a switch was touched in any way. Two lines I figured would do it. if switch xyz is switched on or if switch xyz is not switched on I have discovered the the "not switched on" doesn't seem to do anything. I figured it would trigger the program if you did anything to the switch, except turn it on. I further experimented by writing the line if switch xzy is not switched on all by itself. Nothing I did to that switch caused the program to run. So I don't quite understand what "is not switched" means to ISY in a control line.
IndyMike Posted January 2, 2011 Posted January 2, 2011 Hi Lou, I'm not sure why you would not see the program trigger. Is it possible that the program came up as disabled? I don't use this control that often. It's negative logic and tends to make my brain hurt. As I understand the command, it's intended to trigger execution of the "Else" statement. 1) if switch xyz is not switched on - The program will activate when the switch is turned on, but will execute the Else statement. Turning the switch off will have no effect. 2) if switch xyz is not switched on and switch xyz is switched off Program will execute the Then statement when the switch is turned off. Program will execute the Else statement when the switch is turned on. Rather than use the "negative" logic, I normally write two programs using the control functions "switched on" and "switched off". Not as eloquent, but it saves me from furrowing my brow down the road when I'm trying to remember what the heck a program is doing. Hope that helps, IM
apostolakisl Posted January 2, 2011 Author Posted January 2, 2011 Mike, The trouble with only addressing the "switched on", "switched off" states is it leaves behind all of the in between dimmed situations. What I was trying to accomplish here is have a program trigger and run the "then" clause whenever the switch was touched in any way. Furthermore, I didn't want the program to trigger in the event that the switched was turned on by another program or from a scene, so this eliminated using the "status" commands. I think your scenario 1 answers my question. I would expect scenario 1 to run the "then" clause if the switch is switched "off", since, the switch is being switched and it wasn't switched to "on" so to me this equals "true". But it appears that ISY logic first looks at the "switched on" part, then to the "is/is not" part of the clause. Assuming this is the case, it would seem that having "is not" available in programming a control command is kind of useless. Perhaps I can accoplish what I want with Is switched on or is switched off or is fade up or is fade down etc etc. Lou
IndyMike Posted January 2, 2011 Posted January 2, 2011 Lou, We're thinking along the same lines here. I interpret the "switched on" as the trigger. Anything else will not trigger the program. The "Is/Is not" is the execution control which calls either the "Then" or "Else" statement. I gave the "switched Fade up/down" a try. I'm way over my head with this sequence. The only way I could get things to make sense was to "group" the triggers with parenthesis. The following appears to execute the way that I would expect: Is "triggers" call the Then statement Is Not Triggers call the Else statment If ( Control 'Test / 0F.BF.A4.1' is not switched On Or Control 'Test / 0F.BF.A4.1' is switched Off ) And ( Control 'Test / 0F.BF.A4.1' is not switched Fade Up Or Control 'Test / 0F.BF.A4.1' is switched Fade Down ) Then Wait 2 seconds Send X10 'A1/Extended Code (9)' Else Wait 5 seconds Send X10 'A1/Extended Code (9)' I also tried the Dim/Bright trigger - no apparent effect on the program. Maybe this is for X10?
apostolakisl Posted January 3, 2011 Author Posted January 3, 2011 Mike, Thank you for helping me out with the logic. So it is, "Switched on" is the trigger and "is not" makes it false and runs the else. I am not sure how to use that logic right now, but perhaps it will find a place. It would obviously only be useful in a multi-line "if" section. A single parameter "if" statement would just use "is" and put the desired action in the "then" section. Lou
Recommended Posts