Jump to content
C4 Forums | Control4

How do I program a Stop command, to a program already running?


Recommended Posts

This is probably something simply, but not to sure how to go about setting it up.

I have a program setup called "School Days Wake-Up", that I can toggle off and on that runs Monday - Friday... Its set up to just ramp up (slowly) one of two lights over a 12 minute period starting at 6:40am.

I also have another program called "School Days Power Down", that works off the variable is if school days wake-up is running then it will run... That turn the same lights off at 7:50am.

These all have been working great for months now, but there are times when I want to stop the program when it running... Because now if I go ahead and turn the light off when the program is running, at the end of the program (12min later) the 1st/2nd Floor Sconces will turn back on from being off.

How can I setup a program (script) that will let me stop the School Days Wake-Up program at any point, and not letting it finish running the ramp up time like it's set to do?

Thanks,

David

Link to comment
Share on other sites


Because now if I go ahead and turn the light off when the program is running, at the end of the program (12min later) the 1st/2nd Floor Sconces will turn back on from being off.

Two ways come to mind:

1. If you simply want to avoid turning the light on if you've turned it off manually during the delay, then put the final statement inside an "If" that checks to see if the light level is greater than 0. Then if you've turned it off, it will stay off. If you want to be able to dim it and leave it at the dimmed level, use the "If" to check for some level other than the 50% which you set with the first two statements.

2. If you really want to stop that script (I don't think this is necessary, BTW), you will need something like a keybad button that can be used to set a "stop this script" variable. Then each of your statements needs to be preceded by an "If" that checks whether the "stop this script" variable is true and if so, then "Stop". Note that only simulates stopping the script -- it doesn't actually stop it during the delay period but the effect is the same.

Neither of those will work if you change the light level during any of the ramp periods.

Logically a "While" loop *should* allow immediate stopping and this is what you should use, but I think it's a dealer-only programming option, so I don't know anything about it. You'd still need something like the other variable to use to control the While loop.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...