ALIGN_PHASES_AFG31000
Download Flojoy Studio to try this app
Run this block to align the phases for ch1 and ch2. 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 is the reference? Returns: out : String Aligned channel phases
Python Code
from flojoy import flojoy, DataContainer, String, VisaConnection
from typing import Optional, Literal
@flojoy(inject_connection=True)
def ALIGN_PHASES_AFG31000(
connection: VisaConnection,
channel: Literal["1", "2"] = "1",
input: Optional[DataContainer] = None,
) -> String:
"""Run this block to align the phases for ch1 and ch2.
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 is the reference?
Returns
-------
String
Aligned channel phases
"""
afg = connection.get_handle()
afg.write(f"SOURCE{channel}:PHASE:INIT")
return String(s="Aligned channel phases")
Example App
Having problems with this example app? Join our Discord community and we will help you out!
In this example, an Tektronix AFG31000 is used to generate two waveforms.
First the necessary blocks were added:
CONNECT_AFG31000
RESET_AFG31000
- 2x
FUNCTION_AFG31000
ALIGN_PHASES_AFG31000
OUTPUT_AFG31000
SAVE_STATE_AFG31000
The instrument address was set for each AFG31000
block. Ensure the OUTPUT_AFG31000
block has both channels turn on.
The blocks were connected as shown and the app was run. The SAVE_STATE_AFG31000
block can be used to save and recall the current state of the AFG. However, you must use a OUTPUT_AFG31000
block to turn the outputs back on.
An oscilloscope was connected to the AFG31000 resulting in waveform: