Model 643 & 648 Electromagnet Power Supplies

The Lake Shore Model 643 (2.5 kW) and Model 648 (9.1 kW) Electromagnet Power Supplies provide a highly accurate linear, bipolar current source.

More information about the Model 643 and Model 648 can be found on our website including the manual which has a list of all commands and queries.

Example Scripts

Below are a few example scripts for the Electromagnet Power Supplies that use the Lake Shore Python driver.

Outputting current and measuring voltage on a Model 643

from lakeshore import Model643
from time import sleep

# Connect to 643 over USB
my_power_supply = Model643()

# Setup current and ramp rate limits
my_power_supply.set_limits(20.000, 3.000)

# Start outputting current from the power supply
my_power_supply.set_current(10.000)

# Wait for power supply to ramp up to specified output current
sleep(10)

# Record real-time output voltage at power supply terminals
measured_voltage = my_power_supply.get_measured_voltage()

print(f"Measured Voltage: {measured_voltage}")

# Set current output back to 0 Amps
my_power_supply.set_current(0)

Setting up magnet water and outputting current from a Model 648

from lakeshore import Model648

# Connect to 648 over USB
my_power_supply = Model648()

# Setup current and ramp rate limits
my_power_supply.set_limits(120.000, 40.000)

# Set magnet water to Auto
my_power_supply.set_magnet_water(2)

# Setup ramp rate for current output
my_power_supply.set_ramp_rate(25.000)

# Start outputting current from the power supply
my_power_supply.set_current(95.000)

Querying the hardware error status register from a Model 648

from lakeshore import Model648

# Connect to 648 over USB 
my_power_supply = Model648()

# Query for hardware errors register mask
register_mask = my_power_supply.get_hardware_error_enable_mask()

# Mask all hardware errors (Masked bits do not affect the parent register)
register_mask.from_integer(0)

# Unmask desired error bits
register_mask.output_over_current = True
register_mask.output_over_voltage = True
register_mask.temperature_fault = True

# Set hardware errors mask
my_power_supply.set_hardware_error_enable_mask(register_mask)

# Query for hardware errors (Ignores the bits masked above)
hardware_error = my_power_supply.get_status_byte().hardware_errors_summary
if hardware_error:
    print(my_power_supply.get_hardware_error_condition())
else:
    print("No hardware errors!")



Instrument class methods

class lakeshore.em_power_supply.ElectromagnetPowerSupply(serial_number=None, com_port=None, baud_rate=57600, data_bits=7, stop_bits=1, parity='O', flow_control=False, handshaking=False, timeout=2.0, ip_address=None, tcp_port=7777, **kwargs)

Class object representing a Lake Shore Model 643 or 648 electromagnet power supply.

class EMPowerSupplyServiceRequestEnableRegister(operational_errors_summary, hardware_errors_summary, message_available, event_summary, operation_summary)

Class object representing the service request enable register LSB to MSB.

classmethod from_integer(integer_representation)

Creates the register object from an integer representation value.

to_integer()

Translates the register object to an integer representation value.

class EMPowerSupplyStatusByteRegister(operational_errors_summary, hardware_errors_summary, message_available, event_summary, service_request, operation_summary)

Class object representing the status byte register LSB to MSB.

classmethod from_integer(integer_representation)

Creates the register object from an integer representation value.

to_integer()

Translates the register object to an integer representation value.

class EMPowerSupplyStandardEventStatusRegister(operation_complete, query_error, execution_error, command_error, power_on)

Class object representing the standard event status register LSB to MSB.

classmethod from_integer(integer_representation)

Creates the register object from an integer representation value.

to_integer()

Translates the register object to an integer representation value.

class EMPowerSupplyOperationEventRegister(compliance, ramp_done, power_limit)

Class object representing the operation event register LSB to MSB.

classmethod from_integer(integer_representation)

Creates the register object from an integer representation value.

to_integer()

Translates the register object to an integer representation value.

class EMPowerSupplyHardwareErrorsRegister(output_control_failure, dac_processor_not_responding, output_over_current, output_over_voltage, temperature_fault, output_stage_protect)

Class object representing the hardware errors register LSB to MSB.

classmethod from_integer(integer_representation)

Creates the register object from an integer representation value.

to_integer()

Translates the register object to an integer representation value.

class EMPowerSupplyOperationalErrorsRegister(calibration_error, external_current_program_error, temperature_high, low_line_voltage, high_line_voltage, magnet_flow_switch_fault, power_supply_flow_switch_fault, remote_enable_fault)

Class object representing the operational errors register LSB to MSB.

classmethod from_integer(integer_representation)

Creates the register object from an integer representation value.

to_integer()

Translates the register object to an integer representation value.

command(command_string, check_errors=True)

Send a command to the instrument.

Args:

command_string (str): A serial command check_errors (bool): Specifies if command errors should be checked. Optional parameter. Defaults to True.

query(query_string, check_errors=True)

Send a query to the instrument and return the response

Args:

query_string (str): A serial query ending in a question mark.

check_errors (bool): Specifies if command errors should be checked. Optional parameter. Defaults to True.

Returns:

str: The instrument query response as a string.

set_limits(max_current, max_ramp_rate)

Sets the upper setting limits for output current, and output current ramp rate.

This is a software limit that will limit the setting of the values. Only limits internal setting of the current.

Args:
max_current (float): The maximum output current setting allowed. The Model 643 bounds are 0.0000 - 70.1000
  1. The Model 648 bounds are 0.0000 - 135.1000 A.

max_ramp_rate (float): The maximum output current ramp rate setting allowed (0.0001 - 50.000 A/s).

get_limits()

Returns the upper setting limits for output current, and output current ramp rate.

This is a software limit that limits the setting of the values. Only limits the internal setting of the current.

Returns:

list[float]: List of [output_current, output_current_ramp_rate].

set_ramp_rate(ramp_rate)

Sets the output current ramp rate.

This value will be used in both the positive and negative directions. Setting value is limited by set_limit.

Args:
ramp_rate (float): The rate at which the current will ramp when a new output current setting is entered

(0.0001 - 50.000 A/s).

get_ramp_rate()

Returns the output current ramp rate.

This value is used in both the positive and negative directions.

Returns:

float: The rate at which the current will ramp when a new output current setting is entered.

set_ramp_segment(segment, current, ramp_rate)

Sets the current and ramp rate of one of the ramp segments.

Args:

segment (int): Specifies the ramp segment to be modified (1 - 5). current (float): Specifies the upper output current setting that will use this segment. ramp_rate (float): Specifies the rate at which the current will ramp. (0.0001 - 50.000 A/s).

get_ramp_segment(segment)

Returns the current and ramp rate of a specific ramp segment.

Args:

segment (int): Specifies the ramp segment to be modified (1 - 5).

Returns:

list[float]: List of current and ramp_rate settings. [current, ramp_rate].

set_ramp_segments_enable(state)

Specifies if ramp segments are to be used.

Ramp segments are used to change the output current ramp rate based on the output current.

Args:

state (bool): The state of the ramp segments enable. 0=Disabled and 1=Enabled.

get_ramp_segments_enable()

Returns if ramp segments are to be used.

Ramp segments are used to change the output current ramp rate based on the output current.

Returns:

bool: Whether ramp segments are enabled. 0=Disabled and 1=Enabled.

set_current(current)

Sets the output current setting.

The setting value is limited by set_limit.

Args:
current (float): The output current value that the output will ramp to at the present ramp rate. The Model

643 bounds are 0.0000 - +/-70.1000 A. The Model 648 bounds are 0.0000 - +/-135.1000 A.

get_current()

Returns the output current setting.

Returns:

float: The output current value that the output will ramp to at the present ramp rate.

get_measured_current()

Returns actual measured output current.

Returns:

float: Measured output current.

get_measured_voltage()

Returns actual output voltage measured at the power supply terminals.

Returns:

float: Measured output voltage.

stop_output_current_ramp()

Stops the output current ramp.

Stops within 2 s of sending command. TO restart the ramp, use the set_current method to set a new output current set-point.

set_internal_water(mode)

Configures the internal water mode.

Args:

mode (int): Internal water mode (0, 1, 2, or 3). 0 = Manual-Off, 1 = Manual-On, 2 = Auto, 3 = Disabled.

get_internal_water()

Returns the internal water mode.

Returns:

int: Internal water mode. 0 = Manual-Off, 1 = Manual-On, 2 = Auto, 3 = Disabled.

set_magnet_water(mode)

Configures the magnet water mode.

Args:

mode (int): Magnet water mode. (0, 1, 2, or 3). 0 = Manual-Off, 1 = Manual-On, 2 = Auto, 3 = Disabled.

get_magnet_water()

Returns the magnet water mode.

Returns:

int: Magnet water mode. 0 = Manual-Off, 1 = Manual-On, 2 = Auto, 3 = Disabled.

set_display_brightness(brightness_level)

Specifies display brightness.

Args:

brightness_level (int): The display brightness. 0=25%, 1=50%, 2=75%, 3=100%.

get_display_brightness()

Returns display brightness.

Returns:

int: The display brightness. 0=25%, 1=50%, 2=75%, 3=100%.

set_front_panel_lock(lock_state, code)

Sets the lock status of the front panel keypad.

Args:

lock_state (int): The lock state to be set (0, 1, or 2). 0=unlock, 1=lock, and 2=lock limits. code (int): Keypad lock code required to make changes to the lock state of the front panel.

get_front_panel_status()

Returns what lock state the front panel keypad is in.

Returns:

int: The state of the front panel keypad lock (0, 1, or 2). 0=unlock, 1=lock, 2=lock limits.

get_front_panel_lock_code()

Returns the lock code for the front panel.

Returns:

int: Front panel lock code.

set_programming_mode(mode)

Sets the current programming mode of the instrument.

Args:

mode (int): Programming mode (0, 1, or 2). 0=Internal, 1=External, 2=Sum.

get_programming_mode()

Returns the current programming mode of the instrument.

Returns:

int: Programming mode. 0=Internal, 1=External, 2=Sum.

set_ieee_488(terminator, eoi_enable, address)

Configures the IEEE-488 interface.

Args:

terminator(int): the terminator. 0=<CR><LF>, 1=<LF><CR>, 2=<LF>, 3=no terminator (must have EOI enabled). eoi_enable(int): Sets EOI (End of Interrupt) mode. 0=Enabled, 1=Disabled. address (int): Specifies IEEE address. 1 - 30(0 and 31 are reserved).

get_iee_488()

Returns IEEE-488 interface configuration.

Returns:
list[int]: [terminator, eoi_enable, address]

terminator(int): the terminator. 0=<CR><LF>, 1=<LF><CR>, 2=<LF>, 3=no terminator (must have EOI enabled). eoi_enable(int): Sets EOI (End of Interrupt) mode. 0=Enabled, 1=Disabled. address (int): Specifies IEEE address. 1 - 30(0 and 31 are reserved).

set_ieee_interface_mode(mode)

Sets the interface mode of the instrument.

Args:

mode (int): Interface mode. 0, 1 or 2. 0=local, 1=remote, and 2=remote with local lockout.

get_ieee_interface_mode()

Returns the interface mode of the instrument.

Returns:

int: Interface mode of the instrument. 0, 1 or 2. 0=local, 1=remote, and 2=remote with local lockout.

set_factory_defaults()

Sets all configuration values to factory defaults and resets the instrument.

The instrument must be at zero amps for this command to work.

reset_instrument()

Sets the controller parameters to power-up settings.

Use the set_factory_defaults command to set factory-defaults.

clear_interface()

Clears the event registers in all register groups. Also clears the error queue.

Clears the bits in the Status Byte Register, Standard Event Status Register, and Operation event Register, and terminates al pending operations. Clears the interface, but not the instrument. The related instrument command is reset_instrument.

get_self_test()

Returns result of instrument self test completed at power up.

Returns:

bool: True means errors found, and False means no errors found.

set_service_request_enable_mask(register_mask)

Configures the Service Request Enable Register.

The Service Request Enable Register determines which summary bits of the Status Byte may set bit 6 (RQS/MSS) of the Status Byte to generate a Service Request.

Args:

register_mask (ElectromagnetPowerSupply.EMPowerSupplyServiceRequestEnableRegister): Register configuration object.

get_service_request_enable_mask()

Returns Service Request Enable Register configuration.

The Service Request Enable Register determines which summary bits of the Status Byte may set bit 6 (RQS/MSS) of the Status Byte to generate a Service Request.

Returns:

ElectromagnetPowerSupply.EMPowerSupplyServiceRequestEnableRegister: Register configuration object.

get_status_byte()

Returns state of the Status Byte Register.

The Status Byte register, typically referred to as the Status Byte, is a non-latching, read-only register that contains all the summary bits from the register sets.

Returns:

ElectromagnetPowerSupply.EMPowerSupplyStatusByteRegister: Register state object.

set_standard_event_status_enable_mask(register_mask)

Configures Standard Event Status Enable Register group.

The Standard Event Status Enable Register determines which bits in the Standard Event Status Register will set the summary bit in the Status Byte (bit 5).

Args:
register_mask (ElectromagnetPowerSupply.EMPowerSupplyStandardEventStatusRegister): Register configuration

object.

get_standard_event_status_enable_mask()

Returns Standard Event Status Enable Register configuration.

The Standard Event Status Enable Register determines which bits in the Standard Event Status Register will set the summary bit in the Status Byte (bit 5).

Returns:

ElectromagnetPowerSupply.EMPowerSupplyStandardEventStatusRegister: Register configuration object.

get_standard_event_status_event()

Returns state of the Standard Event Status Register.

Bits in this register correspond to various system events and latch when the event occurs. When an event bit is set, subsequent events corresponding to that bit are ignored. Set bits remain latched until the register is reset by this query or clear_interface.

Returns:

ElectromagnetPowerSupply.EMPowerSupplyStandardEventStatusRegister: Register state object.

set_operation_event_enable_mask(register_mask)

Configures the Operational Event Enable Register.

Each bit has a bit weighting and represents the enable/disable mask of the corresponding operational status bit in the Operational Status Register. This determines which status bits can set the corresponding summary bit in the Status Byte Register.

Args:

ElectromagnetPowerSupply.EMPowerSupplyOperationEventRegister: Register configuration object.

get_operation_event_enable_mask()

Returns Operational Event Enable Register configuration.

Each bit has a bit weighting and represents the enable/disable mask of the corresponding operational status bit in the Operational Status Register. This determines which status bits can set the corresponding summary bit in the Status Byte Register.

Returns:

ElectromagnetPowerSupply.EMPowerSupplyOperationEventRegister: Register configuration object.

get_operation_event_condition()

Returns the real-time state of the operation event bits.

The condition register constantly monitors the instrument status. The data bits are real-time and are not latched or buffered. The register is read-only.

Returns:

ElectromagnetPowerSupply.EMPowerSupplyOperationEventRegister: Object with each of the register bits’ status.

get_operation_event_event()

Returns the latched state of the operation event bits.

Bits in the event register correspond to various system events and latch when the event occurs. When an event bit is set, subsequent events corresponding to that bit are ignored.

Returns:

ElectromagnetPowerSupply.EMPowerSupplyOperationEventRegister: Object with each of the register bits’ status.

set_hardware_error_enable_mask(register_mask)

Sets which hardware error bits will set the summary bit in the Status Byte Register.

Each bit has a bit weighting and represents the enable/disable mask of the corresponding error bits in the Error Status Register. This determines which status bits can set the corresponding summary bits in the Status Byte Register.

Args:
register_mask (ElectromagnetPowerSupply.EMPowerSupplyHardwareErrorsRegister): Register mask configuration

object.

get_hardware_error_enable_mask()

Returns which hardware error bits will set the summary bit in the Status Byte Register.

Each bit has a bit weighting and represents the enable/disable mask of the corresponding error bits in the Error Status Register. This determines which status bits can set the corresponding summary bits in the Status Byte Register.

Returns:

ElectromagnetPowerSupply.EMPowerSupplyHardwareErrorsRegister: Register mask configuration object.

get_hardware_error_condition()

Returns the real-time state of the hardware error bits.

The condition register constantly monitors the instrument status. The data bits are real-time and are not latched or buffered. The register is read-only.

Returns:

ElectromagnetPowerSupply.EMPowerSupplyHardwareErrorsRegister: Object with each of the register bits’ status.

get_hardware_error_event()

Returns the latched state of the hardware error bits.

Bits in the event register correspond to various system events and latch when the event occurs. When an event bit is set, subsequent events corresponding to that bit are ignored.

Returns:

ElectromagnetPowerSupply.EMPowerSupplyHardwareErrorsRegister: Object with each of the register bits’ status.

set_operational_error_enable_mask(register_mask)

Sets which operational error bits will set the summary bit in the Status Byte Register.

Each bit has a bit weighting and represents the enable/disable mask of the corresponding error bits in the Error Status Register. This determines which status bits can set the corresponding summary bits in the Status Byte Register.

Args:
register_mask (ElectromagnetPowerSupply.EMPowerSupplyHardwareErrorsRegister): Register mask configuration

object.

get_operational_error_enable_mask()

Returns which operational error bits will set the summary bit in the Status Byte Register.

Each bit has a bit weighting and represents the enable/disable mask of the corresponding error bits in the Error Status Register. This determines which status bits can set the corresponding summary bits in the Status Byte Register.

Returns:

ElectromagnetPowerSupply.EMPowerSupplyHardwareErrorsRegister: Register mask configuration object.

get_operational_error_condition()

Returns the real-time state of the operational error bits.

The condition register constantly monitors the instrument status. The data bits are real-time and are not latched or buffered. The register is read-only.

Returns:

ElectromagnetPowerSupply.EMPowerSupplyOperationalErrorsRegister: Object with each of the register bits’ status.

get_operational_error_event()

Returns the latched state of the operational error bits.

Bits in the event register correspond to various system events and latch when the event occurs. When an event bit is set, subsequent events corresponding to that bit are ignored.

Returns:

ElectromagnetPowerSupply.EMPowerSupplyOperationalErrorsRegister: Object with each of the register bits’ status.

connect_tcp(ip_address, tcp_port, timeout)

Establishes a TCP connection with the instrument on the specified IP address.

connect_usb(serial_number=None, com_port=None, baud_rate=None, data_bits=None, stop_bits=None, parity=None, timeout=None, handshaking=None, flow_control=None)

Establish a serial USB connection.

disconnect_tcp()

Disconnect the TCP connection.

disconnect_usb()

Disconnect the USB connection.

write(command_string)

Alias of command. Send a command to the instrument.

Args:
command_string (str):

A serial command.