Name | Name of the variable/FB instance.
Naming rules
-
A local variable must be unique within a POU. Local variables with the same name in different POUs are allowed.
- A global variable must be unique for the controller or Safety PLC. The same name for a global variable of the controller and for the Safety PLC is allowed.
- The variable name must not be identical to any declaration keyword.
- Variable names can consist of letters, digits and underscores.
- Variables must not contain spaces.
- The name has to begin with a letter or an underscore.
|
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.
Further Info
For information on monitoring and debugging the application see the topic "". |
|
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.
Further Info
See the topic "Data Types" for further information. |
|
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.
- 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 PLCand 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. |
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 Port List of the 'PLCnext' node.
Background
For controllers of the PLCnext Technology generation, input and output ports can be used in addition to or instead of resource-global variables. Programs communicate using ports, i.e., data can be read from and written to programs via ports.
Via ports, communication is even possible between IEC 61131-3-compliant programs and programs developed with a non-IEC 61131-3 programming language such as C++.
For that purpose, input and output ports can be assigned to each other using the role mapping function in the Port List. Port Lists are available on the 'PLCnext' PLANT node and on program instance nodes. A Port List contains the ports which are relevant for the respective PLANT node.
All port connections are stored in the Global Data Space of the PLCnext Technology controller.
|
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).
- 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.
|
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.
Note
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. |
|
Access | Only 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). |
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.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).
Declaration rules for constants:
- To be specified as literal acc. to the IEC 61131-3 standard. Expressions are not supported.
- Allowed in the controller Data List for 'Global' and 'Program' declarations.
- Allowed in the local variables table of POUs for 'Local', 'Input' and 'External' variables.
For 'Output' variables, the 'CONSTANT' cannot be set as constants cannot be written. When declaring an external variable which relates to an already existing constant global variable, the 'CONSTANT' attribute is set automatically in the local variables table.
- Can be used as array boundaries.
- Not allowed for global input variables (mapped to an input process datum in the Data List): While 'CONSTANT' is selected, no process datum can be selected, and if an input process datum is already assigned, the 'CONSTANT' checkbox is inactive.
- Not allowed in FB POU variables tables.
- Not allowed in the Safety PLC Data List and in safety-related variables tables.
- Not allowed in the controller Data List for exchange variables (as they are connected to a standard Safety PLC variable).
- Not allowed for ports.
|
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
- 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. |
|
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:
- 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. |
Proficloud | This attribute is only relevant for PLCnext Technology controllers.Specifies that the port/variable is visible for Proficloud services and can therefore be subscribed by Proficloud devices. 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 Proficloud 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:
- 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.
|
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'.
Background
Safety-related firmware function blocks as well as user-defined FBs in a safety-related project may have a diagnostic output which allows polling of FB status information. This diagnostic information can be written to a reserved output buffer area (DQ buffer) while compiling and further processed, for example, using a diagnostic tool. Select the 'Diagnose' flag to add the local output variable (FB output) to the DQ buffer.
|
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:
- 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...". |