minute read

Axes

You are reading our Automation1 API documentation for the .NET programming language.

The Basics

In the .NET API, Axes lets you see the physical and virtual axes on your Automation1 controller. Every Automation1 controller has a fixed number of axes: 32 axes for PC-based controllers and 12 axes for drive-based controllers. Physical axes are axes that have a corresponding electrical device and mechanical device. The remaining axes on the controller that do not have a corresponding electrical device and mechanical device are virtual axes.

How to Use

In the .NET API, Axes is part of the Controller.Runtime property. For all the APIs that operate under this property, the Automation1 controller must be running before you can see the physical and virtual axes. For more information about this property, see the Controller page.

The Controller.Runtime.Axes property is an enumerable collection of the axes on the Automation1 controller. You can iterate over this collection or index into it with either an axis name or axis index. The main use of this collection is to determine if an axis is physical or virtual and, if it is physical, get the associated electrical HyperWire device. See the Devices page.

Controller.Runtime.Axes is a simple read-only view of the axes on your Automation1 controller. You cannot command motion from here. Instead, use Commands. If you want to know the position, homed state, or some other status of an axis, use Status. An axis can be specified by either axis name or axis index.

Refer to the example that follows.

Copy
controller.Runtime.Axes[string axisName]
controller.Runtime.Axes[int axisIndex]

Example Code

Copy
bool isAxisXVirtual = controller.Runtime.Axes["X"].HyperWireDevice == null;
int axisIndexForX = controller.Runtime.Axes["X"].AxisIndex;

Thread Safety

All the methods and properties that operate under the Controller.Runtime.Axes property are thread safe. You can call them from two or more threads without interference.

Full Reference

For more information about the properties that are available for Axes, refer to the list that follows.

Controller.Runtime.Axes Properties