Configuring Global
Variables device structures
When defining or editing a Global Variables device, in
addition to being able to configure simple variables for
the Global Variables device, you can also configure user
defined structures. These structures can be a single level,
or they can be a multilevel, complex structure.
Once the structure is configured for the Global Variables
device, you can configure a variable to use the structure
as a data type.
Follow these steps to configure a structure for a Global
Variables device.
The steps use the example saved
AcmeProducts_Global_Variables device used
in the previous configuring variables section.
- If you are editing a previously defined Global
Variables device, make sure the Global Variables device
is stopped.
- From the Devices tab, select the
appropriate Global Variables device, and then select
Edit.
The Device window appears. - Next to Structures, select
Configure.
The Structures window appears. - Select Add.
A window appears where you type the name of the structure. - Type the name (for this example
StructureA), and then select
OK.
The name is added to the Structures window.
The next step is to define the fields within the structure. - From the bottom of the Structures window under
Fields, select
Add.
The New Variable window appears.
The window is the same as when defining a simple variable; however, now you will be creating a variable field that will be a member of a parent structure. - Type the name of the variable, and then use the
Type down-arrow to select the type of
data the variable will represent. For this example, the
following four fields will be created:
Variable name
Type
ExVar1
INT2
ExVar2
INT4
ExVar3
FLOAT4
ExVar4
STRING of length 8
- For each field created, select
Add.
For this example, the completed Fields section of the Structures window will appear as follows: - Select OK after configuring the
desired variable fields in the structure.
The Device window re-appears. - Select Save to save the definition
of the Global Variables device.
Now that you have configured a structure (with four variables), you can configure a variable that uses the structure as its data type. See Assigning a structure as a data type.