User guide

GEI-100340
6.
Connection to External Variables
Programs generated using Win+Drive normally have connections to the environment outside. For example,
set and measured quantities for control have to be read and output values have to passed to servos. For
creating these connections between internal values of Win+Drive generated programs and external ones
variables have to be defined and ports of blocks have to be connected to them. The connections are managed
not directly by the variables but by aliases called logicals.
6.1 Variables and
Logicals
There are two kinds of objects for connecting internal ports to the outside world:
-
variables are used in the generated program and provide the names that are used by external programs,
-
logicals are used in the schematics and are connected to ports. They are mapped to variables.
Variables are initially defined by the file
Target.ini
that is read during startup of Win+Drive. During the
execution they can be edited by the variables dialog.
6.2
The Variables Dialog
The variables dialog is opened by the item
Variables
from the
Edit’
menu.
;‘;$,g;
.
.
.
.
.
.
.
.
..~
.
.
:..
.
.
.
.
.
.
.
.
.
.
.
.
.._.........
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
‘@
4
I
;‘i,;:
i&.&Jug
[iti
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.._........
i
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
...”
t....
Figure 6.2.1: Variable Editor Dialog
The dialog lists all available variables in a multi column list:
-
Nbr is used for numbering the list,
-
Variable name contains the name. If a variable consists of an array the size is appended after the name in
square brackets (i.e.
FVAR[lUi.I]
is an array of 100 elements).
-
Data type shows the type.
-
Storage class shows where the variable is defined and available.
Pressing the New button will insert a new line into the list with a new variable. Its initial name and attributes
can be edited.
Delete
removes a variable from the list. Variables that are described as read-only in the file
target.ini
cannot
be deleted from the list.
To edit a variable the corresponding line must be selected by clicking with the mouse. The name can directly
be edited in the list while the type and storage class are changed by selecting other entries in the appropriate
lists.
The data types are the standard C data types and correspond to the data types of the ports described in para-
graph 54.3.
30