Devices

Core

class pychron.hardware.core.abstract_device.AbstractDevice(*args: Any, **kwargs: Any)
class pychron.hardware.core.base_core_device.BaseCoreDevice
blocking_poll()
get_random_value()
load()
load_additional_args()
pychron.hardware.core.core_device.CoreDevice

alias of str

class pychron.hardware.core.scanable_device.ScanableDevice(*args: Any, **kwargs: Any)[source]
alarms

alias of pychron.hardware.core.alarm.Alarm

start_scan(period=None)[source]
Parameters

period – delapy between triggers in milliseconds

Returns

class pychron.hardware.core.viewable_device.ViewableDevice(*args: Any, **kwargs: Any)[source]
class pychron.hardware.core.scpi_device.SCPIDevice[source]
configure_instrument()[source]

subclass should define this method

get_measurement()[source]

return a value read from the device

initialize(*args, **kw)[source]

initialize instrument

trigger()[source]

trigger a measurement. should be followed by a FETCH? (AgilentDMM.get_value)

Communicators

class pychron.hardware.core.communicators.communicator.Communicator(*args: Any, **kwargs: Any)[source]

Base class for all communicators, e.g. SerialCommunicator, EthernetCommunicator

delay(ms)[source]

sleep ms milliseconds

log_response(cmd, re, info=None)[source]

Log command and response as an INFO message

log_tell(cmd, info=None)[source]

Log command as and INFO message

class pychron.hardware.core.communicators.serial_communicator.SerialCommunicator(*args: Any, **kwargs: Any)[source]

Base Class for devices that communicate using a rs232 serial port. Using Keyspan serial converter is the best option for a Mac class is built on top of pyserial. Pyserial is used to create a handle and this class uses the handle to read and write. handles are created when a serial device is opened setup args are loaded using load(). this method should be overwritten to load specific items.

open(**kw)[source]

Use pyserial to create a handle connected to port wth baudrate default handle parameters baudrate=9600 bytesize=EIGHTBITS parity= PARITY_NONE stopbits= STOPBITS_ONE timeout=None

class pychron.hardware.core.communicators.gpib_communicator.GpibCommunicator(*args: Any, **kwargs: Any)[source]

uses PyVisa as main interface to GPIB. currently (8/27/14) need to use a 32bit python version. The NI488.2 framework does not work with a 64bit distribution

class pychron.hardware.core.communicators.ethernet_communicator.EthernetCommunicator(*args: Any, **kwargs: Any)[source]

Communicator of UDP or TCP.

ask(cmd, retries=3, verbose=True, quiet=False, info=None, timeout=None, message_frame=None, delay=None, use_error_mode=True, *args, **kw)[source]

@param cmd: ASCII text to send @param retries: number of retries if command fails @param verbose: add to log @param quiet: if true do not log the response @param info: str to add to response @param timeout: timeout in seconds @param message_frame: MessageFrame object @param delay: delay in seconds to wait before a cmd is sent

class pychron.hardware.core.communicators.mcode_communicator.MDriveCommunicator(*args: Any, **kwargs: Any)[source]
class pychron.hardware.core.communicators.modbus_communicator.ModbusCommunicator(*args: Any, **kwargs: Any)[source]

modbus message syntax [Device address][function code][data][error check]

class pychron.hardware.core.communicators.scheduler.CommunicationScheduler(*args: Any, **kwargs: Any)[source]

this class should be used when working with multiple rs485 devices on the same port.

it uses a simple lock and sleep cycle to avoid collision on the data lines

when setting up the devices use device.set_scheduler to set the shared scheduler

Actuators

class pychron.hardware.actuators.actuator.Actuator(*args: Any, **kwargs: Any)[source]

ADC

Aerotech

Agilent

Arduino

Eurotherm

Fusions

Gauges

Kerr

Labjack

MDrive

NCD

Newport