Jump to content

Guy Lavoie

Members
  • Posts

    711
  • Joined

  • Last visited

Everything posted by Guy Lavoie

  1. Thanks for the responses. Well I finally got around to writing a test program. It turns out that the status test is a bit of both: a test of static condition and also of a status change. I wrote a simple two line program that tests the status of two X10 addresses, with an AND statement, and increments a variable if both are On, like this: If A1 Status is On AND A2 Status is ON THEN variable1 =+1 The way it behaves is that if either device is on and I turn on the other one (changes from off to on), the variable increments. In that sense, the device that is already on is being tested for it's static condition only. But if both are on and the test would be strictly about the static condition, then the variable would be incrementing wildly and continuously as long as that's true. As I mentioned in my first post, the language seems to be designed with "idiot proofing" in mind, and more specifically, it's the status of the WHOLE program that needs to transition to true to trigger the THEN statement(s), and transition to false to trigger the ELSEs. It's the status TRANSITION of the WHOLE program that makes it single triggering. Now I also see how the current static condition of the whole program can also be tested in other programs, with the IF Program... statement. Now it's clear!
  2. Agreed. I'll post about any findings that don't appear to be clear.
  3. Ok, that's great if this is the case. It simply appears that the text in the cookbook is poorly written and seems to imply that a CHANGE in status is needed to have a status test true and trigger. Thanks!
  4. Thanks Techman. That's the way I see the meaning of "Status". It's just that it seems to be contrary to what the cookbook says: Unlike control, a "status" condition will trigger an evaluation only after a CHANGE in status According to that quote, if the door light was already on, then the IF statement will test false because no status change occurred. IF (false) AND (true) = false, and won't trigger... Unless "trigger an evaluation" actually means "trigger an action" if the whole logic test (IF/AND/OR...) is true. It just might be the wording. In my experience with Programmable Logic Controllers, logic tests are ALWAYS evaluated, and actions (THEN...) are only taken if the resulting test is true, and any ELSE if false.
  5. Thanks, but that doesn't answer my question... Let me rephrase it. Here is a quote from page 127 of the cookbook: 8.2.14 Using ‘If Control’ versus ‘If Status’ in Programs16 The reason to use control condition is that a control will trigger a program evaluation upon EACH receipt of the anticipated command. Unlike control, a "status" condition will trigger an evaluation only after a CHANGE in status. If a device status is off, and you turn it off again, the status has not changed and no program evaluation will take place. I understand that to mean that "control" will trigger the program every time the activating command is actually received, like getting a X10 "A/1 On" command pair, regardless of the fact that it might have been already turned on. "Status" means it triggers if the internal status table for that device changes from off to on because this is the first time a X10 "A/1 On" command pair is received since it was last turned off. But what if I only want to check if the status is currently on or off? Just the static condition of the internal status table (no received commands at this time)? In my example above I'd like to trigger if the status of the hall light goes from off to on (it's status changes) AND the door light is already on.
  6. One question comes to mind. The same options appear for a device status, whether it's a IF statement or AND statement. For example: IF Hall light Status is On AND Door light Status is On Knowing that the IF statement is actually looking for a status change, does this mean that the AND statement is also looking for a status change (and not just the current, static status)? This would be impossible to do because they cannot really change status simultaneously. Is there a way to check just the current status? A workaround would be to have a separate program look for the door light status change and set a variable value, then have the above code AND with the variable. That would be rather clumsy. Seems it would make more sense for IF statements to show "Status changes to" instead of just "Status", and let AND statements check current status. Maybe I'm just not seeing it correctly either... That's the kind of thing I'm trying to learn.
  7. Hi Paul. Oh yes, my days of participating and moderating the ADI forum will always remain as great memories, as the number of people I've exchanged with. My Ocelot is still running strong and isn't going anywhere, especially with the expansion modules. I sort of happened upon the ISY box my chance, and because it supports X10 too, I thought it was interesting and worthwhile to check out. It seems to be what a next generation Ocelot could have been. The used one I bought has the X10 and Networking modules in it, which perfectly fits the bill for me. It also has a "Open ADR" module, for which I can find configuration documentation, but nothing about what it actually does. The networking module is of interest to me, because I could integrate it to my current setup of the Ocelot and HA bridge, which provides Alexa functionality. I created my own HA bridge to X10 bridge program using VB and a CM11A, but maybe the ISY could now do that. What I'm doing at this time is simply familiarizing myself with the ISY programming model. Like the Ocelot, it's a PLC style language, using ladder logic (which is what drew me to the Ocelot in the first place). However it seems to be trying to look like a somewhat higher level language, breaking up the long loop into separate "programs", and from what I can see so far, tries to "idiot proof" the user by allowing only single triggering events for IF statements. If it was me, I'd replace "Is On" by "Turns On" to reflect triggering on the status change. Minor stuff really, and doesn't take anything away from the functionality, and that I'll quickly get used to. I've already solved the missing timers issue! So I'm looking forward to figuring out and trying things...and exchanging with other users!
  8. I just tested it, and works perfectly. I created a state variable called Timer1, and created a standalone program that tests if it's greater than zero (which will always test true as long as it isn't reset to 0), waits one second, and increments the variable by 1. I now have a timer and can be used in a composite conditional situation, such as if a trigger occurs, and another trigger occurs within a time interval. I've used this on the Ocelot for that double tap function I mentioned in my first post. Another use is for a bathroom fan timer. You might want to turn on a bathroom fan that will automatically turn off after so many minutes. Using "wait" confines you to a fixed value, while using a timer like this allows you to add time by retriggering the same or a different event. Here is the logic, in pseudo code: IF turn_on_bathroom_fan trigger AND Timer = 0 (if fan first turned on) THEN fan_ON action THEN fan_time = 600 (default of 600 seconds) THEN set Timer to 1 (start the timer) IF turn_on_bathroom_fan trigger AND Timer > 0 (if fan is already running) THEN fan_time = fan_time + 120 (add 120 seconds to run time) If Timer > fan_time THEN fan_OFF action (turn off the fan) THEN Timer = 0 (stop timer)
  9. Interesting, thanks for the pointers. I like to learn by writing and testing small examples. I do see a "wait" action. I suppose a timer could be implemented by setting a variable to a non-zero value, and have a separate program that as long as the variable is non-zero, waits one second (or whatever granularity you want) and increments the variable by one. I just might test that as one of my first experiments.
  10. Hello. I'm just getting started with a ISY994i and PLC that I bought used for almost nothing. I'm a long time ADI Ocelot user and some will recognize my name if you remember the ADI forum. I got the ISY994i because it was such a bargain, and thought it would be a fun thing to try out, and possibly add functionality to my Ocelot based X10 system. They might complement each other nicely since the ISY994i has networking features. Anyways, I'm just trying to get a sense of how the if/then programming works, compared to the Ocelot. In particular, how tests for single events vs static statuses works, and which ones it supports. The Ocelot is particularly versatile in that regard, and allowed triggering on raw X10, command pairs, status change, and existing status. For example: If X10 A/1 is received... (if raw X10 address or command is received) If X10 A/1 ON command pair (if a command pair is received) If X10 A/1 Turns ON (if the status for that X10 address changes from Off to On) If X10 A/1 Is ON (if the status is currently On, often used with AND statements) This is very versatile, but also allows for mistakes, such as if you use "Is ON" instead of "Turns ON" to then send other commands: it sends continuously because the test is that of a static condition. From the bit of exploration I've done with the ISY994i, a statement such as "If A/1 Status is ON", it actually means if the status "becomes" ON, not a static condition. I'm deducing thing from the fact that the programming allows a THEN statement to send commands, and also a ELSE statement to do that. Similarly, the ELSE statement seems to imply the opposite status of the same test becoming true (so it's not an ELSE IF, just ELSE). I also don't see any timers, or haven't found an equivalent yet. For example, with the Ocelot I could look for a X10 command pair, and start a timer (that increments every second). Then have another program section look for reception of that same command pair while the timer is running, and finally a third program section stop the timer if it reached a certain value, say 5 seconds. This allows me to look for the reception of a X10 command pair, and if I receive it again within the time interval (by double tapping a X10 transmitter), then trigger a second action. I use this to turn off all the kitchen lights if the switch is tapped twice. Can the ISY994i do this kind of thing? Thanks!
×
×
  • Create New...