Example program: In addition to Python, it also provides control examples for C # and LabVIEW, covering scenarios such as waveform generation, modulation, and triggering;
VISA library compatibility: It explicitly supports TekVISA 4.0+and NI-VISA 5.0+, and it is not recommended to use older versions;
Firmware version description: Command differences between different firmware versions (such as some advanced commands requiring firmware ≥ 1.5.0).
Key issue
Question 1: How to ensure that the waveforms of two channels are "phase synchronized" when AFG1022 controls the output of two channels through SCPI commands? If there is still a phase deviation after synchronization, what commands can be used to adjust it?
answer:
1. Steps to ensure phase synchronization:
Enable channel synchronization function: Send command: SOURce: SYNC: STATe ON. At this time, the trigger signal of channel 2 will follow channel 1 to ensure that the output starting phase is consistent;
Unified trigger source: Set both channels' trigger sources to internal (TRIGger: SURCE INTernal) or the same external trigger (TRIGger: SURCE EXTernal) to avoid differences in trigger timing;
Same sampling clock: The two channels of AFG1022 share the same sampling clock without additional configuration, only ensuring that the channel synchronization function is enabled.
2. Phase deviation adjustment method:
If there is still a phase deviation after synchronization (such as channel 2 lagging behind channel 1 by 10 °), the phase of channel 2 can be fine tuned using the phase offset command:
Command format: SOURce2: PHAse: AJust<degrees>(phase adjustment range: -180 °~+180 °);
Example: SOURce2: PHAse: AJust 10 (leading channel 2 phase by 10 ° to offset the original lag);
Verification: Simultaneously collect the outputs of two channels through an oscilloscope, or check the phase setting (SOURce2: PHAse: ADJust?) to confirm the adjustment results.
Question 2: When using Python+pyvisa to control AFG1022 to generate a "10MHz square wave (duty cycle 30%, amplitude 8Vpp, DC offset 1V)", if the instrument does not output after executing the command, what are the possible reasons? Please list and provide troubleshooting steps according to priority.
answer:
1. Possible reasons and troubleshooting steps sorted by priority:
Steps for troubleshooting possible reasons for priority
1. Output not enabled. 1. Send query command: OUTPut: State? Confirm whether the return value is "ON";
If it is "OFF", send: OUTPut: STATe ON to enable output.
2 parameters exceed hardware limitations. 1. Check square wave frequency: 10MHz within the AFG1022 square wave frequency range (0.1Hz~120MHz), no problem;
2. Check the duty cycle: 30% is within the duty cycle range (10%~90%) corresponding to the 10MHz frequency, and there are no issues;
3. Check the amplitude and DC offset:
-Amplitude 8Vpp (maximum 20Vpp under 50 Ω load, compliant);
-DC offset 1V (± 10V under 50 Ω load, compliant);
-Key verification: amplitude+2 × DC offset ≤ 20V (8Vpp+2 × 1V=10V ≤ 20V, no overload).
3 command syntax errors 1. Check if the square wave configuration command is complete:
Correct command sequence:
-Choose square wave: SOURce: WAVEform SQUare;
-Set frequency: SOURce: FREQuency 10e6;
-Set duty cycle: SOURce: PULSe: DCYCle 30;
-Set amplitude: SOURce: VOLTage: AMPity 8;
-Set DC offset: SOURce: VOLTage: OFFset 1;
2. Enable command echo (SYSTem: ECHO ON), confirm that the sent command is consistent with the above and has no spelling errors (e.g. SOURce: PULSe: DCYCle mistakenly written as SOURce: SQARE: DCYCle).
4. Communication connection abnormality 1. Check VISA resource name: Confirm the resource name of AFG1022 through rm.list_desources() (e.g. USB interface is USB0:: 0x0699:: 0x0368:: C012345:: 0:: INSTR), ensure that the resource name connected in the code is correct;
2. Check the USB cable: Replace the USB 2.0 cable to avoid communication interruption caused by poor cable contact;
3. Restart the instrument: Power off and restart AFG1022 to establish a VISA connection again.
5 Instrument hardware failure 1. Execute self-test command: SYSTem: SELFtest? If "PASSED" is returned, it indicates that the hardware is normal. Otherwise, contact after-sales service;
2. Manual operation verification: Manually configure the same parameters through the instrument front panel, observe whether there is output, and rule out hardware problems other than programming control.
Question 3: In the "Modulation Function" of AFG1022, the "Modulation Depth" parameter range for AM modulation (amplitude modulation) is 0%~100%. Please explain the physical meaning of "Modulation Depth 50%" and use the SCPI command to implement "Channel 1 outputs a 100kHz sine wave carrier and uses a 1kHz sine wave for AM modulation (depth 50%, modulation source is internal)". At the same time, write a command sequence to query whether the modulation parameters have been successfully configured.
answer:
1. The physical meaning of "modulation depth 50%":
AM modulation (amplitude modulation) is the process of controlling the amplitude of a carrier signal through a modulation signal, causing the amplitude of the carrier signal to vary with the modulation signal. Modulation depth of 50% represents: