CONNECT_2450
Download Flojoy Studio to try this app
  
 Open a VISA connection to an Keithley 2450 SourceMeter.   Params:    device : VisaDevice  The connected VISA device.     Returns:    device_addr : String  The IP or VISA address of the VISA device.    
Python Code
from flojoy import VisaDevice, flojoy, String
from flojoy.connection_manager import DeviceConnectionManager
@flojoy(deps={"tm_devices": "1.0"})
def CONNECT_2450(
    device: VisaDevice,
) -> String:
    """Open a VISA connection to an Keithley 2450 SourceMeter.
    Parameters
    ----------
    device: VisaDevice
        The connected VISA device.
    Returns
    -------
    device_addr: String
        The IP or VISA address of the VISA device.
    """
    device_addr = device.get_address()
    smu = DeviceConnectionManager.tm.add_smu(device_addr)
    smu.write("*LANG TSP")
    lang = smu.query("*LANG?")
    if lang != "TSP":
        raise ValueError(
            "Command set language not set correctly. Try setting to 'TSP' manually."
        )
    DeviceConnectionManager.register_connection(device, smu)
    return String(s=device_addr)
Videos
Control the Sourcemeter 2450 with Flojoy
Example App
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.