Skip to content

CONNECT_MSO

Open a VISA connection to an MSOXX Tektronix oscilloscope.Params:device : VisaDeviceThe connected VISA device.Returns:device_addr : TextBlobThe IP address of the VISA device.
Python Code
from tm_devices import DeviceManager
from flojoy import VisaDevice, flojoy, TextBlob
from flojoy.connection_manager import DeviceConnectionManager


@flojoy(deps={"tm_devices": "0.1.24"})
def CONNECT_MSO(device: VisaDevice) -> TextBlob:
    """Open a VISA connection to an MSOXX Tektronix oscilloscope.

    Parameters
    ----------
    device: VisaDevice
        The connected VISA device.

    Returns
    -------
    device_addr: TextBlob
        The IP address of the VISA device.
    """

    dm = DeviceManager()
    device_addr = device.get_address()

    # TCPIP0::169.254.187.99::INSTR vs just 169.254.187.99
    # isolate scope IP
    IP = device_addr.split("::")[1]

    scope = dm.add_scope(IP)

    def cleanup(handle):
        dm, _ = handle
        dm.cleanup_all_devices()
        dm.remove_all_devices()
        dm.close()

    DeviceConnectionManager.register_connection(device, (dm, scope), cleanup=cleanup)

    return TextBlob(text_blob=device_addr)

Find this Flojoy Block on GitHub

Example

Having problems with this example app? Join our Discord community and we will help you out!
React Flow mini map

This app uses the Tektronix tm_measure library to query and plot data from a Tektronix MSO22 oscilloscope.