Home device

An important step in controlling a Zaber device is homing it.

Homing a device moves it so that it finds a reference position. A reference position is necessary in order to perform accurate absolute position movements. The reference position is retained until the device is powered off, so it's recommended to home devices once shortly after they are powered on. The device does not need to be homed after this as long as power is maintained, but you can include the homing step early in your program if you prefer to have a consistent process regardless of whether the device has been previously homed.

# indent this code under the "with" statement
device = device_list[0]

axis = device.get_axis(1)
axis.home()
var device = deviceList[0];

var axis = device.GetAxis(1);
axis.Home();
const device = deviceList[0];

const axis = device.getAxis(1);
await axis.home();
Device device = deviceList[0];

Axis axis = device.getAxis(1);
axis.home();
device = deviceList(1);

axis = device.getAxis(1);
axis.home();
device = deviceList(1);

axis = device.getAxis(1);
axis.home();
Device device = deviceList[0];

Axis axis = device.getAxis(1);
axis.home();

When the program is run, the device will move to find its reference.

The array of devices in the above example is the one created in the open a serial port section.

Note that homing is performed using the @var axis object rather than the @var device object. Some devices have multiple axes, so the @class Axis class allows control of a specific axis on the device. The @class Device class or @class Axis class will have different methods and properties depending on which scope makes more sense. Axes are indexed from 1. Therefore the code above homes the first axis of the device.

The next step in the Getting Started guide makes your device move.