How to detect PLC failure

You haven't mentioned PLC type, but your screen shot suggests Rockwell.

If so you may be able to leverage the [Diagnostics]Device/Status tag.