Continuous Pulse When Running - doesn't necessarily go low at end of program

I have a green stacklight that I would like to have flashing while the program is running, and a red stacklight that should come on when the program stops.
I’ve set the green light to “continuous pulse when running” and the red to “Hi when not running”
They work as expected, except at the end of the program the green light, instead of shutting off, will stay in whatever state it happened to be in when the program ended. Seems like it should shut off as soon as the program stops.

Am I missing something here or is this a bug?

The workaround seems to be to set it to “Low when not running”, then run a thread to flash the light.

I think that’s just how the feature works, though you’re right it doesn’t seem intuitive.

I always do as you describe yourself; run the lights control in a thread when the program is running, and then using the actions to turn off and on lights, when the program is off. :slight_smile:

Along those same lines, is there a status variable I can use to have my red stacklight flash when the robot is in some kind of error mode? My user would like the red light to be on solid when the system isn’t running (easy with “Hi when not running”), and flashing when there’s an error.
I can flash it when it’s program-defined errors (out of parts, too many out-of spec parts, etc), but is there some way to also make it flash when the robot has an error, such as a crash? Seems like even if there’s a status variable, the program would be in Pause mode, so I’d need to trigger some sort of external device to actually run the flashing light.

edit to add:
I thought when I wrote my original post that the red light at least was doing what I expected - turning on when the program stopped and turning off when it was running. Maybe I just didn’t see it at the time, but it’s now acting similar to the other - turns on when the program ends, but when I restart the program it stays on unless I specifically turn it off with a Set command.

There’s no way to use the lights when the program isn’t running sadly besides the IO actions. Maybe one could make a URCap, but I don’t have the knowledge to do this.

And you’re completely right. You’ll have to turn off the red light in your thread, as well. :slight_smile: