Skip to content

Initialize

After installing the library, include the library at the top of your code:

from zaber_motion import Library
from zaber_motion.binary import Connection

Library.enable_device_db_store()

# The rest of your program goes here
using Zaber.Motion;
using Zaber.Motion.Binary;

// namespace name may differ in your code
namespace example
{
    class Program
    {
        static void Main(string[] args)
        {
            Library.EnableDeviceDbStore();

            // The rest of your program goes here
        }
    }
}
const { binary: { Connection }, Library } = require('@zaber/motion');

async function main() {
  Library.enableDeviceDbStore();

  // The rest of your program goes here
}

main();
// package name may differ in your code
package example;

import zaber.motion.Library;
import zaber.motion.binary.Connection;
import zaber.motion.binary.Device;

public class App
{
    public static void main(String[] args)
    {
        Library.enableDeviceDbStore();

        // The rest of your program goes here
    }
}
import zaber.motion.Library;
import zaber.motion.binary.Connection;

Library.enableDeviceDbStore();

% The rest of your program goes here
javaaddpath("motion-library-jar-with-dependencies.jar");

CONNECTION_CLASS = "zaber.motion.binary.Connection";
LIBRARY_CLASS = "zaber.motion.Library";

javaMethod("enableDeviceDbStore", LIBRARY_CLASS);

% The rest of your program goes here
#include <zaber/motion/binary.h>

using namespace zaber::motion;
using namespace zaber::motion::binary;

int main() {
    Library::enableDeviceDbStore();

    /* The rest of your program goes here */

    return 0;
}

The library connects to the internet to retrieve information about Zaber devices. Calling the method @method EnableDeviceDbStore makes the library store the downloaded information to later allow for offline use. For more information about the behaviour see Device Database.

Ensure that the file motion-library-jar-with-dependencies.jar is in the current directory. You can alternatively provide an absolute path.

Continue the Getting Started guide by opening a serial port.