Introduction

Contacts can be placed in any free cell except cells directly on the right power rail.

If a contact is placed in a cell that was previously occupied by a Boolean link or a label, the cell contents are replaced by the new contact.

If a contact is placed in a cell that is already occupied by another contact or coil, a confirmation message is returned to replace the cell contents by the new contact.

If a contact is placed in a cell that is already occupied by another object and can not be replaced (e.g. FFBs), an error message is returned.

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

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

The following are permitted as actual parameters for contacts:

  • Boolean variables

  • Boolean literals (0, 1, FALSE, TRUE)

  • Boolean addresses (topological addresses or symbolic addresses)

  • ST expressions that return a Boolean result (e.g. VarA > VarB)

    ST expressions as formal parameters on contacts are an extension of IEC 61131-3 and must be explicitly enabled via the Tools > Project Settings dialog box, in the Program > Languages > Common tab by selecting the Usage of ST expressions (LD/FBD) checkbox.

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 contacts:

Placing contacts:

Step

Action

1

Select the desired contact.

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 selected contact is inserted.

3

To place further contacts of the same type:

  • 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.

Assigning actual parameters

Assigning actual parameters:

Step

Action

1

Open the properties dialog box for the contact.

Result: The contacts properties dialog box is opened.

Example:

2

You have the following options to enter the actual parameters:

  • You can now enter the actual parameter and confirm using Enter.

  • You can select the actual parameter from the list of recently used names using the symbol and confirm using Enter.

    or

  • Using the button ... you can open an Instance selection dialog box and confirm the selected variables there with OK.

Example of a variable selection dialog box:

3

Confirm the selected variable with OK.

Result:

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

  • If the variable 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 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 enabled in the section. A syntax and semantics check is performed immediately after the statement is entered.

Example:

Usage of ST expressions

To enter ST expressions for contacts the same rules apply as for entering ST expressions for FFB pins.