OUTPUT_SYNC_33510B
Python Code
from flojoy import flojoy, DataContainer, String, VisaConnection
from typing import Optional, Literal
@flojoy(inject_connection=True)
def OUTPUT_SYNC_33510B(
connection: VisaConnection,
on_off: Literal["ON", "OFF"] = "OFF",
channel: Literal["1", "2"] = "1",
default: Optional[DataContainer] = None,
) -> String:
"""Sync multiple output phases of a supported function generator.
Can only be turned on for one channel.
Requires a CONNECTION_33510B node at the start of the app to connect with
the instrument. The VISA address will then be listed under 'connection'.
This node should also work with compatible Keysight 33XXX wavefunction
generators (although they are untested).
Parameters
----------
connection: VisaConnection
The VISA address (requires the CONNECTION_MDO3XXX node).
on_off: str
Whether to turn the waveform phase syncing on or off.
channel: str
The channel to use as the baseline phase.
Returns
-------
DataContainer
String: The channel, and ON or OFF depending on on_off value.
"""
ks = connection.get_handle()
ks.sync.source(int(channel))
match on_off:
case "OFF":
ks.sync.output("OFF")
case "ON":
ks.sync.output("ON")
ks.write("PHAS:SYNC")
return String(s=f"CH{channel} sync: {on_off}")
Example App
In this example, we sync the waveform output phases generation for a Keysight 33510B. Each channel in the 33510B has a phase
which results in shifting the wavefunction in the x axis (i.e. time). One channel should be chosen as the baseline for this phase to ensure the phases match for the two channels (the phase of the second channel is then with respect to the baseline channel).
We must first add the CONNECTION_33510B
node. This will create the connection to the instrument at the beginning of the app. To allow this we must set the VISA address
for this (and all subsequent 33510B
nodes). If the address does not appear in the parameters you may have to press REFRESH
in the HARDWARE MANAGER
tab.
We add the OUTPUT_SYNC_33510B
node as well as the TEXT_VIEW
node to view the summary of the changes.
We then must set the node parameters. First, the VISA address must be set for all nodes as mentioned above. Then the reference channel must be set as well as whether to turn the output sync on or off. You can also use this node to query the current output sync settings on the instrument.