probably more than you wanted to think about ...
I would like to know how to activate a bit every time there is a power outage and the PLC loses power
are you sure that you phrased that request correctly? ... maybe (just maybe) you meant to say this instead:
I would like to know how to activate a bit every time the power goes off – or even just "flickers" off - even if only for just a fraction of a second or so ...
here's the tricky part that many (most?) programmers don't consider in attacking the potential problems involved in a power "flicker" event ...
the ControlLogix system has a "hold up time" – which basically means that its chassis power supply will keep the processor scanning happily along for about a second or two even AFTER the 120VAC supply feeding the chassis power supply fails ... during that short (but important) period of time, the processor goes right on its merry way – doing its regularly assigned scan stuff ...
so ...
where this MIGHT become critically important is when the plant's power supply happens to drop out just for a fraction of a second or so (at least for anything LESS THAN the processor's "hold up" time) ... in that case, then the PLC processor does NOT see that particular event as a "power failure" ...
in simple terms, the processor might not even really "notice" that the plant's power service "flickered" off ...
in that sort of case, relying on some of the RSLogix/Studio 5000 built-in "start up" features might not provide quite the operation that you MIGHT be expecting ... the simple rung shown below might be more in line with what you need ...
just to nail down the idea I'm describing - in some "flicker" events, neither the First Scan bit - nor the Power-Up Handler - will come into play - since the ControlLogix processor never really "stops" - and so therefore it doesn't experience a "start up" event ... oops! ...
so ...
whatever scheme you finally come up with – I highly recommend that you test the results of its operation by trying several events where the power supply merely "flickers" – and doesn't really go "off" for several seconds or more ...
for some types of systems the unexpected response to a power "flicker" – as opposed to a power "failure" – can be quite surprising – and may fall squarely into the "bad" column of life's experiences ...
NOTE: if you're considering monitoring the voltage from a 24VDC power supply – instead of from a 120VAC supply line – then post again and mention that fact ... hint: the DC power supply invariably has capacitors to filter/smooth its output – and the effect of the capacitors can lead to more complexity than I've covered here ...
be safe ...
.