# 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:** 7\
**Page:** 1

<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 7, 2019, 10:55am UTC](https://forum.inductiveautomation.com/t/how-to-detect-plc-failure/25631/1 "2019-06-07T10:55:23Z")

</div>

Hello All,

I was wondering if anyone has dealt with - Detecting PLC failures in Ignition?  
We have Allen Bradley devices connected to Ignition and I am able to get their Conception status in Ignition via - Is Connected Tag Under Diagnostics.

 ![DeviceConnectionStatus](https://us1.discourse-cdn.com/inductiveautomation/original/2X/2/2e1a2fb80092732d6e1513609ea6bc475a839385.png)

But this is really the connection status and not the PLC failure status.  
Any one dealt with this? Any suggestion?

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [June 7, 2019, 12:18pm UTC](https://forum.inductiveautomation.com/t/how-to-detect-plc-failure/25631/2 "2019-06-07T12:18:53Z")

</div>

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.

> [@Logix Device Status](http://forum.inductiveautomation.com/t/logix-device-status/24103/4):
>
> The CIP Spec has some generic definitions for the bits in that word in Volume 3, table 5A-2.3 and table 5A-2.4, and requires that the reserved/vendor bits there, if used, be declared in the device’s EDS file. Bit 0: "Owned". Not applicable to a processor, I would think. Bit 1: Reserved. Bit 2: "Configured". Probably always true except when at factory default. Bit 3: Reserved. Bits 4-7: 4-bit integer extended status code: 0: Self test/unknown 1: Firmware updating 2: Any Faulted I/O co…

---

<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 10, 2019, 8:08am UTC](https://forum.inductiveautomation.com/t/how-to-detect-plc-failure/25631/3 "2019-06-10T08:08:18Z")

</div>

Hi Jordan,

Yes, it is Rockwell PLC (L-72). I have taken off the PLC from Rack to simulate a ‘Non availability/Fault’. But the status of diagnostics -

1. **[Diagnostics]Device/Is\_Connected** tag - still remains 1.
2. **[Diagnostics]Device/Status tag**- always reads as 12640 even when the PLC is not online.

See screen shot -

Not sure how to get the Correct Status when it is faulted.

 ![Device%20Status%20when%20PLC%20is%20faulted](https://us1.discourse-cdn.com/inductiveautomation/original/2X/d/d3c741f6f8e32102553026921c20c20d92fa1308.png)

---

<div class="post-metadata">

**Author:** ![JordanCClark](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/jordancclark/32/83362_2.png) [@JordanCClark](https://forum.inductiveautomation.com/u/JordanCClark)\
**Post date:** [June 10, 2019, 11:49am UTC](https://forum.inductiveautomation.com/t/how-to-detect-plc-failure/25631/4 "2019-06-10T11:49:55Z")

</div>

Yeah, I see that. It would figure that Rockwell wouldn’t make it easy. 😏

You would need to use a fault handling routine in the PLC. [Shane Welcher has a video covering how to do this](https://www.youtube.com/watch?v=rQCHId7S-0g). He has a few stumbles as he goes through it, but in my opinion, it’s okay, because it shows some common issues that can happen while setting one up.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [June 10, 2019, 1:40pm UTC](https://forum.inductiveautomation.com/t/how-to-detect-plc-failure/25631/5 "2019-06-10T13:40:13Z")

</div>

A fault routine won’t really help here. I suspect the issue is the reliance of the driver on the first-hop ethernet encapsulation connection to yield the “IsConnected” status, which will improperly remain true when the backplane connection from the EN?T to the processor breaks. The “Status” won’t update when the connection is down, which I would call a bug.  
I understand that recent versions of the driver have enhanced the detection of connection problems, but I haven’t experimented with that or even noted what versions it applies to… @Kevin.Herron ?

The most reliable way to assess both processor and connection health is to subscribe to tags that are constantly changing due to ladder logic. If changes stop coming in, the connection is broken or the PLC isn’t in Run mode anymore. (I like reading an LINT containing the utc wallclock microsecond time obtained in ladder by a GSV.)

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [June 10, 2019, 3:12pm UTC](https://forum.inductiveautomation.com/t/how-to-detect-plc-failure/25631/6 "2019-06-10T15:12:43Z")

</div>

I did implement a new keep-alive and state machine for managing connection state but it’s just a ListIdentity to the first hop.

---

<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.
