SOURCE_2450
Set the source output settings. Use the OUTPUT_2450 block to turn the output on or off.
Requires a CONNECT_2450 block to create the connection. Params: connection : VisaConnection The VISA address (requires the CONNECTION_2450 block). function : select, default=voltage The type of output to use. level : float, default=0 The fixed voltage or current to output. limit : float, default=1 Output limit (if function=voltage, current is limited and visa versa). terminal : select, default=front The panel to output from. protect : select, default=NONE The overvoltage protection value. Returns: out : String Source settings
Python Code
from typing import Optional, Literal
from flojoy import VisaConnection, flojoy, DataContainer, String
@flojoy(deps={"tm_devices": "1.0"}, inject_connection=True)
def SOURCE_2450(
connection: VisaConnection,
input: Optional[DataContainer] = None,
function: Literal["current", "voltage"] = "voltage",
level: float = 1.0,
limit: float = 1.0,
terminal: Literal["front", "rear"] = "front",
protect: Literal[
"NONE",
"2V",
"5V",
"10V",
"20V",
"40V",
"60V",
"80V",
"100V",
"120V",
"140V",
"160V",
"180V",
] = "NONE",
) -> String:
"""Set the source output settings.
Use the OUTPUT_2450 block to turn the output on or off.
Requires a CONNECT_2450 block to create the connection.
Parameters
----------
connection : VisaConnection
The VISA address (requires the CONNECTION_2450 block).
function : select, default=voltage
The type of output to use.
level : float, default=0
The fixed voltage or current to output.
limit : float, default=1
Output limit (if function=voltage, current is limited and visa versa).
terminal : select, default=front
The panel to output from.
protect : select, default=NONE
The overvoltage protection value.
Returns
-------
String
Source settings
"""
# Retrieve oscilloscope instrument connection
smu = connection.get_handle()
smu.commands.smu.source.protect.level = f"smu.PROTECT_{protect}"
if terminal == "front":
smu.commands.smu.terminals = "smu.TERMINALS_FRONT"
else:
smu.commands.smu.terminals = "smu.TERMINALS_REAR"
if function == "current":
smu.commands.smu.source.func = "smu.FUNC_DC_CURRENT"
smu.commands.smu.source.vlimit.level = limit
else:
smu.commands.smu.source.func = "smu.FUNC_DC_VOLTAGE"
smu.commands.smu.source.ilimit.level = limit
smu.commands.smu.source.level = level
return String(s="Source settings")
Videos
Control the Sourcemeter 2450 with Flojoy
Example
Having problems with this example app? Join our Discord community and we will help you out!
In this example, a Keithley 2450 to generate 1V and then sweep between 0 and 1V.
First the necessary blocks were added:
CONNECT_2450
BEEP_2450
RESET_2450
SOURCE_2450
MEASURE_SETTINGS_2450
MEASUREMENT_READ_2450
IV_SWEEP_2450
BIG_NUMBER
LINE
The instrument address was set for each 2450
block. The SOURCE_2450
block was changed in order to source 1V. The parameters in the MEASURE_SETTINGS_2450
block were changed as necessary. The MEASUREMENT_READ_2450
block was connected to the BIG_NUMBER
block in order to view the reading.
The IV_SWEEP_2450
block output was connected to the LINE
plot to show the output of the sweep.
The blocks were connected as shown and the app was run.