# How to detect PLC failure

**URL:** <https://forum.inductiveautomation.com/t/how-to-detect-plc-failure/25631>\
**Category:** Ignition\
**Created:** [June 7, 2019, 10:55am UTC](https://forum.inductiveautomation.com/t/how-to-detect-plc-failure/25631 "2019-06-07T10:55:23Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![Anwesha\_Gupta](https://avatars.discourse-cdn.com/v4/letter/a/53a042/32.png) [@Anwesha\_Gupta](https://forum.inductiveautomation.com/u/Anwesha_Gupta)\
**Post date:** [June 20, 2019, 2:15pm UTC](https://forum.inductiveautomation.com/t/how-to-detect-plc-failure/25631/7 "2019-06-20T14:15:30Z")

</div>

Hi All,

Thanks for the reply.  
I am using a bit of code in PLC to go 1,0 every sec when the PLC is healthy.

 ![PLC_HeartBeat%20logic](https://us1.discourse-cdn.com/inductiveautomation/original/2X/7/7676b044c54b1e76f41693cf0910bd969c117ad4.png).

Then I am using an expression tag with the following expression -

> _if(hasChanged({[.]PLC\_Heartbeat}),1,0)_

This tag is set as an alarm to flag up when the heartbeat is not healthy and I have set it to a 'clock' scan class.

I have tested it and this seems to be working fine with following errors -

1. Any minor/major PLC faults.
2. PLC network/comms error.
3. Connecting/Disconnecting Device status in Ignition.

I guess its a round about way of getting it working. But seems to be giving me the result that I want. 🙂

Thank you all for help and direction.

---

_[View the full topic](https://forum.inductiveautomation.com/t/how-to-detect-plc-failure/25631)._
