Rockwell Automation 5370-UPK CVIM USER-PAK Option User Manual
Page 91

Chapter 8
Defining Strings for Serial Ports and Viewports
8–15
Note: For
Tool
viewports, the viewport boundaries are that of the screen, so
that the top left corner of the
Tool
viewport would be the screen corner.
For example, the draw line code:
D 10, 20 30, 40
x y dx dy
would draw a diagonal line whose starting point (x,y) coordinates would be
(10, 20) relative to the top left corner of the viewport (the coordinates in the
diagram are listed for illustrative purposes only, and are not part of the
display):
(10, 20)
(40, 60)
(0, 0)
Line drawn
Viewport border
Starting point
End point
The end point x– and y–coordinates in this example would be (40, 60). The
x–coordinate of the end point (40) is obtained by adding the
dx
value (30) to
the starting point x–coordinate value (10). The y–coordinate of the end point
(60) is obtained by adding the
dy
value (40) to the starting point
y–coordinate value (20).
Note these additional considerations regarding the
dx
/
dy
coordinates:
•
Minus (–) signs can be used as a prefix to make
dx
and/or
dy
values
negative.
•
A value of zero (0) can be used for
dx
and/or
dy
values. For example, if
dx
is 0 and
dy
is non–zero, a vertical line is drawn. If
dx
is non–zero
and
dy
is 0, a horizontal line is drawn. If both
dx
and
dy
are 0, a dot is
drawn at the starting point defined by the
x
and
y
values.
•
If the parameters are defined such that they would cause any portion of
the line to be drawn beyond the viewport border, the line is not drawn.
•
Formula indicators (%) can be used for any of the draw line parameters.
Thus lines can be drawn whose coordinates are dependent upon formula
results. For example, the code
D
%
1,
%
2
%
4,
%
6
would have
starting point x– and y–coordinates determined by results of formulas 1
and 2, respectively. The dx and dy values would be determined by results
of formulas 4 and 6, respectively.
Note:
Tool
viewport strings are automatically erased and redrawn for
each inspection; this is not true for Text viewport strings. Therefore it