ioregister

IORegister related macros

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

Writes a value to an input register

param_def = [['input/output register', 'IORegister', None, 'input/output register'], ['data', 'Float', None, 'value to be send']]

This property holds the macro parameter description. It consists of a sequence of parameter information objects. A parameter information object is either:

  1. a simple parameter object

  2. a parameter repetition object

A simple parameter object is a sequence of:

  1. a string representing the parameter name

  2. a member of Macro.Type representing the parameter data type

  3. a default value for the parameter or None if there is no default value

  4. a string with the parameter description

Example:

param_def = ( ('value', Type.Float, None, 'a float parameter' ) )

A parameter repetition object is a sequence of:

  1. a string representing the parameter repetition name

  2. a sequence of parameter information objects

  3. a dictionary representing the parameter repetition semantics or None to use the default parameter repetition semantics. Dictionary keys are:

    • min - integer representing minimum number of repetitions or None for no minimum.

    • max - integer representing maximum number of repetitions or None for no maximum.

    Default parameter repetition semantics is { 'min': 1, 'max' : None } (in other words, “at least one repetition” semantics)

Example:

param_def = (
    ( 'motor_list', ( ( 'motor', Type.Motor, None, 'motor name') ), None, 'List of motors')
)
run(ioreg, data)[source]

Macro API. Runs the macro. Overwrite MANDATORY! Default implementation raises RuntimeError.

Raises:

RuntimeError

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

Reads an output register

param_def = [['input/output register', 'IORegister', None, 'input/output register']]

This property holds the macro parameter description. It consists of a sequence of parameter information objects. A parameter information object is either:

  1. a simple parameter object

  2. a parameter repetition object

A simple parameter object is a sequence of:

  1. a string representing the parameter name

  2. a member of Macro.Type representing the parameter data type

  3. a default value for the parameter or None if there is no default value

  4. a string with the parameter description

Example:

param_def = ( ('value', Type.Float, None, 'a float parameter' ) )

A parameter repetition object is a sequence of:

  1. a string representing the parameter repetition name

  2. a sequence of parameter information objects

  3. a dictionary representing the parameter repetition semantics or None to use the default parameter repetition semantics. Dictionary keys are:

    • min - integer representing minimum number of repetitions or None for no minimum.

    • max - integer representing maximum number of repetitions or None for no maximum.

    Default parameter repetition semantics is { 'min': 1, 'max' : None } (in other words, “at least one repetition” semantics)

Example:

param_def = (
    ( 'motor_list', ( ( 'motor', Type.Motor, None, 'motor name') ), None, 'List of motors')
)
result_def = [['input/output register value', 'Float', None, 'value read from the input/output register']]

This property holds the macro result description. It a single parameter information object.

See also

param_def

run(ioreg)[source]

Macro API. Runs the macro. Overwrite MANDATORY! Default implementation raises RuntimeError.

Raises:

RuntimeError