Introduction

Operate blocks are only available in the LD programming language. They are used to execute an ST statement.

When the status of the left link is 1, the ST statement in the block is executed.

All ST statements are allowed except the control statements:

  • (RETURN,

  • JUMP,

  • IF,

  • CASE,

  • FOR

  • etc.)

For operate blocks, the state of the left link is passed to the right link (regardless of the result of the ST statement).

Operate blocks can be placed in any free cell.

A operate block requires 1 line and 4 columns.

If an operate block is placed in a cell that is occupied by a Boolean link, and the following cells are either empty or also occupied by Boolean links, then these cells will be occupied by the placed operate block.

If an operate block is placed in a cell, and this cell or the following 3 cells are already occupied by another object, an error message is returned.

NOTE: The above behavior maybe different when Insert Mode is activated.

A placed operate block automatically creates a connection with its neighboring objects on the left if they are of the BOOL data type and there are no free cells between them.

Activating operate block placement mode

You have the following options to activate the operate block placement mode:

  • Use the Objects > Operate Block menu command.

  • Use the Edit > New > Operate Block menu command.

  • Use the Common Objects > Operate Block menu command from the shortcut menu.

  • Press the key combination Alt+F7.

    or

  • Choose the symbol.

The active operate block placement mode is indicated by the cursor symbol.

Note

In the Tools > Options dialog box on the Data and Languages > Languages tab, if the Automatically assign a variable to a new graphical object checkbox is selected, then the corresponding properties dialog box is automatically opened when an object is placed. The procedures explained here are used when the checkbox is cleared.

Placing an operate block

Placing an operate block:

Step

Action

1

Activate operate block placement mode.

2

Click the target cell in the LD section.

or

Use the arrow keys to move the gray field to the target position and press Enter.

Result: The operation block is placed.

3

Placing other operate blocks:

  • Click the target cell in the LD section.

    or

    Use the arrow keys to move the gray field to the target position and press Enter.

  • To return to selection mode:

    Press the Esc key.

  • To insert other objects:

    Select the object you wish to insert.

Defining the operation

Defining the operation:

Step

Action

1

Open the properties dialog box for the operate block.

Result: The operate block properties dialog box is opened.

2

Enter the desired ST statement in the text box.

Example:

3

Confirm the ST statement with OK.

Result:

  • If the selected variables are declared, they are enabled in the section. A syntax and semantics check is performed and the procedure ends here.

  • If the more than one of the selected variables are not declared, they are enabled in the section but not declared. A syntax and semantics check is performed. Declare them at this time, using the data editor.

  • If the one of the selected variables is not declared, a variable declaration dialog box opens. In this case, continue with the following steps of this procedure.

    Variable declaration dialog box

    Note: If you wish to declare the variable later, close the dialog box using the symbol. In this case, the variable name is enabled in the section, but not declared.

4

If you do not want to assign the variable an address or comment, confirm using Enter or the symbol.

Result:The variable is declared and the ST statement is enabled in the section. A syntax and semantics check is performed and the procedure ends here.

Example:

5

If you do want to assign the variable an address and/or comment, use the symbol for obtaining an advanced dialog and enter the address and/or comment.

6

Confirm with Enter or the symbol.

Result:The variable is declared and the ST statement is enabled in the section. A syntax and semantics check is performed.

Example: