Skip to content

COPY_AFG31000

Copy the setup parameters to the other channel. This block should also work with compatible Tektronix AFG31XXX instruments. Params: connection : VisaConnection The VISA address (requires the CONNECTION_AFG31000 block). channel : select, default=ch1 Which channel to copy to the other channel. Returns: out : String Placeholder
Python Code
from flojoy import flojoy, DataContainer, String, VisaConnection
from typing import Optional, Literal


@flojoy(inject_connection=True)
def COPY_AFG31000(
    connection: VisaConnection,
    channel: Literal["ch1", "ch2"] = "ch1",
    input: Optional[DataContainer] = None,
) -> String:
    """Copy the setup parameters to the other channel.

    This block should also work with compatible Tektronix AFG31XXX instruments.

    Parameters
    ----------
    connection: VisaConnection
        The VISA address (requires the CONNECTION_AFG31000 block).
    channel: select, default=ch1
        Which channel to copy to the other channel.

    Returns
    -------
    String
        Placeholder
    """

    afg = connection.get_handle()

    if channel == "ch1":
        afg.write("AFGControl:CSCopy CH1,CH2")
    else:
        afg.write("AFGControl:CSCopy CH2,CH1")

    return String(s="Copied channel parameters")

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

In this example, an Tektronix AFG31000 is used to generate an arbitrary waveform.

First the necessary blocks were added:

  • CONNECT_AFG31000
  • COPY_AFG31000
  • ARBITRARY_AFG31000
  • BASIC_PARAMETERS_AFG31000
  • OUTPUT_AFG31000
  • 3x BASIC_OSCILLATOR
  • MULTIPLY
  • LINE

The instrument address was set for each AFG31000 block. Ensure the OUTPUT_AFG31000 block has channel 1 output turned on. Note the COPY_AFG31000 block is rename PLACEHOLDER here and it preset for block running order reasons. The BASIC_PARAMETERS_AFG31000 block is used to change frequency, offset, voltage, and phase for a single channel, without changing the function itself.

The blocks were connected as shown and the app was run. The 3 BASIC_OSCILLATOR blocks were used to generate the arbitrary waveform. Any waveform generated in Flojoy can be used as the input for ARBITRARY_AFG31000 to allow for any output.

An oscilloscope was connected to the AFG31000 resulting in waveform:

image