Danaher Motion
06/2005
GENERIC ELEMENTS
M-SS-005-03 Rev
E
143
9.
GENERIC ELEMENTS
Writing complex multi-axis applications requires high level software
organization. Avoid code repetition by encapsulating blocks of code into
functions or subroutines. Code blocks of setup or query properties, which
can be applied for all (or at least several) groups or axes in the system, and
can be assembled into functions and subroutines. For example, if there are a
number of identical motors in the system, their setup is the same. Write the
following lines only once, instead of repeating them for each axis:
A1.PFac = 0x8000
A1.VFac = A1.PFac/1000
A1.AFac = A1.VFac/1000
A1.JFac = A1.AFac/1000
A1.VMax = 290
A1.AMax = 1500
A1.DMax = A1.AMax
A1.Acc = A1.Amax
A1.Dec = A1.DMax
…
Another example is writing common procedures as subroutines or functions
that can later be applied in any system independently of how many axes or
groups are defined. For example, switching on an output when an axis
reaches its target:
While A1.IsMoving <> 0
Sleep 1
End While
Sys.Dout.1 = 1
9. 1
ELEMENTID
Depending on the system configuration, the MC can have several axes or
groups defined. These motion elements are actually user interfaces of the
system's internal memory or internal function calls. They are pointers to
actual groups and axes.
During system configuration (“Sys.NumberAxes =
n
” and group definitions),
each axis and group receives a unique element identifier. Axes get
successive element identifiers ranging from 1 to 32, according to axis
number. Groups get successive identifiers ranging from 33 to 64, according
to declaration order. You cannot change these element identifiers.
The value of the element identifier is queried directly with
ELEMENTID
(read-only).
SYS.NUMBERAXES = 4
Common Shared G2 As Group AxNm = A3 AxNm = A4
Common Shared G1 As Group AxNm = A1 AxNm = A2
? A1.ELEMENTID
1
? A2.ELEMENTID
2
? G2.ELEMENTID
33
? G1.ELEMENTID
34