15 changing a variable's scope – Rockwell Automation AutoMax Enhanced Ladder Editor User Manual
Page 32

2Ć14
To change the data type for a variable
Step 1.
Select the instruction containing the variable whose data
type you want to change.
Step 2.
From the File menu or the popĆup menu, choose
Properties. The Instruction Properties dialog box is
displayed.
Step 3.
Choose the Variables tab. The Variable Properties tab is
displayed.
Step 4.
If the name of the variable you want is not displayed in
the Name field, use the list box to scroll through a list and
choose it. The Variable Properties dialog box for that
variable is displayed.
Step 5.
Using the Type list box, choose the data type for the
variable.
Step 6.
Click OK to accept the change.
Tip
Integer variables default to a 16Ćbit integer. If you want the variable
to be a double integer (32Ćbits), you must change its type to double
integer.
Tip
Quickly toggle between the Instruction Info and Variables tabs by
using CTRL+TAB.
Tip
To select the instruction and access the popĆup menu, place the
mouse pointer over the instruction and click the right mouse button.
2.15
Changing a Variable's Scope
The scope of a variable can be either global or local. When you first
enter a variable, its scope is defined based on the case of the first
letter you type. An upper case letter defines the variable to be
global. A lower case letter defines it to be local. You can change a
variable's scope by using the Variable Properties tab.
Compound variables (elementĆindexed or bitĆindexed variable
names) are treated as separate variables with their own properties,
including scope. For example: TANK.fill is a compound variable.
TANK is a global variable and fill is a local variable. For
elementĆindexed and bitĆindexed variables using a number as the
index, the scope of the variable is determined by the named
variable. For example, the scope of the variable TANK.31 would
would be determined by TANK, which would appear in the variable
list. If the variable were TANK.31, only TANK would appear in the
variable list and have a scope.
I
MPORTANT
Changing the properties of a variable affects the variable and not
just a particular instance in which it is used. If you change a
variable's scope, the change applies to every instance where that
variable is used.