Understanding Comparator Machines in PLC Ladder Logic

This article delves into the intricacies of implementing Comparator Machines within Programmable Logic Controllers (PLCs), specifically addressing challenges encountered in Schneider Electric’s Machine Expert HVAC software when using ladder logic. We aim to provide a comprehensive understanding and practical solutions for engineers and programmers in the field of industrial automation.

Originally, a user on the Schneider Electric community forum sought assistance in configuring a comparator instruction in parallel with a normally open contact in ladder logic. The user, new to Schneider PLCs and Machine Expert HVAC, faced difficulties in directly implementing this seemingly straightforward logic. This scenario highlights a common challenge when transitioning between different PLC programming environments and software tools.

The Initial Challenge: Parallel Comparator Implementation

The user’s initial goal was to create a ladder logic network where a “Greater Than” (GT) comparator operates in parallel with a standard normally open contact. The desired configuration, as visualized in their post, aimed to trigger an output if either the contact is closed OR the comparator condition is true.

Alt text: Ladder logic diagram illustrating the desired parallel configuration of a Greater Than comparator and a normally open contact in PLC programming.

However, directly dragging and dropping a comparator block from the ‘Operators and Blocks’ window in Machine Expert HVAC and attempting to place it in parallel proved unsuccessful. The software’s ladder editor appeared to restrict the direct creation of parallel branches around comparator instructions, leading to frustration and a search for alternative approaches.

Solutions and Workarounds for Comparator Logic in Ladder Editor

Experienced users in the forum community quickly responded with practical workarounds, acknowledging the limitations of the ladder editor in Machine Expert HVAC when it comes to complex parallel structures involving comparator machines. Here are the primary solutions proposed:

1. Network Separation: Structuring Logic Across Multiple Networks

The first suggested solution involves restructuring the ladder logic into two separate networks. This method breaks down the intended parallel logic into sequential steps, achieving the desired outcome without forcing a direct parallel connection within a single network.

Alt text: Ladder logic diagram showing a solution using two networks to implement parallel comparator and contact logic in Schneider Machine Expert HVAC.

In this approach, the first network evaluates the comparator machine (GT block). The second network then uses a standard OR logic, where one input is the output of the comparator network and the other input is the normally open contact. This effectively replicates the parallel behavior by sequentially processing the conditions and combining their results.

2. Expression and OR Block Combination: Utilizing Textual Expressions

A more compact alternative involves using an expression block in conjunction with an OR block. This method leverages the ability of Machine Expert HVAC to incorporate textual expressions within ladder logic, providing more flexibility in defining complex conditions.

Alt text: Ladder logic diagram demonstrating the use of an expression block and an OR block as an alternative to direct parallel comparator logic in PLC programming.

By embedding the comparator logic within an expression (e.g., using IEC 61131-3 ST syntax within the expression block) and then ORing the result with the contact input, programmers can achieve the parallel functionality while working within the structural constraints of the ladder editor.

Advanced Software Conversion and Editor Alternatives

Beyond these direct workarounds, the forum discussion touched upon broader strategies for managing PLC code and leveraging more powerful editing environments within the Schneider Electric ecosystem.

PLCopen XML for Code Migration

One advanced technique discussed was the use of PLCopen XML for importing and exporting PLC code. This standard format facilitates the exchange of program organization units (POUs), function blocks (FBs), and functions (FCs) between different software platforms.

Alt text: Screenshot showing the project table context menu in Machine Expert HVAC, highlighting the import function for PLC project files.

Alt text: Screenshot showing the import dialog in Machine Expert HVAC, with PLCopen XML (.xml) selected as the file format for importing PLC code.*

For users migrating projects from other Codesys-based software or even older Schneider platforms like SoMachine 4.3, PLCopen XML can be a valuable tool for transferring existing ladder logic and structured text code into Machine Expert HVAC.

Favoring Function Block Diagram (FBD) Editor

Finally, a seasoned expert recommended considering the Function Block Diagram (FBD) editor as a more powerful alternative to the Ladder Diagram (LD) editor within Machine Expert HVAC. FBD is often praised for its flexibility in handling complex logic and data flow, particularly when working with comparator machines and intricate control algorithms.

While ladder logic remains intuitive for basic sequential control, FBD can offer a more streamlined and efficient approach for advanced applications. For programmers comfortable with graphical programming paradigms, transitioning to FBD may unlock greater productivity and expressive power within the Machine Expert HVAC environment.

Conclusion: Adapting to Software Specifics in PLC Programming

In summary, while directly implementing a parallel comparator machine and contact in ladder logic within Machine Expert HVAC may present initial challenges, practical solutions exist. Network separation and expression/OR block combinations provide effective workarounds within the LD editor. Furthermore, exploring PLCopen XML for code migration and considering the FBD editor for enhanced flexibility represent broader strategies for optimizing PLC programming workflows in Schneider Electric’s automation ecosystem. Understanding these nuances and adapting programming approaches to software-specific constraints are crucial skills for any automation professional working with comparator machines and PLC systems.

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *