GENERIC ELEMENTS
06/2005
Danaher Motion
144 Rev
E
M-SS-005-03l
9.1.1. Declaration
Generic elements resemble other MC-Basic variables (longs, doubles,
strings) in declaration syntax and scope (global, static and local), as well as
in the ability to define arrays of up to 10 dimensions.
COMMON SHARED|DIM {SHARED} <axis_name> {[]…} AS GENERIC AXIS
COMMON SHARED|DIM {SHARED} <group_name> {[]…} AS GENERIC GROUP
9.1.2. Assignment
<
generic_element_name
>{[]…} = <
real_element_name
>
<
generic_element_name
>{[]…} = <
generic_element_name
>{[]…}
During declaration, all generic elements receive a zero element identifier,
which prevents their usage as motion elements prior to assignment. If an
unassigned generic element is used, an error is returned:
Common Shared Gen_Axis As Generic Axis
? Gen_Axis.ElementID
0
? Gen_Axis.VMax
Error: 3005, "Nonexistent group or axis", Module: Motion
Through assignment, a generic element receives the element identifier of
another motion element, either “real” or generic, thus becoming a pointer to
this element and acquiring all its properties.
Gen_Axis = A1
? Gen_Axis.ElementID
1
? A1.VMax
290
? Gen_Axis.VMax
290
By recurring assignments, generic elements have the ability to change their
pointed axis or group as many times as desired.
Gen_Axis = A2
? Gen_Axis.ElementID
2
? A2.VMax
360
? Gen_Axis.VMax
360
The left-side (assigned) element of the assignment statement cannot be a
“real” axis or group. It must always be a generic element.
A1 = Gen_Axis
Error: 7039, "Syntax Error", Module: Translator