Moveables
The Moveables API makes moving your axes and locksteps more convenient by providing a cohesive set of functions across both and letting users specify default units for movements to use.
Set up There are three functions you can use to get a moveable. First, to create from an axis, use From Axis:
Python
C#
C++
JavaScript
MATLAB
Java
device = connection.get_device(1 )
moveable = Moveable.from_axis(device.get_axis(1 ))
Copy const device = connection.getDevice (1 );
const moveable = await Moveable .fromAxis (device.getAxis (1 ));
Copy var device = connection.GetDevice(1 );
var moveable = Moveable.FromAxis(device.GetAxis(1 ));
Copy Device device = connection.getDevice(1 );
Moveable moveable = Moveable.fromAxis(device.getAxis(1 ));
Copy device = connection.getDevice(1 );
moveable = zaber.motion.movement.Moveable.fromAxis(device.getAxis(1 ));
Copy Device device = connection.getDevice (1 );
Moveable moveable = Moveable::fromAxis (device.getAxis (1 ));
Copy
Next, if your device is lockstep, you can use From Lockstep:
Python
C#
C++
JavaScript
MATLAB
Java
device = connection.get_device(1 )
moveable = Moveable.from_lockstep(device.get_lockstep(1 ))
Copy const device = connection.getDevice (1 );
const moveable = await Moveable .fromLockstep (device.getLockstep (1 ));
Copy var device = connection.GetDevice(1 );
var moveable = Moveable.FromLockstep(device.GetLockstep(1 ));
Copy Device device = connection.getDevice(1 );
Moveable moveable = Moveable.fromLockstep(device.getLockstep(1 ));
Copy device = connection.getDevice(1 );
moveable = zaber.motion.movement.Moveable.fromLockstep(device.getLockstep(1 ));
Copy Device device = connection.getDevice (1 );
Moveable moveable = Moveable::fromLockstep (device.getLockstep (1 ));
Copy
Finally, there is the From Device function that you can use for single-axis devices:
Python
C#
C++
JavaScript
MATLAB
Java
device = connection.get_device(1 )
moveable = Moveable.from_device(device)
Copy const device = connection.getDevice (1 );
const moveable = await Moveable .fromDevice (device);
Copy var device = connection.GetDevice(1 );
var moveable = Moveable.FromDevice(device);
Copy Device device = connection.getDevice(1 );
Moveable moveable = Moveable.fromDevice(device);
Copy device = connection.getDevice(1 );
moveable = zaber.motion.movement.Moveable.fromDevice(device);
Copy Device device = connection.getDevice (1 );
Moveable moveable = Moveable::fromDevice (device);
Copy
These all result in moveable being an instance of type Moveable with identical functionality. Moveables have all of the movement methods from axis and lockstep so:
Python
C#
C++
JavaScript
MATLAB
Java
moveable.move_absolute(100 )
Copy await moveable.moveAbsolute (100 );
Copy moveable.MoveAbsolute(100 );
Copy moveable.moveAbsolute(100 );
Copy moveable.moveAbsolute(100 );
Copy moveable.moveAbsolute (100 );
Copy
Will have the same effect as:
Python
C#
C++
JavaScript
MATLAB
Java
axis = device.get_axis(1 )
axis.move_absolute(100 )
Copy const axis = device.getAxis (1 );
await axis.moveAbsolute (100 );
Copy var axis = device.GetAxis(1 );
axis.MoveAbsolute(100 );
Copy Axis axis = device.getAxis(1 );
axis.moveAbsolute(100 );
Copy axis = device.getAxis(1 );
axis.moveAbsolute(100 );
Copy Axis axis = device.getAxis (1 );
axis.moveAbsolute (100 );
Copy
Default Units Often, you'll want to always use the same units without having to specify them on each call. For example, to create a Moveable that will always use units of millimeters, you can create a moveable like:
Python
C#
C++
JavaScript
MATLAB
Java
mm_moveable = Moveable.from_axis(device.get_axis(1 ), DefaultMotionUnits(position=Units.LENGTH_MILLIMETRES))
Copy const mmMoveable = await Moveable .fromAxis (device.getAxis (1 ), { position : Length .MILLIMETRES });
Copy var mmMoveable = Moveable.FromAxis(device.GetAxis(1 ), new DefaultMotionUnits { Position = Units.Length_Millimetres });
Copy Moveable mmMoveable = Moveable.fromAxis(device.getAxis(1 ), new DefaultMotionUnits (Units.LENGTH_MILLIMETRES));
Copy mmMoveable = zaber.motion.movement.Moveable.fromAxis(device.getAxis(1 ), units=zaber.motion.movement.DefaultMotionUnits(zaber.motion.Units.LengthMillimetres));
Copy DefaultMotionUnits units;
units.setPosition (Units::LENGTH_MILLIMETRES);
Moveable mmMoveable = Moveable::fromAxis (device.getAxis (1 ), units);
Copy
Then, to move your device by 10 mm, instead of writing:
Python
C#
C++
JavaScript
MATLAB
Java
axis.move_relative(10 , Units.LENGTH_MILLIMETRES)
Copy await axis.moveRelative (10 , Length .MILLIMETRES );
Copy axis.MoveRelative(10 , Units.Length_Millimetres);
Copy axis.moveRelative(10 , Units.LENGTH_MILLIMETRES);
Copy axis.moveRelative(10 , Units.Length("mm" ));
Copy axis.moveRelative (10 , Units::LENGTH_MILLIMETRES);
Copy
You can just write:
Python
C#
C++
JavaScript
MATLAB
Java
mm_moveable.move_relative(10 )
Copy await mmMoveable.moveRelative (10 );
Copy mmMoveable.MoveRelative(10 );
Copy mmMoveable.moveRelative(10 );
Copy mmMoveable.moveRelative(10 );
Copy mmMoveable.moveRelative (10 );
Copy
If you need to use another unit, you can always still specify it by passing in a Measurement:
Python
C#
C++
JavaScript
MATLAB
Java
mm_moveable.move_relative(Measurement(value=2 , unit=Units.LENGTH_INCHES))
Copy await mmMoveable.moveRelative ({ value : 2 , unit : Length .INCHES });
Copy mmMoveable.MoveRelative(new Measurement { Value = 2 , Unit = Units.Length_Inches });
Copy mmMoveable.moveRelative(new Measurement (2 , Units.LENGTH_INCHES));
Copy mmMoveable.moveRelative(zaber.motion.Measurement(2 , zaber.motion.Units.LengthInches));
Copy mmMoveable.moveRelative (Measurement (2 , Units::LENGTH_INCHES));
Copy
DefaultMotionUnits supports setting default units for Position (which also covers lengths and distances), Speed, Acceleration, and Time.
Lockstep All the methods that exist on axis exist on lockstep, but will sometimes get information from the whole lockstep to provide you with more correct info. So for example, if you have a lockstep of two devices, one with a travel of 10 mm, and one with a travel of 5 mm, and call Get Limit Max, it will return 5 mm since that is the furthest the combination of devices can travel, and if you call Is Homed it will check that all of the axes are homed.
The following methods will act on all axes in a lockstep when called:
Get Limit Max
Get Limit Min
Get Max Speed
Set Max Speed
Get Max Acceleration
Set Max Acceleration
Is Homed
Is Parked