Variable/Port Properties
Variable properties can be edited...- in the local 'Variables' table of each POU. Here, you declare local variables and FB instances. To open a variables table, double-click the respective POU in the COMPONENTS.
- in the Data List of the controller (and Safety PLC, if available). Here, you declare global variables. To open a Data List, double-click the respective node in the PLANT.
- in the 'Variables Properties' table (part of the code editor). The table allows you to edit the declaration of an existing variable without leaving the code editor (you cannot create new variables in the table). The table is shown at the bottom of the code editor (table is closed by default). To open the 'Variables Properties' table, click the 'Show Variable Properties' button
on the toolbar (to close the editor, click the button again).
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. |
Column | Description | |||||||
---|---|---|---|---|---|---|---|---|
Name | Name of the variable/FB instance.
![]()
|
|||||||
Value | The 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.
|
|||||||
Type | Data 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.
|
|||||||
Usage | Keyword 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.
![]()
|
|||||||
I/Q/M | Data direction of the variable. This property is only available for Safety PLC variables (of both standard and safety-related data types).
|
|||||||
Translate | By 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. | |||||||
Comment | User-defined comment. The input is limited to 128 characters. | |||||||
Init | According 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.
|
|||||||
Access | Only relevant for variables in methods added to a function block POU and variables in function block POUs. The following settings are possible:
|
|||||||
Retain | Specifies 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. | |||||||
Constant | Declares 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. |
|||||||
OPC | Specifies 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
|
|||||||
HMI | This 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:
|
|||||||
IoT | This 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. |
|||||||
Redundant | This 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.
|
|||||||
I/Q | The 'I/Q' property can only be set for the following variables usages:
|
|||||||
Feedback | The 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'.
|
|||||||
Diagnose | The 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'. ![]() |
|||||||
Confirm | The 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:
|
1 | When 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
|
2 | After modifying the PLANT structure by adding, deleting or replacing devices, the following applies: |
WARNING
|
Unintended equipment operation
|