Devices communicating via cache

class nicos.generic.cache.CacheReader

Bases: Readable

A readable device that gets values exclusively via cache.

This is useful for devices that cannot be usefully integrated into NICOS, but that can be coerced to write their current value into the NICOS cache. NICOS will then rely on the cache to supply current values for the device; if there is no such value in the cache, a CommunicationError will be raised. The status is likewise read from the cache; if none is present, status.UNKNOWN is returned.

Devices must write into the cache under the keys nicos/devname/value and nicos/devname/status, where devname is the NICOS device name configured in the setup.

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

class nicos.generic.cache.CacheWriter

Bases: HasLimits, Moveable

A moveable device that writes values via the cache.

This is the equivalent to CacheReader for moveable devices. The device is expected to itself subscribe to cache updates relating to its subkeys, and deliver value updates via the cache as well.

This class will write setpoint changes into the cache under the key nicos/devname/setkey, where devname is the NICOS device name, and setkey is given by the device parameter.

Parameters

loopdelay (float, settable at runtime)

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

setkey (str)

Subkey to use to set the device value. Default value: 'setpoint'.

timeout (float, settable at runtime)

Timeout for checking stabilization. Default value: 900.0. Unit: s.

tolerance (float, settable at runtime)

Size of the stabilization window. Default value: 1.0. Unit: same as device value.

window (float, settable at runtime)

Time window for checking stabilization (zero for no stabilization check). Default value: 0.0. Unit: s.

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

Previous topic

Manual moveable classes

Next topic

System related devices