Keysight E36312A Triple Output Power Supply
- class pymeasure.instruments.keysight.KeysightE36312A(adapter, name='Keysight E36312A', **kwargs)
Bases:
SCPIMixin,InstrumentRepresents the Keysight E36312A Power supply interface for interacting with the instrument.
supply = KeysightE36312A(resource) supply.ch_1.voltage_setpoint=10 supply.ch_1.current_setpoint=0.1 supply.ch_1.output_enabled=True print(supply.ch_1.voltage)
- ch_1
- Channel:
- ch_2
- Channel:
- ch_3
- Channel:
- class BaseChannelCreator(**kwargs)
Bases:
objectBase class for ChannelCreator and MultiChannelCreator.
- Parameters:
cls – Class for all children or tuple/list of classes, one for each child.
**kwargs – Keyword arguments for all children.
- class ChannelCreator(cls, id=None, **kwargs)
Bases:
BaseChannelCreatorAdd a single channel to the parent class.
The child will be added to the parent instance at instantiation with
CommonBase.add_child(). The attribute name that ChannelCreator was assigned to in the Instrument class will be the name of the channel interface.class Extreme5000(Instrument): # Two output channels, accessible by their property names # and both are accessible through the 'channels' collection output_A = Instrument.ChannelCreator(Extreme5000Channel, "A") output_B = Instrument.ChannelCreator(Extreme5000Channel, "B") # A channel without a channel accessible through the 'motor' collection motor = Instrument.ChannelCreator(MotorControl) inst = SomeInstrument() # Set the extreme_temp for channel A of Extreme5000 instrument inst.output_A.extreme_temp = 42
- Parameters:
cls (
type[Child]) – Channel class for channel interfaceid (
Union[int,str,None]) – The id of the channel on the instrument, integer or string. (default:None)**kwargs – Keyword arguments for all children.
- class MultiChannelCreator(cls, id=None, prefix='ch_', **kwargs)
Bases:
BaseChannelCreatorAdd channels to the parent class.
The children will be added to the parent instance at instantiation with
CommonBase.add_child(). The attribute name (e.g.channels) will be used as the collection of the children. You may define the attribute prefix. If there are no other pressing reasons, usechannelsas the attribute name and leave the prefix at the default"ch_".class Extreme5000(Instrument): # Three channels of the same type: 'ch_A', 'ch_B', 'ch_C' # and add them to the 'channels' collection channels = Instrument.MultiChannelCreator(Extreme5000Channel, ["A", "B", "C"]) # Two channel interfaces of different types: 'fn_power', 'fn_voltage' # and add them to the 'functions' collection functions = Instrument.MultiChannelCreator((PowerChannel, VoltageChannel), ["power", "voltage"], prefix="fn_")
- Parameters:
cls (
Union[type[Child],Sequence[type[Child]]]) – Class for all children or tuple/list of classes, one for each child.id (
Union[int,str,None]) – tuple/list of ids of the channels on the instrument. (default:None)prefix (
Optional[str]) – Collection prefix for the attributes, e.g. “ch_” creates attribute self.ch_A. If prefix evaluates False, the child will be added directly under the variable name. Required if id is tuple/list. (default:'ch_')**kwargs – Keyword arguments for all children.
- add_child(cls, id=None, collection='channels', prefix='ch_', attr_name='', **kwargs)
Add a child to this instance and return its index in the children list.
The newly created child may be accessed either by the id in the children dictionary or by the created attribute, e.g. the fifth channel of instrument with id “F” has two access options:
instrument.channels["F"] == instrument.ch_FNote
Do not change the default collection or prefix parameter, unless you have to distinguish several collections of different children, e.g. different channel types (analog and digital).
- Parameters:
cls (
type[TypeVar(child, bound=Child)]) – Class of the channel.id (
Union[int,str,None]) – Child id how it is used in communication, e.g. “A”. (default:None)collection (
str) – Name of the collection of children, used for dictionary access to the channel interfaces. (default:'channels')prefix (
Optional[str]) – For creating multiple channel interfaces, the prefix e.g. “ch_” is prepended to the attribute name of the channel interface self.ch_A. If prefix evaluates False, the child will be added directly under the collection name. (default:'ch_')attr_name (
Optional[str]) – For creating a single channel interface, the attr_name argument is used when setting the attribute name of the channel interface. (default:'')**kwargs – Keyword arguments for the channel creator.
- Returns:
TypeVar(child, bound=Child) – Instance of the created child.
- ask(command, query_delay=None)
Write a command to the instrument and return the read response.
- Parameters:
command (
str) – Command string to be sent to the instrument.query_delay (
Optional[float]) – Delay between writing and reading in seconds. (default:None)
- Returns:
str– String returned by the device without read_termination.
- binary_values(command, query_delay=None, **kwargs)
Write a command to the instrument and return a numpy array of the binary data.
- Parameters:
command (
str) – Command to be sent to the instrument.query_delay (
Optional[float]) – Delay between writing and reading in seconds. (default:None)kwargs – Arguments for
read_binary_values().
- Returns:
NumPy array of values.
- check_errors()
Read all errors from the instrument.
- Returns:
List of error entries.
- check_get_errors()
Check for errors after having gotten a property and log them.
Called if
check_get_errors=Trueis set for that property.If you override this method, you may choose to raise an Exception for certain errors.
- Returns:
list– List of error entries.
- check_set_errors()
Check for errors after having set a property and log them.
Called if
check_set_errors=Trueis set for that property.If you override this method, you may choose to raise an Exception for certain errors.
- Returns:
list– List of error entries.
- clear()
Clear the instrument status byte.
- property complete: Any
Get the synchronization bit.
This property allows synchronization between a controller and a device. The Operation Complete query places an ASCII character 1 into the device’s Output Queue when all pending selected device operations have been finished.
- static control(get_command, set_command, docs, validator=<function CommonBase.<lambda>>, values=(), map_values=False, get_process=<function CommonBase.<lambda>>, get_process_list=<function CommonBase.<lambda>>, set_process=<function CommonBase.<lambda>>, command_process=None, check_set_errors=False, check_get_errors=False, dynamic=False, preprocess_reply=None, separator=', ', maxsplit=-1, cast=<class 'float'>, values_kwargs=None, **kwargs)
Return a property for the class based on the supplied commands. This property may be set and read from the instrument. See also
measurement()andsetting().- Parameters:
get_command (
Optional[str]) – A string command that asks for the value, set to None if get is not supported (see alsosetting()).set_command (
Optional[str]) – A string command that writes the value, set to None if set is not supported (see alsomeasurement()).docs (
str) – A docstring that will be included in the documentationvalidator (
Callable[[Any,TypeVar(Vs)],TypeVar(V2)]) – A function that takes both a value and a group of valid values and returns a valid value, while it otherwise raises an exception (default:<function CommonBase.<lambda> at 0x76f219f7e3e0>)values (
TypeVar(Vs)) – A list, tuple, range, or dictionary of valid values, that can be used as to map values ifmap_valuesis True. (default:())map_values (
bool) – A boolean flag that determines if the values should be interpreted as a map (default:False)get_process (
Callable[[Any],Any]) – A function that takes a value and allows processing before value mapping, returning the processed value (default:<function CommonBase.<lambda> at 0x76f219f7e480>)get_process_list (
Callable[[list[Any]],Any]) – A function that takes the value list and processes it. (default:<function CommonBase.<lambda> at 0x76f219f7e520>)set_process (
Callable[[TypeVar(V2)],Any]) – A function that takes a value and allows processing before value mapping, returning the processed value (default:<function CommonBase.<lambda> at 0x76f219f7e5c0>)command_process (
Optional[Callable]) –A function that takes a command and allows processing before executing the command
Deprecated since version 0.12: Use a dynamic property instead. (default:
None)check_set_errors (
bool) – Toggles checking errors after setting (default:False)check_get_errors (
bool) – Toggles checking errors after getting (default:False)dynamic (
bool) – Specify whether the property parameters are meant to be changed in instances or subclasses. (default:False)preprocess_reply (
Optional[Callable[[str],str]]) – Optional callable used to preprocess the string received from the instrument, before splitting it. The callable returns the processed string. (default:None)separator (
str) – A separator character to split the string returned by the device into a list. (default:',')maxsplit (
int) – The string returned by the device is split at most maxsplit times. -1 (default) indicates no limit. (default:-1)cast (
Callable[[str],TypeVar(T)]) – A type to cast each element of the split string. (default:<class 'float'>)values_kwargs (dict) – Further keyword arguments for
values().**kwargs –
Keyword arguments for
values().Deprecated since version 0.12: Use values_kwargs dictionary parameter instead.
- Return type:
Union[property,DynamicProperty]
Example of usage of dynamic parameter is as follows:
class GenericInstrument(Instrument): center_frequency = Instrument.control( ":SENS:FREQ:CENT?;", ":SENS:FREQ:CENT %e GHz;", " A floating point property that represents the frequency ... ", validator=strict_range, # Redefine this in subclasses to reflect actual instrument value: values=(1, 20), dynamic=True # enable changing property parameters on-the-fly ) class SpecificInstrument(GenericInstrument): # Identical to GenericInstrument, except for frequency range # Override the "values" parameter of the "center_frequency" property center_frequency_values = (1, 10) # Redefined at subclass level instrument = SpecificInstrument() instrument.center_frequency_values = (1, 6e9) # Redefined at instance level
Warning
Unexpected side effects when using dynamic properties
Users must pay attention when using dynamic properties, since definition of class and/or instance attributes matching specific patterns could have unwanted side effect. The attribute name pattern property_param, where property is the name of the dynamic property (e.g. center_frequency in the example) and param is any of this method parameters name except dynamic and docs (e.g. values in the example) has to be considered reserved for dynamic property control.
- static get_channel_pairs(cls)
Return a list of all the Instrument’s channel pairs
- static get_channels(cls)
Return a list of all the Instrument’s ChannelCreator and MultiChannelCreator instances
- Return type:
list[tuple[str,BaseChannelCreator]]
- property id: Any
Get the identification of the instrument.
- static measurement(get_command, docs, values=(), map_values=False, get_process=<function CommonBase.<lambda>>, get_process_list=<function CommonBase.<lambda>>, command_process=None, check_get_errors=False, dynamic=False, preprocess_reply=None, separator=', ', maxsplit=-1, cast=<class 'float'>, values_kwargs=None, **kwargs)
Return a property for the class based on the supplied commands. This is a measurement quantity that may only be read from the instrument, not set.
- Parameters:
get_command (
str) – A string command that asks for the valuedocs (
str) – A docstring that will be included in the documentationvalues (
Any) – A list, tuple, range, or dictionary of valid values, that can be used as to map values ifmap_valuesis True. (default:())map_values (
bool) – A boolean flag that determines if the values should be interpreted as a map (default:False)get_process (
Callable[[Any],Any]) – A function that takes a value and allows processing before value mapping, returning the processed value (default:<function CommonBase.<lambda> at 0x76f219f7e700>)get_process_list (
Callable[[list[Any]],Any]) – A function that takes the value list and processes it. (default:<function CommonBase.<lambda> at 0x76f219f7e7a0>)command_process (
Optional[Callable]) –A function that take a command and allows processing before executing the command, for getting
Deprecated since version 0.12: Use a dynamic property instead. (default:
None)check_get_errors (
bool) – Toggles checking errors after getting (default:False)dynamic (
bool) – Specify whether the property parameters are meant to be changed in instances or subclasses. Seecontrol()for an usage example. (default:False)preprocess_reply (
Optional[Callable[[str],str]]) – Optional callable used to preprocess the string received from the instrument, before splitting it. The callable returns the processed string. (default:None)separator (
str) – A separator character to split the string returned by the device into a list. (default:',')maxsplit (
int) – The string returned by the device is split at most maxsplit times. -1 (default) indicates no limit. (default:-1)cast (
Callable[[str],TypeVar(T)]) – A type to cast each element of the split string. (default:<class 'float'>)values_kwargs (dict) – Further keyword arguments for
values().**kwargs –
Keyword arguments for
values().Deprecated since version 0.12: Use values_kwargs dictionary parameter instead.
- Return type:
Union[property,DynamicProperty]
- property next_error: Any
Get the next error in the queue. If you want to read and log all errors, use
check_errors()instead.
- property options: Any
Get the device options installed.
- read(**kwargs)
Read up to (excluding) read_termination or the whole read buffer.
- Return type:
str
- read_binary_values(**kwargs)
Read binary values from the device.
- read_bytes(count, **kwargs)
Read a certain number of bytes from the instrument.
- Parameters:
count (int) – Number of bytes to read. A value of -1 indicates to read the whole read buffer.
kwargs – Keyword arguments for the adapter.
- Returns bytes:
Bytes response of the instrument (including termination).
- Return type:
bytes
- remove_child(child)
Remove the child from the instrument and the corresponding collection.
- Parameters:
child (
Child) – Instance of the child to delete.- Return type:
None
- reset()
Reset the instrument.
- static setting(set_command, docs, validator=<function CommonBase.<lambda>>, values=(), map_values=False, set_process=<function CommonBase.<lambda>>, check_set_errors=False, dynamic=False)
Return a property for the class based on the supplied commands. This property may be set, but raises an exception when being read from the instrument.
- Parameters:
set_command (
str) – A string command that writes the valuedocs (
str) – A docstring that will be included in the documentationvalidator (
Callable[[Any,TypeVar(Vs)],Any]) – A function that takes both a value and a group of valid values and returns a valid value, while it otherwise raises an exception (default:<function CommonBase.<lambda> at 0x76f219f7e8e0>)values (
TypeVar(Vs)) – A list, tuple, range, or dictionary of valid values, that can be used as to map values ifmap_valuesis True. (default:())map_values (
bool) – A boolean flag that determines if the values should be interpreted as a map (default:False)set_process (
Callable[[Any],Any]) – A function that takes a value and allows processing before value mapping, returning the processed value (default:<function CommonBase.<lambda> at 0x76f219f7e980>)check_set_errors (
bool) – Toggles checking errors after setting (default:False)dynamic (
bool) – Specify whether the property parameters are meant to be changed in instances or subclasses. Seecontrol()for an usage example. (default:False)
- Return type:
Union[property,DynamicProperty]
- shutdown()
Brings the instrument to a safe and stable state
- Return type:
None
- property status: Any
Get the status byte and Master Summary Status bit.
- values(command, separator=', ', cast=<class 'float'>, preprocess_reply=None, maxsplit=-1, **kwargs)
Write a command to the instrument and return a list of formatted values from the result.
- Parameters:
command (
str) – SCPI command to be sent to the instrument.preprocess_reply (
Optional[Callable[[str],str]]) – Optional callable used to preprocess the string received from the instrument, before splitting it. The callable returns the processed string. (default:None)separator (
str) – A separator character to split the string returned by the device into a list. (default:',')maxsplit (
int) – The string returned by the device is split at most maxsplit times. -1 (default) indicates no limit. (default:-1)cast (
Callable[[str],TypeVar(T)]) – A type to cast each element of the split string. (default:<class 'float'>)**kwargs – Keyword arguments to be passed to the
ask()method.
- Returns:
list[Union[TypeVar(T),str]] – A list of the desired type, or strings where the casting fails.
- wait_for(query_delay=None)
Wait for some time. Used by ‘ask’ to wait before reading.
- Parameters:
query_delay (
Optional[float]) – Delay between writing and reading in seconds. None is default delay. (default:None)- Return type:
None
- write(command, **kwargs)
Write a string command to the instrument appending write_termination.
- Parameters:
command (
str) – command string to be sent to the instrumentkwargs – Keyword arguments for the adapter.
- Return type:
None
- write_binary_values(command, values, *args, **kwargs)
Write binary values to the device.
- Parameters:
command (
str) – Command to send.values (
Sequence[Union[int,float]]) – The values to transmit.**kwargs (*args,) – Further arguments to hand to the Adapter.
- Return type:
None
- write_bytes(content, **kwargs)
Write the bytes content to the instrument.
- Return type:
None
- class pymeasure.instruments.keysight.keysightE36312A.VoltageChannel(parent, id, **kwargs)
Bases:
Channel- property current: Any
Measure the actual current of this channel.
- property current_limit: Any
Control the current limit of this channel, range depends on channel.(dynamic)
- property output_enabled: Any
Control whether the channel output is enabled (boolean).
- property voltage: Any
Measure actual voltage of this channel.
- property voltage_setpoint: Any
Control the output voltage of this channel, range depends on channel.(dynamic)