Skip to content

Adding paths to the Registry

Kyle Matsuda edited this page Nov 24, 2020 · 3 revisions

The Registry server has a directory-like structure that holds dictionaries used by Labrad.

Our most common use case is adding new paths to the Registry, so available Labrad servers can be automatically detected on each node.

  1. Start ipython and run the following:
import labrad
cxn = labrad.connect()
r = cxn.registry()

This should print out a list of available methods to run on the server. Note the directory-like structure (with commands like cd(), dir(), etc.). Running r.dir() should return a 2-tuple of arrays. The first element of the tuple is the list of available subdirectories. Each directory also has a dictionary-like structure, and the second element of the tuple displays the available dictionary keys.

  1. Navigate to your node by running the following:
r.cd('Nodes')
r.cd('NAME_OF_YOUR_NODE')
r.dir()

'NAME_OF_YOUR_NODE' above should be replaced with the actual name of your node. You should get the following output, `([], ['autostart', 'directories', 'extensions'])', indicating the available dictionary keys.

  1. Set the new path by running
r.set('directories', ['FULL_PATH_TO_YOUR_LABRAD_TOOLS_FOLDER'])

You can do r.get('directories') to check that this worked.

  1. Finally, to check that everything is working, run:
cxn.servers['node_' + 'NAME_OF_YOUR_NODE'].available_servers()

You should see a list of all the available servers in your labrad_tools/ folder on the new node.

Table of contents

Intro

Getting started

Clone this wiki locally