A common configuration of zaber devices is to create a 2D gantry by making a base of lock-stepped LC40s moving in the x direction, with a single LC40 atop them moving perpendicularly in the y direction. This can be nicely represented as a pair of moveables. To create a pair of axes, using millimeters as their default units:
These can then be controlled and queried with all the methods of the Moveable API.
Moving together
There are two basic ways of moving both axes to a point at once
With an async function
In this case, use your languages async functionality to run two move commands at once. This will ensure that all commands are complete before continuing:
auto xMove100 = std::async(std::launch::async, [&]{ xAxis.moveAbsolute(100.0); });
auto yMove100 = std::async(std::launch::async, [&]{ yAxis.moveAbsolute(100.0); });
xMove100.get();
yMove100.get();
With wait until idle
This is the better method to use if you don't want to write async code. By setting wait until idle to false, you tell the method to start the action, and then continue on to the next line of code before the move is complete. However, after sending the move commands you must call the Wait Until Idle method on every moving axis. Otherwise, the gantry may start acting on its next instructions before all moves are complete and result in unpredictable behavior: