Introduction

In addition to inputs/outputs, some function blocks also provide public variables.

These variables transfer statistical values (values that are not influenced by the process) to the function block. They are used for setting parameters for the function block.

The assignment of values to public variables is made via their initial values or via the load and save instructions.

Public variables are read via the instance name of the function block and the names of the public variables.

Assigning Values using the Initial Value

Process the following steps to assign values using the initial value:

Step

Action

1

Call the function block for whose public variable you want to assign a value, see also Calling an FFB.

2

Open the data editor, see also Data Editor Access.

3

Select the Function Block tab.

Result:

The function block instances are displayed.

4

Expand the display of the public variables by clicking the respective + symbols.

Result:

You can now see all available public variables of the function block.

5

Enter the desired value for the public variable in the Value box.

Assigning Values using the Load and Save Instructions

Carry out the following steps to assign values using the load and save instructions:

Step

Action

1

Call the function block for whose public variable you want to assign a value, see also Calling an FFB.

2

Load the value to be assigned to the buffer.

For example:

LD 1

3

Save the buffer contents in a public variable, see also Using formal parameters.

For example:

ST D_ACT1.OP_CTRL

Reading public variables

See Using formal parameters