Source code for device_client.client_langmuir_sourcemeter
from device_client import DeviceClient
from device.source_meter_ki2400 import SourceMeter_KI2400
description = """
Keithley 2400 Source Meter.
Use command **Set Channel** to select the channel on the switch box. Check
the box manually to see which channel is connected to which probe. Currently,
the connections should be as follows:
- Channel 1 is connected to the LP at Magnetic trap experiment.
- Channel 2 is connected to the LP at the Langmuir experiment.
- Channel 3 is not connected.
Then use the command **Sweep** to conduct a voltage sweep in given range (min to max)
and with given voltage step. Running long sweeps with more than 250 points
may cause issues (not tested).
A sweep may take several seconds. When finished, a datafile should appear
together with a preview graph of the I-V characteristics.
"""
[docs]
def connect(name, password, server, serial):
client = DeviceClient(name, password,
title="Langmuir: Source Meter KI2400", description=description)
hw = SourceMeter_KI2400(serial, log_callback=client.emit_log)
client.register_command(hw.sweep, "Voltage sweep", pass_self=True)
client.register_command(hw.set_channel, "Set channel", inputs=[
{"type": "select", "options": [1, 2, 3]}
])
client.register_command(hw.clear_channels, "Reset channels")
# client.register_command(hw.read_data, "Fetch data")
client.register_background_task(hw.update_frontend)
client.keep_server_updated(
check_readiness=hw.is_ready,
check_readiness_interval=0.5,
server_address=server,
retry_on_error=True
)