Drivers¶
The Commands available in each driver are displayed in blue and the Subsystems are shown in red or black in a tree. For example, reading the temperature and setting the voltage with the imaginary driver:
is done with
>>> driver = Driver(socket)
>>> driver.temperature.read()
... 25
>>> driver.power_supply.voltage.write(10)
Virtual instrument driver¶
Virtual instrument driver used to test GUIs.
- class pyhard2.driver.virtual.Pid(proportional=2.0, integral_time=0.0, derivative_time=0.0, vmin=0.0, vmax=100.0)¶
Wrap pyhard2.pid.PidController to handle asynchronous setting of output and measure.
- class pyhard2.driver.virtual.Input¶
Linear input simulator.
- class pyhard2.driver.virtual.Output¶
Output simulator using a transfer function.
- class pyhard2.driver.virtual.PidSubsystem(parent, proportional=2.0, integral_time=0.0, derivative_time=0.0, vmin=0.0, vmax=100.0, spmin=0.0, spmax=100.0)¶
The subsystem for the PID.
- class pyhard2.driver.virtual.VirtualInstrument(socket=None)¶
Driver for virtual instruments with a PID.
AML¶
Arun Microelectronics Ltd. gauge drivers
Driver for Arun Microelectronics Ltd. (AML) gauges according to the manual of an NGC2D instrument, the driver should also support PGC1 instruments.
- class pyhard2.driver.aml.Protocol(socket)¶
Communication protocol.
Communication is read only:
- class pyhard2.driver.aml.Ngc2d(socket)¶
Driver for NGC2D ion gauges.
Amtron¶
Drivers for Amtron CS400 family of controllers.
- class pyhard2.driver.amtron.CommunicationProtocol(socket)¶
Communication uses a simple ASCII protocol.
- class pyhard2.driver.amtron.Subsystem(index, parent=None)¶
A Subsystem with an index.
- class pyhard2.driver.amtron.ControlMode¶
Enum for control.control_mode
- CURRENT¶
Control with current.
- POWER¶
Control with the power.
- class pyhard2.driver.amtron.CS400(socket)¶
Driver for the Amtron CS400 family of controllers.
Bronkhorst¶
Drivers for Bronkhorst flow and pressure controllers.
Communication uses the ASCII protocol described in the instruction manual number 9.17.027. The commands and subsystems are described in the instruction manual number 9.17.023.
Note
- The ASCII protocol is implemented.
- This driver requires the Construct library.
- Reference:
- “RS232 interface with FLOW-BUS protocol for digital Mass Flow/Pressure instruments.” Doc. no.: 9.17.027J 13-05-2008.
- “Operation instructions digital Mass Flow/Pressure instruments parameters and properties.” Doc. no.: 9.17.023L 27-05-2008.
- class pyhard2.driver.bronkhorst.Access¶
Access enum with SEC access for secured commands.
- RO, WO, RW, SEC
- class pyhard2.driver.bronkhorst.Subsystem(process, parent=None)¶
Subsystem with process number.
- class pyhard2.driver.bronkhorst.Cmd(reader, type=None, **kwargs)¶
Command with a type attributes.
Parameters: type (str) – {CHAR, UINT, FLOAT, ULONG, STRING} Parameter type. - class Context(command, value=None, node=None)¶
Context with a type attribute.
- class pyhard2.driver.bronkhorst.AsciiProtocol(socket)¶
ASCII protocol.
- class pyhard2.driver.bronkhorst.Controller(socket)¶
Driver for Bronkhorst controllers.
Note
Node 128 broadcasts to every node.
- class pyhard2.driver.bronkhorst.MFC(socket)¶
Instrument for mass-flow controllers.
- class pyhard2.driver.bronkhorst.PC(socket)¶
Instrument for pressure controllers.
DAQ¶
Drivers for National Instrument hardware.
The materials supported is the one supported by NI-DAQmx on Windows and comedi on Linux.
Note
- The driver depends on pycomedi on Linux or PyLibNIDAQmx on Windows.
- The driver requires numpy on all platform.
- Reference:
- class pyhard2.driver.daq.Cmd(**kwargs)¶
Command without reader.
- class Context(command, value=None, node=None)¶
Context with minimum and maximum attributes.
- class pyhard2.driver.daq.Subsystem(device, parent=None)¶
A subsytem with a device attribute.
Parameters: device (string) – The device name.
- class pyhard2.driver.daq.Daq(device, parent=None)¶
Driver for DAQ hardware.
On windows, the node names are portN/lineM for the digital in/out channels and aiN or aoN for the analog input and output.
On linux, the node names are SUBDEVICE.CHANNEL, that is the number of the subdevice and of the channel separated with a dot ..
Parameters: device (str) – The name of the device on windows or its address (example /dev/comedi0) on linux. Example
NI 622x cards have following nodes:
- 32 AI channels: ai[0-31]
- 4 AO channels: ao[0-3]
- 32 DIO channels on port0: port0/line[0-31]
- 8 DIO channels on port1: port1/line[0-7]
- 8 DIO channels on port2: port2/line[0-7]
Use as follows
>>> driver = Daq("NAME") # The actual device name >>> driver.state.read("port0/line3") # windows names ... False >>> driver.state.write(True, "port0/line3") >>> driver.state.read("port0/line3") ... True >>> driver.voltage.ai.read("ai0") ... 0.5 >>> driver.voltage.ao.write(1.0, "ao0")
pylibnidaqmx wrappers to communicate with DAQ hardware on Windows.
- class pyhard2.driver.daq.windaq.DioTask(name='')¶
A class that inherits from both DigitalInputTask and DigitalOutputTask.
Without the double inheritance provided here, DigitalInputTask.read() switches the state off.
- class pyhard2.driver.daq.windaq.DioProtocol(parent=None)¶
Protocol for Digital IO lines.
- class pyhard2.driver.daq.windaq.VoltageAioProtocol(parent=None)¶
Protocol for Analog Input and Analog Output lines.
Comedi wrappers to communicate with DAQ hardware on linux.
Warning
The linux driver is not tested.
- class pyhard2.driver.daq.lindaq.DioProtocol(parent=None)¶
Protocol for Digital IO lines.
- class pyhard2.driver.daq.lindaq.AioProtocol(parent=None)¶
Protocol for Analog Input and Analog Output lines.
Delta-Elektronika¶
Delta-Electronica drivers
- class pyhard2.driver.deltaelektronika.DplProtocol(socket)¶
Communication using the Delta Programming Language (DPL)
Warning
the Delta Programming Language (DPL) has been obsoleted by Delta-Electronica.
- class pyhard2.driver.deltaelektronika.Sm700Series(socket)¶
Driver for Delta Elektronika SM700-Series power supplies.
A Subset of the PSC488 EXT commands is implemented in the dpl subsystem as well as the SCPI-like commands found in the PSC 232 PSC 488 Programming Manual (an html document).
Fluke¶
Fluke drivers
Driver following the technical note entitled: “Fluke 189/187/98-IV/87-IV Remote Interface Specification”
- class pyhard2.driver.fluke.CommunicationProtocol(socket)¶
Protocol for Fluke model 189, 187, 89-IV, and 87-IV digital multimeters.
Commands consist of two-letter codes that are sent from the computer to the meter.
- class pyhard2.driver.fluke.Fluke18x(socket)¶
Driver for the Fluke Series 18x multimeters.
SCPI¶
- class pyhard2.driver.ieee.Ieee488CommunicationProtocol(socket, parent=None)¶
Communication protocol for the IEEE 488.1 standard.
- class pyhard2.driver.ieee.ScpiSubsystem(mnemonic, parent=None)¶
Subsystem with a mnemonic.
- class pyhard2.driver.ieee.ScpiCommunicationProtocol(socket, parent=None)¶
SCPI protocol.
IEEE 488.1 standard.
- class pyhard2.driver.ieee.ieee488_1.Ieee4881(socket, parent=None)¶
IEEE 488.1 Requirements in IEEE 488.2 standard.
Section 4.1
IEEE 488.2 standard.
- class pyhard2.driver.ieee.ieee488_2.Ieee4882(socket, parent=None)¶
IEEE 488.2 Requirements.
- Table 4-4 – Required Status Reporting Common Commands
- Table 4-7 – Required Internal Operation Common Commands
- Table 4-17 – Required Synchronization Commands
- class pyhard2.driver.ieee.ieee488_2.PowerOn(parent)¶
Table 4-5 – Optional Power-On Common Commands
- class pyhard2.driver.ieee.ieee488_2.ParallelPoll(parent)¶
Table 4-6 – Optional Parallel Poll Common Commands
- class pyhard2.driver.ieee.ieee488_2.ResourceDescription(parent)¶
Table 4-8 – Optional Resource Description Common Command
- class pyhard2.driver.ieee.ieee488_2.ProtectedUserData(parent)¶
Table 4-9 – Optional Protected User Data Command
- class pyhard2.driver.ieee.ieee488_2.Calibration(parent)¶
Table 4-10 – Optional Calibration Command
- class pyhard2.driver.ieee.ieee488_2.Trigger(parent)¶
Table 4-11 – Optional Trigger Command
- class pyhard2.driver.ieee.ieee488_2.Macro(parent)¶
Table 4-12 – Optional Trigger Macro Commands Table 4-13 – Optional Macro Commands
- class pyhard2.driver.ieee.ieee488_2.Identification(parent)¶
Table 4-14 – Optional Option Identification Command
- class pyhard2.driver.ieee.ieee488_2.StoredSetting(parent)¶
Table 4-15 – Optional Stored Setting Commands
- class pyhard2.driver.ieee.ieee488_2.Learn(parent)¶
Table 4-16 – Optional Learn Command
- class pyhard2.driver.ieee.ieee488_2.SystemConfiguration(parent)¶
Table 4-18 – Optional System Configuration Commands
- class pyhard2.driver.ieee.ieee488_2.ControlPassing(parent)¶
Table 4-19 – Optional Passing Control Commands
Standard commands for programmable instruments (SCPI).
- class pyhard2.driver.ieee.scpi.ScpiRequired(socket, parent=None)¶
Required commands from the SCPI standard.
Note
SCPI std. mandates IEEE488.2, excluding IEEE488.1. However, hardware vendors do not always follow the standard. Drivers actually following the standard should nest either the Scpi or the 488.2 commands such as:
import pyhard2.driver.ieee.ieee488_2.Ieee4882 as Ieee4882 import pyhard2.driver.ieee.scpi.ScpiRequired as Scpi ScpiDriver(Scpi): def __init__(self, socket): super(ScpiDriver, self).__init__(socket) self.common = Ieee4882(socket, self) # Continue definition.
- class pyhard2.driver.ieee.scpi.ScpiDigitalMeter(socket, meter_fn, parent=None)¶
SCPI Instrument Classes - 3 Digital Meters
Base functionality of a digital meter.
- class pyhard2.driver.ieee.scpi.ScpiDCVoltmeter(socket, parent=None)¶
SCPI Voltmeter.
- class pyhard2.driver.ieee.scpi.ScpiPowerSupply(socket, parent=None)¶
SCPI Instrument Classes - 7 Power Supplies.
Peaktech¶
Drivers for the Peaktech PT1885 power supply.
- class pyhard2.driver.peaktech.CommunicationProtocol(socket)¶
Communication uses an ASCII protocol:
- class pyhard2.driver.peaktech.Pt1885(socket)¶
Driver for Peaktech PT1885 power supplies.
Pfeiffer¶
Drivers for the Pfeiffer TPG 256 A MaxiGauge controller.
- class pyhard2.driver.pfeiffer.CommunicationProtocol(socket)¶
Driver for the Pfeiffer Maxigauge.
The protocol used is similar to ANSI X3.
- class pyhard2.driver.pfeiffer.Maxigauge(socket)¶
Maxigauge subsystem.
Watlow¶
Drivers for Watlow Series 988 family of controllers.
Note
The XON/XOFF protocol is implemented.
- class pyhard2.driver.watlow.XonXoffProtocol(socket)¶
Communication using the XON/XOFF protocol follows:
- class pyhard2.driver.watlow.Series988(socket)¶
Driver for the Watlow Series 988 family of controllers.