taco Package

taco Package

Package for TACO device classes in NICOS.

axis Module

NICOS axis classes.

class nicos.taco.axis.Axis(name, **config)

Bases: nicos.taco.core.TacoDevice, nicos.abstract.Axis

Bases: TacoDevice, Axis

Interface for TACO Axis server devices.

User methods

reference()

Do a reference drive of the axis (do not use with encoded axes).

setPosition(pos)

Sets the current position of the axis to the target.

Parameters

accel (float, settable at runtime)

Motor acceleration. Default value: 0.0. Unit: main/s^2.

refpos (float, settable at runtime)

Position of the reference switch. Default value: 0.0. Unit: same as device value.

refspeed (float, settable at runtime)

Speed driving to reference switch. Default value: 0.0. Unit: main/s.

refswitch (str, settable at runtime)

Switch to use as reference. Default value: ''.

speed (float, settable at runtime)

Motor speed. Default value: 0.0. Unit: main/s.

Parameters inherited from the base classes: abslimits, backlash, description, dragerror, fixed, fmtstr, loglevel, loopdelay, lowlevel, maxage, maxtries, offset, pollinterval, precision, tacodelay, tacodevice, tacotimeout, tacotries, target, unit, userlimits

class nicos.taco.axis.HoveringAxis(name, **config)

Bases: nicos.taco.axis.Axis

Bases: Axis

A TACO axis that also controls air for airpads.

Attached devices

switch

The device used for switching air on and off. Type: Moveable.

Parameters

startdelay (float, mandatory in setup)

Delay after switching on air. Unit: s.

stopdelay (float, mandatory in setup)

Delay before switching off air. Unit: s.

switchvalues (a tuple of (any value, any value))

(off, on) values to write to switch device. Default value: (0, 1).

Parameters inherited from the base classes: abslimits, accel, backlash, description, dragerror, fixed, fmtstr, loglevel, loopdelay, lowlevel, maxage, maxtries, offset, pollinterval, precision, refpos, refspeed, refswitch, speed, tacodelay, tacodevice, tacotimeout, tacotries, target, unit, userlimits

coder Module

Taco coder class for NICOS.

class nicos.taco.coder.Coder(name, **config)

Bases: nicos.taco.core.TacoDevice, nicos.abstract.Coder

Bases: TacoDevice, Coder

TACO coder implementation class.

Parameters inherited from the base classes: description, fmtstr, loglevel, lowlevel, maxage, pollinterval, precision, tacodelay, tacodevice, tacotimeout, tacotries, unit

core Module

NICOS-TACO base classes.

class nicos.taco.core.ProxyTacoDevice

Bases: nicos.taco.core.TacoDevice

Bases: TacoDevice

Parameters inherited from the base classes: tacodelay, tacodevice, tacotimeout, tacotries

class nicos.taco.core.TacoDevice

Bases: object

Mixin class for TACO devices.

Use it in concrete device classes like this:

class Counter(TacoDevice, Measurable):
    taco_class = IO.Counter

    # more overwritten methods

i.e., put TacoDevice first in the base class list.

TacoDevice provides the following methods already:

  • doVersion (returns TACO device version)
  • doPreinit (creates the TACO device from the tacodevice parameter)
  • doRead (reads the TACO device)
  • doStatus (returns status.OK for ON and DEVICE_NORMAL, ERROR otherwise)
  • doReset (resets the TACO device)
  • doReadUnit (reads the unit parameter from the TACO device if not configured in setup)

You can however override them and provide your own specialized implementation.

TacoDevice subclasses will automatically log all calls to TACO if their loglevel is DEBUG.

TacoDevice also has the following class attributes, which can be overridden in derived classes:

  • taco_class – the Python class to use for the TACO client
  • taco_resetok – a boolean value indicating if the device can be reset during connection if it is in error state
  • taco_errorcodes – a dictionary mapping TACO error codes to NICOS exception classes

The following utility methods are provided:

_taco_guard(function, *args)

Try running the TACO function, and raise a NicosError on exception.

A more specific NicosError subclass is chosen if appropriate. For example, database-related errors are converted to CommunicationError. A TacoDevice subclass can add custom error code to exception class mappings by using the taco_errorcodes class attribute.

If the tacotries parameter is > 1, the call is retried accordingly.

_taco_multitry(what, tries, func, *args)

Try the TACO method func with given args for the number of times given by tries. On each failure, a warning log message is emitted. If the device is in error state after a try, it is reset. If the number of tries is exceeded, the error from the call is re-raised.

what is a string that explains the call; it is used in the warning messages.

_taco_update_resource(resname, value)

Update the TACO resource resname to value (both must be strings), switching the device off and on.

_create_client(devname=None, class_=None, resetok=None, timeout=None)

Create a new TACO client to the device given by devname, using the Python class class_. Initialize the device in a consistent state, handling eventual errors.

If no arguments are given, the values of devname, class_, resetok and timeout are taken from the class attributes taco_class and taco_resetok as well as the device parameters tacodevice and tacotimeout. This is done during doPreinit, so that you usually don’t have to call this method in TacoDevice subclasses.

You can use this method to create additional TACO clients in a device implementation that uses more than one TACO device.

Parameters

tacodelay (float, settable at runtime)

Delay between retries. Default value: 0.10000000000000001. Unit: s.

tacodevice (a valid taco device, mandatory in setup, initialized for preinit)

TACO device name.

tacotimeout (float, settable at runtime, initialized for preinit)

TACO client network timeout. Default value: 3. Unit: s.

tacotries (an integer in the range [1, 10), settable at runtime)

Number of tries per TACO call. Default value: 1.

class nicos.taco.core.TacoStub(mod, cls, dev)

Bases: object

detector Module

Detector classes for NICOS.

class nicos.taco.detector.FRMChannel(name, **config)

Bases: nicos.taco.core.TacoDevice, nicos.core.device.Measurable

Bases: TacoDevice, Measurable

Base class for one channel of the FRM-II counter card.

Use one of the concrete classes FRMTimerChannel or FRMCounterChannel.

Parameters

ismaster (bool, settable at runtime)

If this channel is a master. Default value: False.

mode (one of 'normal', 'ratemeter', 'preselection', settable at runtime)

Channel mode: normal, ratemeter, or preselection. Default value: 'preselection'.

preselection (float, settable at runtime)

Preselection for this channel. Default value: 0.0.

Parameters inherited from the base classes: description, fmtstr, loglevel, lowlevel, maxage, pollinterval, tacodelay, tacodevice, tacotimeout, tacotries, unit

class nicos.taco.detector.FRMCounterChannel(name, **config)

Bases: nicos.taco.detector.FRMChannel

Bases: FRMChannel

Parameters

type (one of 'monitor', 'counter', mandatory in setup)

Type of channel: monitor or counter.

Parameters inherited from the base classes: description, fmtstr, ismaster, loglevel, lowlevel, maxage, mode, pollinterval, preselection, tacodelay, tacodevice, tacotimeout, tacotries, unit

class nicos.taco.detector.FRMDetector(name, **config)

Bases: nicos.core.device.Measurable

Bases: Measurable

The standard detector at FRM-II, using the FRM-II counter card.

Attached devices

counters

Counter channels. Type: a list of FRMChannel.

monitors

Monitor channels. Type: a list of FRMChannel.

timer

Timer channel. Type: FRMChannel.

Parameters inherited from the base classes: description, fmtstr, loglevel, lowlevel, maxage, pollinterval, unit

class nicos.taco.detector.FRMTimerChannel(name, **config)

Bases: nicos.taco.detector.FRMChannel

Bases: FRMChannel

Parameters inherited from the base classes: description, fmtstr, ismaster, loglevel, lowlevel, maxage, mode, pollinterval, preselection, tacodelay, tacodevice, tacotimeout, tacotries, unit

io Module

Implementation of TACO I/O devices.

class nicos.taco.io.AnalogInput(name, **config)

Bases: nicos.taco.core.TacoDevice, nicos.core.device.Readable

Bases: TacoDevice, Readable

Base class for TACO AnalogInput devices.

This class can be used for concrete devices, or other more specific device classes can be derived from it.

Parameters inherited from the base classes: description, fmtstr, loglevel, lowlevel, maxage, pollinterval, tacodelay, tacodevice, tacotimeout, tacotries, unit

class nicos.taco.io.AnalogOutput(name, **config)

Bases: nicos.taco.core.TacoDevice, nicos.core.device.HasLimits, nicos.core.device.Moveable

Bases: TacoDevice, HasLimits, Moveable

Base class for TACO AnalogOutput devices.

This class can be used for concrete devices, or other more specific device classes can be derived from it.

Parameters

loopdelay (float)

Wait loop delay. Default value: 0.29999999999999999. Unit: s.

Parameters inherited from the base classes: abslimits, description, fixed, fmtstr, loglevel, lowlevel, maxage, pollinterval, tacodelay, tacodevice, tacotimeout, tacotries, target, unit, userlimits

class nicos.taco.io.BitsDigitalOutput(name, **config)

Bases: nicos.taco.io.DigitalOutput

Bases: DigitalOutput

Base class for a TACO DigitalOutput that works with a tuple of individual bits instead of a single integer.

Parameters

bitwidth (int)

Number of bits. Default value: 1.

startbit (int)

Number of the first bit. Default value: 0.

Parameters inherited from the base classes: description, fixed, fmtstr, loglevel, lowlevel, maxage, pollinterval, tacodelay, tacodevice, tacotimeout, tacotries, target, unit

class nicos.taco.io.DigitalInput(name, **config)

Bases: nicos.taco.core.TacoDevice, nicos.core.device.Readable

Bases: TacoDevice, Readable

Base class for TACO DigitalInput devices. The values are plain integers.

This class can be used for concrete devices, or other more specific device classes can be derived from it.

Parameters inherited from the base classes: description, fmtstr, loglevel, lowlevel, maxage, pollinterval, tacodelay, tacodevice, tacotimeout, tacotries, unit

class nicos.taco.io.DigitalOutput(name, **config)

Bases: nicos.taco.core.TacoDevice, nicos.core.device.Moveable

Bases: TacoDevice, Moveable

Base class for TACO DigitalOutputs.

This class can be used for concrete devices, or other more specific device classes can be derived from it.

Parameters inherited from the base classes: description, fixed, fmtstr, loglevel, lowlevel, maxage, pollinterval, tacodelay, tacodevice, tacotimeout, tacotries, target, unit

class nicos.taco.io.MultiDigitalOutput(name, **config)

Bases: nicos.core.device.Moveable

Bases: Moveable

Writes the same value to multiple digital outputs at once.

Attached devices

outputs

A list of digital outputs to switch simultaneously. Type: a list of DigitalOutput.

Parameters inherited from the base classes: description, fixed, fmtstr, loglevel, lowlevel, maxage, pollinterval, target, unit

class nicos.taco.io.NamedDigitalInput(name, **config)

Bases: nicos.taco.io.DigitalInput

Bases: DigitalInput

A DigitalInput with numeric values mapped to names.

Parameters

mapping (a dict of int keys and str values)

A dictionary mapping integer values to names. Default value: {}.

Parameters inherited from the base classes: description, fmtstr, loglevel, lowlevel, maxage, pollinterval, tacodelay, tacodevice, tacotimeout, tacotries, unit

class nicos.taco.io.NamedDigitalOutput(name, **config)

Bases: nicos.taco.io.DigitalOutput

Bases: DigitalOutput

A DigitalOutput with numeric values mapped to names.

Parameters

mapping (a dict of int keys and str values)

A dictionary mapping integer values to names. Default value: {}.

Parameters inherited from the base classes: description, fixed, fmtstr, loglevel, lowlevel, maxage, pollinterval, tacodelay, tacodevice, tacotimeout, tacotries, target, unit

class nicos.taco.io.PartialDigitalInput(name, **config)

Bases: nicos.taco.io.NamedDigitalInput

Bases: NamedDigitalInput

Base class for a TACO DigitalOutput with only a part of the full bit width accessed.

Parameters

bitwidth (int)

Number of bits. Default value: 1.

startbit (int)

Number of the first bit. Default value: 0.

Parameters inherited from the base classes: description, fmtstr, loglevel, lowlevel, mapping, maxage, pollinterval, tacodelay, tacodevice, tacotimeout, tacotries, unit

class nicos.taco.io.PartialDigitalOutput(name, **config)

Bases: nicos.taco.io.NamedDigitalOutput

Bases: NamedDigitalOutput

Base class for a TACO DigitalOutput with only a part of the full bit width accessed.

Parameters

bitwidth (int)

Number of bits. Default value: 1.

startbit (int)

Number of the first bit. Default value: 0.

Parameters inherited from the base classes: description, fixed, fmtstr, loglevel, lowlevel, mapping, maxage, pollinterval, tacodelay, tacodevice, tacotimeout, tacotries, target, unit

motor Module

Taco motor class for NICOS.

class nicos.taco.motor.Motor(name, **config)

Bases: nicos.taco.core.TacoDevice, nicos.abstract.Motor

Bases: TacoDevice, Motor

TACO motor implementation class.

Parameters inherited from the base classes: abslimits, description, fixed, fmtstr, loglevel, lowlevel, maxage, pollinterval, precision, speed, tacodelay, tacodevice, tacotimeout, tacotries, target, unit, userlimits

power Module

TACO power supply classes.

class nicos.taco.power.CurrentSupply(name, **config)

Bases: nicos.taco.power.Supply

Bases: Supply

Concrete device for TACO current supplies.

Parameters inherited from the base classes: abslimits, description, fixed, fmtstr, loglevel, lowlevel, maxage, offset, pollinterval, ramp, tacodelay, tacodevice, tacotimeout, tacotries, target, unit, userlimits, variance

class nicos.taco.power.Supply(name, **config)

Bases: nicos.core.device.HasOffset, nicos.core.device.HasLimits, nicos.taco.core.TacoDevice, nicos.core.device.Moveable

Bases: HasOffset, HasLimits, TacoDevice, Moveable

Base class for TACO power supplies.

This is a common base class, please use either CurrentSupply or VoltageSupply for concrete devices.

Parameters

ramp (float, settable at runtime)

Ramp for the supply; can be zero to deactivate ramping. Default value: 0. Unit: main/min.

variance (float)

Variance of the read value to the write value; can be zero to deactivate variance check. Default value: 0. Unit: %.

Parameters inherited from the base classes: abslimits, description, fixed, fmtstr, loglevel, lowlevel, maxage, offset, pollinterval, tacodelay, tacodevice, tacotimeout, tacotries, target, unit, userlimits

class nicos.taco.power.VoltageSupply(name, **config)

Bases: nicos.taco.power.Supply

Bases: Supply

Concrete device for TACO voltage supplies.

Parameters inherited from the base classes: abslimits, description, fixed, fmtstr, loglevel, lowlevel, maxage, offset, pollinterval, ramp, tacodelay, tacodevice, tacotimeout, tacotries, target, unit, userlimits, variance

temperature Module

NICOS temperature controller classes.

class nicos.taco.temperature.TemperatureController(name, **config)

Bases: nicos.taco.core.TacoDevice, nicos.core.device.HasLimits, nicos.core.device.HasOffset, nicos.core.device.Moveable

Bases: TacoDevice, HasLimits, HasOffset, Moveable

TACO temperature controller device.

Parameters

controlchannel (str, settable at runtime)

Control channel, possible values depend on the type of device. Default value: ''.

d (float, settable at runtime)

The D control parameter. Default value: 0.0.

i (float, settable at runtime)

The I control parameter. Default value: 0.0.

loopdelay (float, settable at runtime)

Sleep time when waiting. Default value: 1. Unit: s.

mode (one of 'manual', 'zone', 'openloop', settable at runtime)

Control mode (manual, zone or openloop). Default value: 'manual'.

p (float, settable at runtime)

The P control parameter. Default value: 0.0.

ramp (float, settable at runtime)

Temperature ramp in K/min. Default value: 0.0. Unit: K/min.

setpoint (float)

Current temperature setpoint. Default value: 0.0. Unit: same as device value.

timeout (float, settable at runtime)

Maximum time to wait for stable temperature. Default value: 0.0. Unit: s.

timeoutaction (one of 'continue', 'raise', settable at runtime)

What to do when a timeout occurs. Default value: 'continue'.

tolerance (float, settable at runtime)

The window’s temperature tolerance. Default value: 0.0. Unit: K.

window (float, settable at runtime)

Time window for checking stable temperature. Default value: 0.0. Unit: s.

Parameters inherited from the base classes: abslimits, description, fixed, fmtstr, loglevel, lowlevel, maxage, offset, pollinterval, tacodelay, tacodevice, tacotimeout, tacotries, target, unit, userlimits

class nicos.taco.temperature.TemperatureSensor(name, **config)

Bases: nicos.taco.core.TacoDevice, nicos.core.device.Readable

Bases: TacoDevice, Readable

TACO temperature sensor device.

Parameters inherited from the base classes: description, fmtstr, loglevel, lowlevel, maxage, pollinterval, tacodelay, tacodevice, tacotimeout, tacotries, unit

Table Of Contents

Previous topic

sessions Package

Next topic

tas Package