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 PowerSupply.Channel.
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 * u.volt True
This code uses default values of
voltage_max
,current_max
andpolarity
that are only valid of the FR50R6 in its positive setting. If your power supply differs, reset those values by calling:>>> import instruments.units as u >>> psu.voltage_max = 40.0 * u.kilovolt >>> psu.current_max = 7.5 * u.milliamp >>> psu.polarity = -1
- class ErrorCode(value)[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(value)[source]¶
Enum containing the possible modes of operations of the instrument
- current = '1'¶
Constant current mode
- voltage = '0'¶
Constant voltage mode
- class ResponseCode(value)[source]¶
Enum containing the possible reponse codes returned by the instrument.
- C = 'A'¶
A configure command expects an acknowledge response (
A
)
- Q = 'R'¶
A query command expects a response packet (
R
)
- S = 'A'¶
A set command expects an acknowledge 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:
- 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.
- 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.
- property 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.
- property current¶
Gets/sets the output current setting.
- property current_sense¶
Gets/sets the output current as measured by the sense wires.
- Units:
As specified, or assumed to be \(\text{A}\) otherwise.
- Type:
- property 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:
- property 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:
- property 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:
- property version¶
The software revision level of the power supply’s data intereface via the
V
command- Return type:
- property voltage¶
Gets/sets the output voltage setting.