# MES/PLC Heartbeat Tags

**URL:** <https://forum.inductiveautomation.com/t/mes-plc-heartbeat-tags/71786>\
**Category:** Ignition\
**Created:** [March 29, 2023, 5:37pm UTC](https://forum.inductiveautomation.com/t/mes-plc-heartbeat-tags/71786 "2023-03-29T17:37:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tgjonaj](https://avatars.discourse-cdn.com/v4/letter/t/b2d939/32.png) [@tgjonaj](https://forum.inductiveautomation.com/u/tgjonaj)\
**Post date:** [March 29, 2023, 5:37pm UTC](https://forum.inductiveautomation.com/t/mes-plc-heartbeat-tags/71786/1 "2023-03-29T17:37:22Z")

</div>

Hello,

I have a production site that's mainly Beckhoff PLCs and one of the requirements they have is a heartbeat tag that both MES and the PLC will write to (PLC writes a 1, then I respond with a 0). However, every once in a while the heartbeat fails or times out, and causes the machine to fault. I never see any issues in the OPC server, and our data handshakes are always good. Attached is how I am writing back to this heartbeat tag, is there a better way to handle this? They have very limited OT support so checking the switches and network for issues has been a pain. I don't have this issue with the AB PLCs.

 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/b/7/b7b5bc44aacadaa3af2304bea9cc2cba842e6ef3.jpeg)

---

<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:** [March 29, 2023, 5:43pm UTC](https://forum.inductiveautomation.com/t/mes-plc-heartbeat-tags/71786/2 "2023-03-29T17:43:06Z")

</div>

> [@tgjonaj](#):
>
> both MES and the PLC will write to (PLC writes a 1, then I respond with a 0).

This is a very bad design. Writing tags from two directions almost always creates odd corner cases.

Push back on that specification. Suggest two heartbeat tags (short integers or timestamp integers). One incremented/updated by each side (with rollover) at a steady pace. Each side monitors the other for a stale value.

---

<div class="post-metadata">

**Author:** ![tgjonaj](https://avatars.discourse-cdn.com/v4/letter/t/b2d939/32.png) [@tgjonaj](https://forum.inductiveautomation.com/u/tgjonaj)\
**Post date:** [March 29, 2023, 6:39pm UTC](https://forum.inductiveautomation.com/t/mes-plc-heartbeat-tags/71786/3 "2023-03-29T18:39:52Z")

</div>

> [@pturmel](#):
>
> This is a very bad design. Writing tags from two directions almost always creates odd corner cases.
> 
> Push back on that specification. Suggest two heartbeat tags (short integers or timestamp integers). One incremented/updated by each side (with rollover) at a steady pace. Each side monitors the other for a stale value.

Thanks, I will see if they can change this on their end. Its a very simple logic change in the PLC, but because they are inetgrartors, I hope they don't push for a re-quote.
