405-265-6072 info@plowtech.net

Blog

Blog

PLC Watchdog Timers for Reliable PLC to PLC Comms

In industrial automation, the seamless operation of machinery and processes often relies on the effective communication between Programmable Logic Controllers (PLCs). When these controllers fail to communicate, the results can be costly and dangerous. But what if they stop talking? This is where PLC watchdog timers come into play, acting as vigilant monitors that ensure ongoing communication and prompt detection of any disruptions. This article will show you two widely-used watchdog methods for PLC to PLC communication and understand how to implement them effectively, and more.

PLC Watchdog Diagram for Setting up a PLC to PLC Comms Monitor

The Timer and Flag (Heartbeat) Method

One of the simplest and most intuitive methods for monitoring PLC communication is the Timer and Flag method, often referred to as the “heartbeat” method. At the heart of this method is a straightforward concept: one PLC sends a regular signal (the heartbeat), and the other PLC checks to ensure it receives this signal within a specified time frame.

In this method, PLC A sets a timer for a specific interval, such as one second. When this timer expires, PLC A sets a heartbeat flag, which can be either an internal memory bit or a physical output. This flag indicates that PLC A is operational and communicating. The timer is then reset to start the next interval.

On the receiving end, PLC B has a timer set to a slightly longer duration than PLC A’s timer, for instance, 1.5 seconds, to account for potential network delays. PLC B continuously monitors the heartbeat flag sent from PLC A. If the flag is received before PLC B’s timer expires, the timer is reset, indicating successful communication. If the timer expires without receiving the heartbeat flag, PLC B triggers a communication error.

This method’s simplicity makes it accessible and easy to implement, requiring minimal additional logic. However, its reliability depends on the consistent transmission of the heartbeat signal. A missed heartbeat might not immediately indicate a communication failure, given the timing window on PLC B’s end.

The Data Consistency Check Method

For applications where data integrity is as crucial as maintaining communication, the Data Consistency Check method offers a more robust solution. This method goes beyond merely checking for an active connection; it verifies that the data being exchanged between the PLCs is accurate and consistent.

In this approach, each PLC uses a timer set to a specific interval, such as one second. When the timer expires, each PLC generates a unique data value, such as an incrementing counter. This data value is written to a designated data register accessible by both PLCs. After writing the data, the timer is reset for the next interval. Each PLC then reads the data value from the other PLC’s register. The received value is compared with the locally generated value. If the values do not match within a specified timeframe (slightly longer than the timer interval), a communication error is triggered.

The Data Consistency Check method ensures both communication and data integrity, making it more reliable for critical applications. However, it does require additional logic for generating and comparing data values, and it introduces a slight processing overhead compared to the heartbeat method.

Additional Considerations for Effective PLC Watchdog Implementation

While choosing between these methods, several additional factors should be considered to ensure optimal performance and reliability.

The timeout value for the receiving PLC’s timer (in the heartbeat method) or the comparison timeframe (in the data consistency method) must account for typical network delays and acceptable communication interruption times. Setting the timeout too low may lead to false positives due to temporary delays, while setting it too high might delay the detection of genuine communication loss.

When a communication error is detected, it’s important to have defined actions to address the issue. These actions might include stopping critical processes to prevent unexpected behavior, triggering alarms to notify operators of the issue, and initiating recovery procedures like re-establishing communication or switching to backup channels if available.

Implementation steps will vary based on specific PLC models and programming languages. Refer to your PLC’s documentation for relevant function blocks or instructions related to communication, timers, and data handling. Many PLCs offer built-in watchdog functionalities that can simplify the implementation process.

 

 

 

 

 

 

 

Author

Atlee Hickerson

Share

Get more great insights from the Plow team.

Subscribe to our newsletter

    Things to Consider When Developing a Well Written PLC Program

    By: Garrett King

    SERVICE

    Industrial Automation System Design

    In Conclusion

    By carefully choosing the appropriate PLC watchdog method and configuring it effectively, you can ensure reliable communication between your PLCs, thereby enhancing the robustness and reliability of your control system. This vigilance in maintaining communication integrity will lead to smoother operations and increased safety in your automated processes. Whether you opt for the simplicity of the Timer and Flag method or the robustness of the Data Consistency Check method, implementing a PLC watchdog timer is a crucial step in safeguarding your industrial automation systems.