Skip to content

Device Database

The Device Database is a comprehensive resource that contains information about Zaber's products, including unit conversion factors, device names, and supported commands and settings. You can use the library without the Device Database, though some features, such as using real-world units (i.e. units other than Native) or using properties related to device identity, will result in an exception.

The library uses the Device Database whenever it needs to identify a device (e.g. when you call the @method DetectDevices method on a @class Connection class instance). By default, the library accesses the Device Database through a web service (example request).

There are alternatives to accessing the device database which either limit use, or do not use the web service. These are useful in the case of an undesired or impossible internet connection.

Option #1

The library has caching functionality called Device Database Store that is enabled by default. The first time the library needs information about a device, it will contact the web service and save the obtained data to the file system. From that point onward, the library uses saved files instead of the web service.

The store creates a folder (%LOCALAPPDATA%\Zaber Technologies\Zaber Motion Library on Windows, $XDG_CACHE_HOME/zaber-motion-lib on Linux and ~/Library/Caches/zaber-motion-lib on Mac OS) and saves all the information about the devices into that folder.

If you wish to change the location, place a @method EnableDeviceDbStore call to the top of your program with relative or an absolute path as a argument to specify the location of the storage.

# from zaber_motion import Library

Library.enable_device_db_store("./device-db-store")
Library.EnableDeviceDbStore("./device-db-store");
// const { Library } = require('@zaber/motion');

Library.enableDeviceDbStore('./device-db-store');
// import zaber.motion.Library;

Library.enableDeviceDbStore("./device-db-store");
% import zaber.motion.Library;

Library.enableDeviceDbStore('./device-db-store');
Library::enableDeviceDbStore("./device-db-store");

The library may try to access the web service again to update the saved files. This happens if the library is upgraded, if it detects a new type of device, or if the device's firmware is updated.

If you do not wish for the library to store data on your file system, you can disable the store. In that case the library will access the web service every time.

# from zaber_motion import Library

Library.disable_device_db_store()
Library.DisableDeviceDbStore();
// const { Library } = require('@zaber/motion');

Library.disableDeviceDbStore();
// import zaber.motion.Library;

Library.disableDeviceDbStore();
% import zaber.motion.Library;

Library.disableDeviceDbStore();
Library::disableDeviceDbStore();

Option #2

This option allows the library to operate completely offline. It requires you to download the complete Device Database, which contains information about all Zaber devices.

You may download the database from here. When the download is complete, decompress the archive and move the resulting file to your desired folder.

To configure the library to use this file, place the following line at the top of your program (replacing path_to_the_folder with the folder it is in):

# from zaber_motion import Library, DeviceDbSourceType

Library.set_device_db_source(DeviceDbSourceType.FILE, "path_to_the_folder/devices-public.sqlite")
Library.SetDeviceDbSource(DeviceDbSourceType.File, "path_to_the_folder/devices-public.sqlite");
// const { Library, DeviceDbSourceType } = require('@zaber/motion');

Library.setDeviceDbSource(DeviceDbSourceType.FILE, 'path_to_the_folder/devices-public.sqlite');
// import zaber.motion.Library;
// import zaber.motion.DeviceDbSourceType;

Library.setDeviceDbSource(DeviceDbSourceType.FILE, "path_to_the_folder/devices-public.sqlite");
% import zaber.motion.Library;
% import zaber.motion.DeviceDbSourceType;

Library.setDeviceDbSource(DeviceDbSourceType.FILE, 'path_to_the_folder/devices-public.sqlite');
Library::setDeviceDbSource(DeviceDbSourceType::FILE, "path_to_the_folder/devices-public.sqlite");

Please note that if you upgrade the library or device firmware or purchase a new device, you should repeat this process. Do this by downloading the latest Device Database file from the link above, decompressing it, and replacing the old file with the new one.

Option #3

A third option is to use the library without unit conversions or device identification.

To choose this option, pass false for the first argument of the detect devices method. The library will then not attempt to identify devices during the method call.

If you choose this option, you will be unable to use methods which make use of units. This includes unit conversion when using set or get methods, the standalone unit conversion method, and motion methods which do not use native units. If you attempt these the library will raise an exception.

If you need unit conversions, please visit the ASCII Protocol Manual for instructions on how to do the conversions manually.

The following example demonstrates this option:

# Detect without identification
device_list = connection.detect_devices(False)
device = device_list[0]

axis = device.get_axis(1)
# Move by 10000 native units
axis.move_relative(10000)
// Detect without identification
var deviceList = connection.DetectDevices(false);
var device = deviceList[0];

var axis = device.GetAxis(1);
// Move by 10000 native units
axis.MoveRelative(10000);
// Detect without identification
const deviceList = await connection.detectDevices({ identifyDevices: false });
const device = deviceList[0];

const axis = device.getAxis(1);
// Move by 10000 native units
await axis.moveRelative(10000);
// Detect without identification
Device[] deviceList = connection.detectDevices(false);
Device device = deviceList[0];

Axis axis = device.getAxis(1);
// Move by 10000 native units
axis.moveRelative(10000);
% Detect without identification
deviceList = connection.detectDevices(0);
device = deviceList(1);

axis = device.getAxis(1);
% Move by 10000 native units
axis.moveRelative(10000);
// Detect without identification
std::vector<Device> deviceList = connection.detectDevices(false);
Device device = deviceList[0];

Axis axis = device.getAxis(1);
// Move by 10000 native units
axis.moveRelative(10000);