Introduction

NOTE: The Program Unit data editor is a data editor limited to the scope of the Program Unit to which it belongs.

The Program Unit data editor offers the following features:

  • Declaration of variables associated to the Program Unit

  • Instance declaration of elementary and derived function blocks (EFBs/DFBs) used in the Program Unit

  • Management of the Program Unit parameters

The following functions are available in all tabs of the data editor:

  • Copy, Cut, Paste with the following restrictions:

    • Edit > Cut menu command is greyed in every tabs.

    • Right-click Cut on a variable is greyed in every tabs

    • Edit > Copy and Edit > Paste menu commands are not greyed but are not working in Interface tab.

    • Right-click Copy and right-click Paste on a variable are greyed in Interface, and Function Blocks tabs.

  • Expand/collapse structured data

  • Sorting according to Symbol, Type, etc.

  • Filter

  • Inserting, deleting and changing the position of columns

  • Drag and drop between the Program Unit data editor and the program editors

  • Undo the last change

  • Export/Import

Variables associated to a Program Unit can be:

  • Private: can only be R/W in the scope of this Program Unit.

  • Public: can be R/W out of the scope of this Program Unit.

  • Parameters (inputs, outputs, inputs/outputs): linked to Public variables (from an other Program Unit), or Global variables.

Interface Tab

The Interface tab is used to manage:

  • input, output and input/output parameters.

  • public variables

  • external variables

The following functions are available:

  • Assigning of an effective parameter (can be a Global variable or a Public variable from another Program Unit) to input, output and input/output parameters.

  • Assigning of an initial value

  • Defining a symbol for parameters and variables

  • Assigning data types

  • Displaying all properties of a variable in a separate properties dialog box

  • Entering a comment

Variables

The Variables tab is used for declaring variables used by the Program Unit:

The following functions are available:

  • Defining a symbol for variables

  • Assigning data types

  • Assigning variables to Program Unit parameters ( Effective Parameter)

  • Declaring the Nature of the variables.

  • Own selection dialog box for data types

  • Assignment of an initial value

  • Entering a comment

  • Displaying all properties of a variable in a separate properties dialog box

Function Blocks

The Function blocks tab is used for the instance declaration of elements and derived function blocks (EFBs/DFBs).

Tab Function blocks :

The following functions are available:

  • Displaying the function blocks used in the Program Unit

  • Defining symbol for the function blocks used in the Program Unit

  • Automatic enabling of the defined symbols in the Program Unit

  • Entering a comment for the function block

  • Displaying all parameters (inputs/outputs) of the function block

  • Assigning of initial values to the function block inputs/outputs

Program Unit Data Usage

Variables and instances created using the program data editor can be inserted (context dependent) in the programming editors using the Instance Selection dialog box.

NOTE: Variables and instances can also be created on the fly in the different language editors.

Online Modifications

It is possible to modify the type of a variable or a Function Block (FB) instance declared in application or in a Derived Function Block (DFB) directly in online mode. That means it is not required to stop the application to perform such a type modification.

These operations can be done either in the data editor or in the properties editor, in the same way as in offline mode.

When changing the type of a variable, the new value of the variable to be modified depends on its kind:

  • In the case of an unlocated variable, the variable is set to the initial value, if one exists. Otherwise, it is set to the default value.

  • In the case of a located variable, the variable restarts with the initial value if one exists. Otherwise, the current binary value is unchanged.

NOTE: When a reference (REF_TO) is used as Effective Parameter, if the effective parameter is deleted then the REF_TO value in Program Unit is updated to its initial value after controller INIT.

Restrictions About Online Modifications

In the following cases, the online type modification of a variable or of a Function Block (FB) is not allowed:

  • If the variable is used as network global data, the online type modification is not permitted.

  • Whether the current FB can not be removed online, or a new FB can not be added online, the online type modification of this FB is not allowed. Indeed, some Elementary Function Blocks (EFB) like the Standard Function Blocks (SFB) do not allow to be added or removed online. As a result, changing the type of an EFB instance to a SFB instance is not possible, and conversely.

In both of these cases, the following dialog box is displayed:

NOTE: Due to these limitations, if a Derived Function Block (DFB) contains at least one instance of a SFB, it is not be possible to add or remove instance of this DFB in online mode.