Example controller

This is an example of a controller with a fake (invented) device. It should help to gide developers to create new controllers for real devices.

class hyperion.controller.example_controller.ExampleController(settings)

Example output device that does not connect to anything

amplitude

Gets the amplitude value.

Getter:
Returns:amplitude value in Volts
Return type:float
Setter:
Parameters:value (float) – value for the amplitude to set in Volts

For example, to use the getter you can do the following ampl = this_controller.amplitude For example, using the setter looks like this: this_controller.amplitude = 5

finalize()

This method closes the connection to the device. It is ran automatically if you use a with block

idn()

Identify command

Returns:identification for the device
Return type:string
initialize()

Starts the connection to the device in port

query(msg)

writes into the device msg

Parameters:msg (string) – command to write into the device port
read()

Fake read that returns always the value in the dictionary FAKE RESULTS.

Returns:fake result
Return type:string
write(msg)

Writes into the device :param msg: message to be written in the device port :type msg: string

class hyperion.controller.example_controller.ExampleControllerDummy(settings)

A dummy version of the Example Controller.

In essence we have the same methods and we re-write the query to answer something meaningful but without connecting to the real device.

query(msg)

writes into the device msg

Parameters:msg (string) – command to write into the device port