Glassman

GlassmanFR Single Output Power Supply

class instruments.glassman.GlassmanFR(filelike)[source]

The GlassmanFR is a single output power supply.

Because it is a single channel output, this object inherits from both PowerSupply and PowerSupplyChannel.

This class should work for any of the Glassman FR Series power supplies and is also likely to work for the EJ, ET, EY and FJ Series which seem to share their communication protocols. The code has only been tested by the author with an Glassman FR50R6 power supply.

Before this power supply can be remotely operated, remote communication must be enabled and the HV must be on. Please refer to the manual.

Example usage:

>>> import instruments as ik
>>> psu = ik.glassman.GlassmanFR.open_serial('/dev/ttyUSB0', 9600)
>>> psu.voltage = 100 # Sets output voltage to 100V.
>>> psu.voltage
array(100.0) * V
>>> psu.output = True # Turns on the power supply
>>> psu.voltage_sense < 200 * pq.volt
True

This code uses default values of voltage_max, current_max and polarity that are only valid of the FR50R6 in its positive setting. If your power supply differs, reset those values by calling:

>>> import quantities as pq
>>> psu.voltage_max = 40.0 * pq.kilovolt
>>> psu.current_max = 7.5 * pq.milliamp
>>> psu.polarity = -1
class ErrorCode[source]

Enum containing the possible error codes returned by the instrument.

checksum_error = '2'

The checksum calculated by the instrument does not correspond to the one received

extra_bytes = '3'

The command was longer than expected

illegal_control = '4'

The digital control byte set was not one of HV On, HV Off or Power supply Reset

illegal_while_fault = '5'

A send command was sent without a reset byte while the power supply is faulted

processing_error = '6'

Command valid, error while executing it

undefined_command = '1'

Undefined command received (not S, Q, V or C)

class Mode[source]

Enum containing the possible modes of operations of the instrument

current = '1'

Constant current mode

voltage = '0'

Constant voltage mode

class ResponseCode[source]

Enum containing the possible reponse codes returned by the instrument.

C = 'A'

A configure command expects an acknoledge response (A)

Q = 'R'

A query command expects a response packet (R)

S = 'A'

A set command expects an acknoledge response (A)

V = 'B'

A version query expects a different response packet (B)

get_status()[source]

Gets and parses the response packet.

Returns a dict with the following keys: {voltage,current,mode,fault,output}

Return type:dict
query(cmd, size=-1)[source]

Overrides the default query by padding the front of each command sent to the instrument with an SOH character and the back of it with a checksum.

This implementation also automatically check that the checksum returned by the instrument is consistent with the message. If the message returned is an error, it parses it and raises.

Parameters:
  • cmd (str) – The query message to send to the instrument
  • size (int) – The number of bytes to read back from the instrument response.
Returns:

The instrument response to the query

Return type:

str

reset()[source]

Reset device to default status (HV Off, V=0.0, A=0.0)

sendcmd(cmd)[source]

Overrides the default setcmd by padding the front of each command sent to the instrument with an SOH character and the back of it with a checksum.

Parameters:cmd (str) – The command message to send to the instrument
set_status(voltage=None, current=None, output=None, reset=False)[source]

Sets the requested variables on the instrument.

This instrument can only set all of its variables simultaneously, if some of them are omitted in this function, they will simply be kept as what they were set to previously.

channel

Return the channel (which in this case is the entire instrument, since there is only 1 channel on the GlassmanFR.)

Return type:‘tuple’ of length 1 containing a reference back to the parent GlassmanFR object.
current

Gets/sets the output current setting.

Units:As specified, or assumed to be \(\text{A}\) otherwise.
Type:float or Quantity
current_sense

Gets/sets the output current as measured by the sense wires.

Units:As specified, or assumed to be \(\text{A}\) otherwise.
Type:Quantity
device_timeout

Gets/sets the timeout instrument side.

This is a toggle setting. ON will set the timeout to 1.5 seconds while OFF will disable it.

Type:bool
fault

Gets/sets the output status.

Returns True if the instrument has a fault.

Type:bool
mode

Gets/sets the mode for the specified channel.

The constant-voltage/constant-current modes of the power supply are selected automatically depending on the load (resistance) connected to the power supply. If the load greater than the set V/I is connected, a voltage V is applied and the current flowing is lower than I. If the load is smaller than V/I, the set current I acts as a current limiter and the voltage is lower than V.

Type:GlassmanFR.Mode
output

Gets/sets the output status.

This is a toggle setting. True will turn on the instrument output while False will turn it off.

Type:bool
version

The software revision level of the power supply’s data intereface via the V command

Return type:str
voltage

Gets/sets the output voltage setting.

Units:As specified, or assumed to be \(\text{V}\) otherwise.
Type:float or Quantity
voltage_sense

Gets the output voltage as measured by the sense wires.

Units:As specified, or assumed to be \(\text{V}\) otherwise.
Type:Quantity