-

Variable/Port Properties

Variable properties can be edited...

Each variable property is represented by a table column. While editing a property, an automatic syntax check is performed. Detected errors are indicated by a red cell frame. Properties that cannot be set for a variable, are grayed out.

Port properties: For controllers of the PLCnext Technology generation, input and output ports can be used in addition to or instead of resource-global variables. Ports can be declared by setting 'Usage' to 'IN Port' or 'OUT Port'. Some of the properties listed in the table below are also or exclusively available for ports.

Further Info
Refer to the topic "Managing Declarations in Tables" for detailed information on editing the declaration tables.

In Data Lists, the columns containing the variable properties/process data item properties can be hidden in order to reduce the data displayed. Clicking the arrow right icon on the right in the 'Variable' / 'Process Datum' header shows the columns. Clicking the arrow left icon hides them.

The following list describes all variable properties. Depending on the selected table ('Variables' or 'Data' list) specific properties (columns) are not available.

Note
Both the variables tables and the Data Lists provide a context menu command for refactoring variables.

Note
In Data Lists and variables tables, the selection in drop-down lists is done with a single-click, not with a double-click.

ColumnDescription
NameName of the variable/FB instance.

Naming rules

Further Info
For information how to use extended qualifiers in variable names, refer to the topic "Extended Qualifiers in IEC Variable Names".

ValueThe column is only visible while switched to debug mode (and in monitoring mode for the Safety PLC). It shows the online value read from the running process. In debug mode, a context menu is available where you can force/overwrite the value.

Further Info
For information on monitoring and debugging the application see the topic "Commissioning the Application ‣ Debug mode: Monitoring the Application Execution
×‣ WATCHES: Monitoring/Debugging the Application
×‣ Debugging Code: Forcing/Overwriting
×‣ Monitoring/Debugging the Safety PLC
×‣ Monitoring Mode: Displaying Online Values
×‣ Debugging Safety-Related Code: Forcing/Overwriting
×‣ WATCHES: Monitoring/Debugging the Safety-Related Application
×
".

TypeData type of the variable. The data type determines what kind of value the variable can have and it defines the initial value, range of possible values and the number of bits.

In case of a function block instance, the function block name is displayed.

Left-clicking into the cell shows the selectable data types represented by a corresponding symbol and the data type name.

Safety-related and standard (non-safety-related) code is strictly distinguished in PLCnext Engineer. Therefore, also safety-related and standard variables, or more precise, data types, are distinguished. Safety-related variables are displayed with a yellow color marking, variables of standard data types are shown without color marking.

Further Info
See the topic "Data Types" for further information.

UsageKeyword that defines the scope of the variable. The available keywords are described in the topic "Variable declaration keywords".

Which keywords are possible depends on the table where the variable is declared:

In local variables tables: depending on the POU type, the following declaration keywords can be used.

  • Program POUs - Keywords 'Local', 'Program', 'External' and 'Instance'.
    In programs, 'IN ports' and 'OUT ports' can be declared when working with a PLCnext Technology controller (see below).
  • Safety-related program POUs - Keywords 'Local' and 'External'.
    Program-global variables and ports are not supported in safety-related programs.
  • FB POUs - 'Local', 'Input', 'Output', 'InOut', 'External' and 'Instance'.
  • Safety-related FB POUs - 'Local', 'Input', 'Output', and 'External'.
  • Methods of object-oriented FBs - 'Local', 'Input'.
  • Coded Actions/Transitions of SFC FB - 'Local'.
  • Function POUs - 'Local' and 'Input'.
In Data Lists:
  • 'Global' is used for resource-global variables which can be used in all POUs of the related resource.

    Note
    Both the standard controller and the Safety PLC have their own, separate Data List. A controller-global variable cannot be used in the Safety PLC and vice versa.

    Note
    Resource-global variables must be declared as 'Global' in the Data List of the controller/Safety PLC and as 'External' in the local variables table of the POU where they are used.

    Note
    When you insert an existing global variable (declared as 'Global' variable in the Data List of the 'IEC 61131-3' node) into a POU code worksheet and no local variable with the same name exists in the 'Variables' table of the POU, the related external variable declaration ('Usage = External') is automatically added to the 'Variables' table.

  • 'Instance' identifies instance-related I/O variables that are declared with the keyword 'Instance' in FB or program POUs and for which a data direction has been specified by setting the 'I/Q' property. One variable per instance is inserted automatically.

    Note
    'Instance' is not supported for the Safety PLC.

  • 'Program' identifies program-global variables that are declared with the keyword 'Program' in program POUs and for which a data direction has been specified by setting the 'I/Q' property (see below). One variable per instance is inserted automatically.

    Note
    'Program' is not supported for the Safety PLC.

    Further Info
    Refer to the topic "Instance-related I/O variables" for further details.

Ports for PLCnext Technology controllers: when working with a PLCnext Technology controller, IN ports and OUT ports can be declared in program POUs. Ports are not included in the Data List of the 'IEC 61131-3' node in the PLANT but in the GDS Port List of the 'PLCnext' node.

Background

Further Info
Further information can be found in the topic "PLCnext Technology controller generation".

I/Q/MData direction of the variable. This property is only available for Safety PLC variables (of both standard and safety-related data types).

  • M = variable is marker variable. It is neither connected to a device input/output nor it is used as exchange variable.
  • I = variable can be read by the safety-related application. It can be connected to an input process data item or it can be used as "incoming exchange variable" which is written in the standard (non-safety-related) application.
  • Q = variable can be written by the safety-related application. It can be connected to an output process data item or it can be used as "outgoing exchange variable" which is read in the standard (non-safety-related) application.

Further Info
Refer to the topics "Role Mapping in Data Lists" and "Exchanging Data between Controller and Safety PLC".

TranslateBy setting this flag in a variable or instance declaration, its user-defined comment is listed in the 'Resources' editor of the respective POU and can be translated there.

See topic "Project Language Translation (Localization)" for details.
CommentUser-defined comment. The input is limited to 128 characters.
InitAccording to IEC 61131-3, initial values can optionally be assigned to variables. This means that a variable which is going to be used for the first time in the controller program is used with its initial value.

Initial values can be set for variables with the usage 'Local', 'Input' and 'Output'. For 'External' and 'InOut' variables, no init value can be applied.

The initial value has to fit to the selected data type.

Note
Elements and members of user-defined data types (ARRAYs and STRUCTs) can easily be initialized using the 'Init Value Configuration' editor.

Note
When declaring an instance-related variable in a 'Program' or 'Instance' declaration (by setting a data direction with the 'I/Q' attribute), this instance-related variable can also be initialized in the 'IEC 61131-3' Data List. An initial value set for the 'Instance' or 'Program' declaration overrules the initial value set in the local variables table (if defined). Refer to the topic "Instance-related Located Variables" for details.

Note
Variables which are assigned to physical inputs cannot be initialized.

Note
If you are using PLCnext Engineer in another user interface language and/or with another Windows system locale than English you must enter numeric values with a '.' as decimal separator (always according to the English standard). This applies, for example, when entering initial values in variables tables or REAL/LREAL literals in the code.

AccessOnly relevant for variables in methods added to a function block POU and variables in function block POUs. The following settings are possible:

  • 'PUBLIC' - The method/variable can be accessed from any POU in the project (external call).
  • 'PRIVATE' - The method/variable can only be accessed from inside the function block POU where it is defined (internal call).
This property is not available in safety-related POUs (no safety-related object-oriented FBs or SFC POUs supported).
RetainSpecifies that a retentive variable is declared. The value of a retentive variable is kept in the controller memory even if power is switched off. In case of a warm start, the last value of the variable is going to be used.

The 'Retain' property can be used in combination with the keywords 'Local', 'Output', 'Global'. It is also available for input and output ports declared in a program POU with 'Usage = IN Port' or 'OUT Port' when working with a controller of the PLCnext generation.

The 'Retain' attribute is not allowed in combination with the 'Constant' attribute and vice versa.

This property is not available in safety-related POUs (no retain variables supported).

Also refer to the topic "Retain Handling" for further information.
ConstantDeclares a constant variable (VAR_CONSTANT acc. to the IEC 61131-3).
The value of a constant variable cannot be changed by the running application (read-only access).

See the topic "Constant Variables" for further information.
OPCSpecifies that the variable is visible for the integrated OPC UA server and can therefore be subscribed by OPC clients.

The 'OPC' property can be used for variables
  • in declaration tables of program and FB POUs as well as in the controller Data List. The property is not available for declarations in function POUs, methods, SFC actions and transitions.
  • in combination with the keywords 'Local', 'Input, 'Output', and 'Program' (in POU variable tables) as well as for 'Global' declarations ('Variable' role in the controller Data List).
  • of all standard (non-safety-related) data types.

    This property is not available in safety-related POUs.

The 'OPC' property is also available for input and output ports declared in a program POU with 'Usage = IN Port' or 'OUT Port' when working with a controller of the PLCnext generation.

OPC UA subscription is not possible for function block instance variables.

Note
This attribute is not relevant for the OPC UA PubSub communication. Ports and global variables can be added to a PubSub data set even if the checkbox is not selected.

HMIThis attribute is only relevant for PLCnext Technology controllers.

Specifies that the port/variable is visible for the local Web Server and can be read/written in the HMI application.

The checkbox has two functions:
  • It makes the port/variable visible and selectable in the HMI editor. This way, it can be assigned to an object dynamic, i.e., connected to an HMI object (selectable there under 'Context'). See topic "HMI Tags" for details.
  • It protects the access and restricts the visibility of the port (GDS datum) or variable from outside the PLCnext core. This way it prevents that the protocol/communication between HMI client and server can be manipulated externally.
This property is available for ports ('Usage = IN Port' or 'OUT Port' in a program POU) and for local variables in function block and program POUs.

This property is not available in safety-related POUs.
IoTThis attribute is only relevant for PLCnext Technology controllers.

Specifies that the port/variable is epxosed for IoT (Internet of Things) protocols like Proficloud, MQTT (Message Queuing Telemetry Transport) etc.
The checkbox protects the access and restricts the visibility of the port (GDS datum) from outside the PLCnext core. This way it prevents that the communication between IoT devices can be manipulated externally.

This property is available for ports ('Usage = IN Port' or 'OUT Port' in a program POU) and for local variables in function block and program POUs.

This property is not available in safety-related POUs.
RedundantThis attribute is only relevant for PLCnext Technology controllers with redundancy function.

Enables/disables the synchronization of variables and ports between the PRIMARY and BACKUP controller. When enabled (checkbox activate), the PRIMARY controller transfers the value to be synchronized to the BACKUP controller before each cycle. Deactivate the checkbox if you want to disable the synchronization.

Further Info
For details on the configuration of a redundant control system using PLCnext Technology controllers see the topic "Redundant Controller Configuration".

I/QThe 'I/Q' property can only be set for the following variables usages:
  • local variables (keyword 'Local') in FB POUs and program POUs, and
  • program-global variables (keyword 'Program') in program POUs.
For input/output variables and externals no data direction can be set.

This property is not available in safety-related POUs and for input and output ports ('Usage = IN Port' or 'OUT Port').

The selected value defines the data direction of the variable (input or output signal). It therefore specifies whether the local or program-global variable is used as instance-related I/O variable.

By selecting a value, the variable is automatically entered in the Data List of the controller (resource). One variable is added for each FB/program instance. The declaration keyword in the Data List is 'Instance' for local variables and 'Program' for program-global variables.

This way, FB/program instance-related I/O variables can be created if various instances of the same FB/program have to process different incoming or outgoing signals.

Further Info
See topic "Instance-related Located Variables" for details.

FeedbackThe property is only available in safety-related program and FB POUs.

If selected, the variable is considered as feedback variable, i.e., it can be used to program an implicit feedback in the safety-related logic.1

The 'Feedback' flag can only be set in combination with 'Usage = Local'.

Further Info
For further information, refer to topic "Implicit feedbacks in SNOLD".

DiagnoseThe property is only available in safety-related program POUs.

If selected, the variable is written into the diagnostic buffer which is a reserved memory area on the Safety PLC. Suitable diagnostic tools can read status information from this buffer thus enabling an implicit function block diagnostic.
The 'Diagnose' flag can only be set in combination with 'Usage = Output'.

Background
ConfirmThe property is only available for safety-related variables in the Safety PLC Data List. The 'Confirm' flag is active and must be selected under the following circumstances:
  • Each time you assign a process data item to a safety-related variable (thus defining a safety-related input or output variable).
  • Each time a process data item which is assigned to a safety-related variable was modified in the PLANT.2
PLCnext Engineer reports a warning message in the Safety Log (MESSAGES window) as long as 'Confirm' is not selected for all safety-related I/O variables.

The 'Confirm' flag is automatically deselected after replacing a safety-related module. In this case, you must repeat the I/O verification and set 'Confirm' again for the affected variables. Observe the hazard message and information given in the topic "Replacing Devices", section "Safety requirements when replacing the Safety PLC...".

1When programming implicit feedbacks, the safety-related logic can show a storing behavior by the updating of the feedback, which may result in a complex timing of your entire application.

WARNING
Unintended machine operation
  • Verify the impact of programmed implicit feedbacks particularly with respect to the possibly different timing and to their effect on the performance of your application.
  • Make certain that suitable organizational measures (according to applicable sector standards) have been taken to avoid hazardous situations if the safety-related logic application operates in an unintended or incorrect way.
  • Do not enter the zone of operation while the machine is operating.
  • Ensure that no other persons can access the zone of operation while the machine is operating.
  • Observe the regulations given by relevant sector standards while the machine is running in any other operating mode than "operational".
  • Use appropriate safety interlocks where personnel and/or equipment hazards exist.

2After modifying the PLANT structure by adding, deleting or replacing devices, the following applies:

WARNING
Unintended equipment operation
  • Inspect and correct as necessary any global I/O variables related to physical, safety-related I/Os whenever you modify the PLANT structure.
  • Whenever you add, delete or exchange devices in the PLANT, validate the physical wiring of your safety-related architecture and thoroughly test the application.