Expert macros

class addctrllib(*args, **kwargs)[source]

Adds the given controller library code to the pool server filesystem.


Currently this macro does not report eventual errors, for example Python syntax errors, in the controller plugin module. So if it silently exits but the controller library is not correctly loaded please check the server logs for more information.

class addmaclib(*args, **kwargs)[source]

Loads a new macro library.


Keep in mind that macros from the new library can override macros already present in the system.

class commit_ctrllib(*args, **kwargs)[source]

Puts the contents of the given data in a file inside the pool

class defctrl(*args, **kwargs)[source]

Creates a new controller ‘role_prop’ is a sequence of roles and/or properties. - A role is defined as <role name>=<role value> (only applicable to pseudo controllers) - A property is defined as <property name> <property value>

If both roles and properties are supplied, all roles must come before properties. All controller properties that don’t have default values must be given.

Example of creating a motor controller (with a host and port properties):

[1]: defctrl SuperMotorController myctrl host port 5000

Example of creating a Slit pseudo motor (sl2t and sl2b motor roles, Gap and Offset pseudo motor roles):

[1]: defctrl Slit myslit sl2t=mot01 sl2b=mot02 Gap=gap01 Offset=offset01

class defelem(*args, **kwargs)[source]

Creates an element on a controller with an axis

class defm(*args, **kwargs)[source]

Creates a new motor in the active pool

class defmeas(*args, **kwargs)[source]

Create a new measurement group. First channel in channel_list MUST be an internal sardana channel. At least one channel MUST be a Counter/Timer (by default, the first Counter/Timer in the list will become the master).

class edctrlcls(*args, **kwargs)[source]

Returns the contents of the library file which contains the given controller code.

class edctrllib(*args, **kwargs)[source]

Returns the contents of the given library file

class prdef(*args, **kwargs)[source]

Returns the the macro code for the given macro name.

class relctrlcls(*args, **kwargs)[source]

Reloads the given controller class code from the pool server filesystem.

class relctrllib(*args, **kwargs)[source]

Reloads the given controller library code from the pool server filesystem.

class rellib(*args, **kwargs)[source]

Reloads the given python library code from the macro server filesystem.


use with extreme care! Accidentally reloading a system module or an installed python module may lead to unpredictable behavior


Prior to the Sardana version 1.6.0 this macro was successfully reloading python libraries located in the MacroPath. The MacroPath is not a correct place to locate your python libraries. They may be successfully loaded on the MacroServer startup, but this can not be guaranteed. In order to use python libraries within your macro code, locate them in either of valid system PYTHONPATH or MacroServer PythonPath property (of the host where MacroServer runs). In order to achieve the previous behavior, just configure the the same directory in both system PYTHONPATH (or MacroServer’s PythonPath) and MacroPath.


if python module is used by any macro, don’t forget to reload the corresponding macros afterward so the changes take effect.

class relmac(*args, **kwargs)[source]

Reloads the given macro code from the macro server filesystem. Attention: All macros inside the same file will also be reloaded.

class relmaclib(*args, **kwargs)[source]

Reloads the given macro library code from the macro server filesystem.

class send2ctrl(*args, **kwargs)[source]

Sends the given data directly to the controller

class udefctrl(*args, **kwargs)[source]

Deletes existing controllers

class udefelem(*args, **kwargs)[source]

Deletes existing elements

class udefmeas(*args, **kwargs)[source]

Deletes existing measurement groups

class sar_info(*args, **kwargs)[source]

Prints details about the given sardana object