Jump to content
AT&T to end email-to-text ×

Guy Lavoie

Members
  • Posts

    615
  • Joined

  • Last visited

Everything posted by Guy Lavoie

  1. 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)
  2. 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.
  3. 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...