nqontrol.servodevice package

Module contents

Main part of ServoDevice.

class nqontrol.servodevice.ServoDevice(deviceNumber=0, readFromFile=None, reboot=False, keep_state=False, adw=None)[source]

Bases: object

A ServoDevice is the whole device, containing 8 (default can be changed) single servos.

With this object you can control one ADwin device and manage all servos of this device.

Parameters
  • deviceNumber (int) –

    Number of the ADwin device on this system. The number can be skipped when loading a ServoDevice from file.

    You have to set it using the tool adconfig. See [installation](install) for configuration details.

  • readFromFile (str) – Select a filename if you want to open a whole ServoDevice with all servos from a saved json file.

  • keep_state (bool) – Do not change the state of a running ADwin device.

reboot()

Make a reboot of the ADwin device.

property servoDesign

Return the dummy ServoDesign object associated with the device.

Getter

The ServoDesign object.

Type

openqlab.analysis.servo_design.ServoDesign

property timestamp

Get the current time stamp of the ADwin device.

It is a counter that ist started on booting and counts the runtime in seconds. It is mainly a debugging feature to see that the device is running.

Getter

Runtime in seconds.

Type

int

property workload

Get the current workload of the ADwin device.

Getter

CPU load (0 to 100).

Type

int

loadDeviceFromJson(filename=None, keep_state=False)

Load a device with all servos from json file.

Read the deviceNumber only if it is called from the constructor, because it can not be changed for an existing ServoDevice.

Parameters

filename (str) – Filename with a saved ServoDevice state.

loadServoFromJson(channel, applySettings, keep_state=False)
saveDeviceToJson(filename=None)

Save the settings of this device and all servos to a json file.

Parameters

filename (str) – Filename of the output file. It will be overwritten without asking.

disableMonitor(monitor_channel)

Disable the selected monitor channel.

Parameters

monitor_channel (int) – Channel to disable the output.

enableMonitor(monitor_channel, servo, card)
property monitors

Return the list of parameters monitor configurations of the device.

Getter

List of monitor parameters. Each entry is a list containing servo index and card String.

Setter

Set the list of parameters for ADwin monitor channels.

Type

list

addServo(channel, applySettings=None, name=None, keep_state=False)
list_servos()
removeServo(channel)
servo(channel)
servo_iterator()