The following code connects motion(0) with axis 0.
Controller.Motion(0).Axes = Array(0)
The following code connects motion(1) with axis 1 and 2.
Controller.Motion(1).Axes = Array(1,2)
The following code disconnects motion(2) from all axes.
Controller.Motion(2).Axes = Array()
The following diagram shows the resulting object relationships from the above code.
The Axis.Number property can be useful in assigning axis lists when the axis numbers are not available:
Dim xAxis As MPXCtl.Axis
Dim yAxis As MPXCtl.Axis
Dim xyMotion As MPXCtl.Motion
Set xAxis = Controller.Axis(5)
Set yAxis = Controller.Axis(3)
Set xyMotion = Controller.Motion(2)
' ...
' Use Axis.Number property to change a Motion object's axis
' without having to explicitly specify the axis numbers
xyMotion.Axes = Array(xAxis.Number, yAxis.Number) |