Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

FSV instrument nodes and peak detection #337

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
from flojoy import VisaDevice, flojoy, DataContainer
from flojoy.connection_manager import DeviceConnectionManager
from typing import Optional
from pyvisa import ResourceManager


@flojoy()
def CONNECTION_FSV(
device: VisaDevice,
default: Optional[DataContainer] = None,
) -> Optional[DataContainer]:
"""The CONNECTION_FSV node connects Flojoy to a FSV network analyzer.

The connection is made with the VISA address in the Flojoy UI.

This node should also work with compatible R&S network analyzers.

Parameters
----------
device: VisaDevice
The VISA address to connect to.

Returns
-------
DataContainer
Optional: None
dstrande marked this conversation as resolved.
Show resolved Hide resolved
"""

rm = ResourceManager("@py")
rohde = rm.open_resource(device.get_id())
rohde.read_termination = "\n"
rohde.write_termination = "\n"

DeviceConnectionManager.register_connection(device, rohde)

return None
Loading