Introduction

You have the following options to open FFBs (Elementary Function, Elementary Function Block, Derived Function Block, Procedure):

  • You can enter the call like you enter any text (for syntax, see Calling FFB sections in the Reference manual),

  • you can use the function input assistants,

    or

  • you can enter the FFB to the section using the drag & drop method.

NOTE: Procedures are expansions to IEC 61131-3 and must be explicitly enabled via the Tools > Project Settings dialog box, in the Language extensions tab by activating the Allow procedures check box.

Calling a function block using the function input assistant

Process the following steps to call a function block (elementary or derived) with the function input assistant:

Step

Action

1

Place the cursor at the target position.

Note: No text may be selected in the section.

The following positions are possible:

  • On a free position outside of an existing FFB call.

  • On a space within an existing FFB call. (In this case, an FFB call is created within an FFB call.)

2

Open the function input assistant using:

  • the Edit > FFB Input Assistant... menu command..

  • The FFB Input Assistant...menu command from the shortcut menu (right-click) for the section.

  • Pressing the Ctrl+I key combination.

    or

  • Select the symbol.

Result:

The function input assistant will be opened.

3

In the FFB type line click the button ...., to open an FFB selection window.

Result:

The FFB selection dialog box is opened.

4

Select the library and family from the Libraries/Families column which contains the desired function block.

Tip: If you do not know where to find the FFB you are looking for select the Libset, entry to see a list of all the FFBs available independently of their libraries.

5

Select the desired function block from the Name column.

Example:

6

Confirm the selection with OK.

Result:

  • The function block is added to the function input assistant dialog box.

  • An instance name is automatically suggested. You can keep this or change it as you please.

  • You can see all available parameters of the function block, see also Information about programming.

7

The number of inputs can be increased with some elementary functions. (You find out which functions can be expanded by referring to the descriptions for the individual functions.)

Expandable pins can be recognized from the following display:

To add further pins select the last pin in the structure and press Add pin.

8

Double-click the Entry field cell of the first parameter and enter the name of the variable/address or an expression to be used.

You have the following options to enter the variable/address:

  • You can now enter the variable name and confirm using Enter.

  • You can select the variable/address from the list of recently used variables/addresses using the symbol.

    or

  • Using the button ... to open a variable selection dialog box.

Assign all parameters of the function block a variable/address in this way.

Example:

9

Confirm the entries using the OK button.

Result: The function block call is inserted into the IL section and a syntax and semantics check is performed.

Example:

Calling a function or procedure using the function input assistant

Calling a function or procedure using the function input assistant is identical in principle to calling a function block. The only difference is the absence of an instance name (step 6 of the procedure Calling a function block using the function input assistant).

Remarks

Some complex FFBs provide additional windows for entering parameters. Access to this window is gained using the Special Assistant button that appears at the bottom of the window.

Calling a function block instance using the function input assistant

Process the following steps to select a block instance that has already been declared:

Step

Action

1

Place the cursor at the target position.

2

Open the function input assistant using:

  • The Edit > FFB Input Assistant menu command.

  • The FFB Input Assistant...menu command from the shortcut menu (right-click) for the section.

  • Pressing the Ctrl+I key combination.

    or

  • Select the symbol.

Result:

The function input assistant will be opened.

3

In the Instance line click the button ...., to open an FFB selection window.

Result:

The dialog box for selecting function block instances is opened.

4

Select the desired block instance from the Name column and confirm the selection with OK .

Result:

5

Double-click the Entry field cell of the first parameter and enter the name of the variable/address to be used.

You have the following options to enter the variable/address:

  • You can now enter the variable name and confirm using Enter.

  • You can select the variable/address from the list of recently used variables/addresses using the symbol.

    or

  • Using the button ... to open a variable selection dialog box.

Assign all parameters of the function block a variable/address in this way.

Example:

6

Confirm the entries using the OK button.

Result: The function block call is inserted into the IL section and a syntax and semantics check is performed. If the variables are not declared yet a red wavy line under the name is used to identify them.

Example:

7

Declare all variables in the Data Editor or directly in the IL section.

Result: The red wavy line under the variable name disappears.

Changing the actual parameter using the function input assistant

Process the following steps to change actual parameters with the function input assistant:

Step

Action

1

Place the cursor inside a word for the FFB to be changed.

Note: No text may be selected and the FFB call to be changed must be syntactically correct.

2

Open the function input assistant using:

  • The Edit > FFB Input Assistant... menu command..

  • The FFB Input Assistant...menu command from the shortcut menu (right-click) for the section.

  • Pressing the Ctrl+I key combination.

    or

  • Select the symbol.

Result:

The function input assistant is opened with the current actual parameters.

3

Make the desired changes and confirm using OK.

Inserting FFBs via drag & drop

FFBs can also be inserted into the section via drag & drop using the Types Library Browser .

You have the following options to activate the Types Library Manager:

  • Use the Tools > Types Library Manager menu command.

    or

  • Pressing the Alt+3 key combination.