7 - 17
7 Programming
NX-series Safety Control Unit User’s Manual (Z930)
7-2 Variables
7
7-2-6 Variable Attributes Other Than Data Type
This section describes the variable attributes other than the Data Type.
The variable name is used to identify the variable. Each variable in a POU must have a unique name.
However, you can declare local variables with the same variable name in different POUs. These are
treated as two separate variables. You cannot declare an internal variable with the same variable name
as a global variable.
The variable is set to the initial value in the following situations.
• When the power supply is turned ON
• When the mode is changed to RUN mode
• When the mode is changed to DEBUG mode (STOPPED)
Types of Variables That Can Have Initial Values
You can set initial values for only some types of variables. A list is provided below.
You must set initial values for all variables that allow them.
The Constant attribute prohibits instructions from writing values to a variable.
Setting the Constant attribute will prevent any program from overwriting the variable.
The values of variables with a Constant attribute cannot be written from instructions after the initial
value is set. If there is an instruction in a POU that attempts to write a value to a variable with the Con-
stant attribute, an error will occur when the program is built.
7-2-6 Variable Attributes Other Than Data Type
Variable Name Attribute
Initial Value Attribute
Variables Setting initial values
Global variables Yes (required)
Internal variables
Input variables
Output variables
External variables Not possible.
Constant Attribute