In Schneider PLC EcoStruxure Control Expert, in addition to the standard objects defined in the IEC 61131-3 standard, there are specialized blocks designed to execute Structured Text (ST) instructions and ST expressions in ladder lanaguage. These blocks provide PLC programmers with additional flexibility to perform complex operations efficiently. Unlike standard function blocks, these blocks are specifically tailored to handle ST expressions and simple compare operations, enhancing the overall programming capabilities within the LD (Ladder Diagram) environment.
These ST execution and compare blocks are primarily used in scenarios where quick evaluations or conditional operations are required. For example, they can be applied to monitor process variables, execute arithmetic or logical expressions, and trigger outputs based on specific conditions. They are particularly useful in industrial automation tasks such as motor control, temperature regulation, and process monitoring, where combining Ladder Logic with ST expressions ensures faster and more reliable decision-making.
Available exclusively in the Ladder Diagram programming language, these blocks allow seamless integration of ST expressions without converting the entire program to Structured Text. This makes them ideal for hybrid programming approaches, where the simplicity of LD can be combined with the power of ST for complex operations. PLC programmers can use these blocks to simplify program logic, reduce errors, and maintain a structured, easy-to-understand control program.
The OPER (Operate) block in Schneider PLC EcoStruxure Control Expert is used to execute Structured Text (ST) statements directly within a Ladder Diagram program. It allows you to run almost all ST instructions, making it easier to perform calculations, logical operations, or assign values to variables without converting the entire program to Structured Text.
While OPER blocks can handle most ST instructions, certain control instructions are not allowed. These include instructions like RETURN, JUMP, IF, CASE, FOR, and other similar control flow commands. This ensures that the block executes safely within the Ladder Diagram context.
In an OPER block, the state of the left link (input) is always passed to the right link (output), regardless of the result of the ST instruction inside the block. This behavior ensures smooth program flow and consistent execution of subsequent blocks.
Each OPER block can contain up to 4096 characters. If the content exceeds the display limit, only the beginning of the code sequence is shown, followed by suspension points (...). This allows large blocks of ST code to be included while keeping the program readable.
result := (12 + 345 + 44 - 553) / 22;
In this example, the OPER block performs a basic arithmetic operation. First, it adds 12, 345, and 44, then subtracts 553 from the sum. The result of this calculation is then divided by 22, and the final value is stored in the variable result. This demonstrates how simple mathematical expressions can be executed directly in an OPER block.
avg_temp := (temp_1 + temp_2 + temp_3) / 3;
This example shows how to calculate the average of three temperature sensor readings using an OPER block. The values temp_1, temp_2, and temp_3 are summed, and the total is divided by 3. The resulting average temperature is stored in the variable avg_temp. OPER blocks make such calculations simple without needing to switch to full Structured Text programs.
FillPercentage := (TankVolume / (TankHeight * TankArea)) * 100;
In this example, the OPER block calculates the fill percentage of a tank. The current volume of the tank, TankVolume, is divided by the maximum possible volume, calculated as TankHeight multiplied by TankArea. The result is then multiplied by 100 to get a percentage value, which is stored in FillPercentage. This is a practical use of OPER blocks for industrial automation applications.
The OPER block is used to execute a single Structured Text (ST) statement within a Ladder Diagram program. Each statement must end with a semicolon (;). This allows you to perform calculations, assign values, or evaluate expressions without converting the entire program to Structured Text.
Using OPER blocks in this way helps maintain clean program flow, ensures each statement executes reliably, and allows PLC programmers to integrate ST logic seamlessly into Ladder Diagram programs.