Devices

Core

pychron.hardware.core.abstract_device.AbstractDevice
pychron.hardware.core.base_core_device.BaseCoreDevice
pychron.hardware.core.core_device.CoreDevice

alias of builtins.str

class pychron.hardware.core.scanable_device.ScanableDevice(*args, **kwargs)[source]
start_scan(period=None)[source]
Parameters

period – delapy between triggers in milliseconds

Returns

class pychron.hardware.core.viewable_device.ViewableDevice(*args, **kwargs)[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, **kw)[source]

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

delay(ms)[source]

sleep ms milliseconds

load(config, path)[source]
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, **kw)[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.

ask(cmd, is_hex=False, verbose=True, delay=None, replace=None, remove_eol=True, info=None, nbytes=None, handshake_only=False, handshake=None, read_terminator=None, terminator_position=None, nchars=None)[source]
load(config, path)[source]
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

read(nchars=None, *args, **kw)[source]
tell(cmd, is_hex=False, info=None, verbose=True, **kw)[source]
class pychron.hardware.core.communicators.gpib_communicator.GpibCommunicator(*args, **kw)[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

load(config, path, **kw)[source]
open(*args, **kw)[source]
class pychron.hardware.core.communicators.ethernet_communicator.EthernetCommunicator(*args, **kw)[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

load(config, path)[source]
open(*args, **kw)[source]
class pychron.hardware.core.communicators.mcode_communicator.MDriveCommunicator(*args, **kw)[source]
open()[source]
class pychron.hardware.core.communicators.modbus_communicator.ModbusCommunicator(*args, **kw)[source]

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

load(config, path)[source]
read(register, response_type='float', nregisters=1, **kw)[source]
read_holding_register(holdid, nregisters, response_type, **kw)[source]
set_multiple_registers(startid, nregisters, value, response_type, **kw)[source]
set_single_register(rid, value, response_type, func_code='06', **kw)[source]
tell(*args, **kw)[source]
write(register, value, nregisters=1, response_type='register_write', **kw)[source]
class pychron.hardware.core.communicators.scheduler.CommunicationScheduler(*args, **kw)[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, **kwargs)[source]
close_channel(*args, **kw)[source]
get_channel_state(*args, **kw)[source]
load_additional_args(config)[source]
open_channel(*args, **kw)[source]

ADC

Aerotech

Agilent

Arduino

Eurotherm

Fusions

Gauges

Kerr

Labjack

MDrive

NCD

Newport