configure_afg
Set signal parameters like waveform, amplitude, frequency, phase, duty, or modulation on the built-in function generator without changing output state. Use enable_afg to emit the configured waveform.
Instructions
Configure the built-in function generator (AFG). Omitted items are left unchanged.
This never turns the generator output on or off. The output state is not touched at all, so nothing new reaches the wiring: a configured generator only emits a signal once its output is enabled with the separate, confirmation-gated tool enable_afg (and disable_afg turns it off again). Read the current output state with get_afg_state.
channel is the generator channel (1 or 2 on MHO98; see get_capabilities afg_channels). Specify at least one item to change.
waveform is sine / square / ramp / noise / dc / arb / exp_rise / exp_fall / ecg / gaussian / lorentz / haversine / sinc. amplitude_vpp is the peak-to-peak amplitude in volts (not the peak and not RMS), offset_v the DC offset in volts, frequency_hz the frequency in hertz, phase_deg the phase in degrees (0-360), duty_percent the duty cycle of the square wave (1-99) and symmetry_percent the symmetry of the ramp (0-100). Duty and symmetry are stored independently of the current waveform, so they can be set at any time.
impedance is "highz" or "50" and is the GENERATOR's own output impedance setting, i.e. the load the amplitude is calibrated for. It has nothing to do with the oscilloscope input impedance of configure_channel.
The frequency and amplitude limits depend on the installed options and on impedance, and the instrument clamps an out-of-range value silently (no error is reported): always compare applied (the read-back value) against requested. Writing a frequency while the waveform is dc or noise is rejected by the instrument.
arb_file selects an existing arbitrary waveform file already stored on the instrument (local C:/... or USB D:/...), e.g. arb_file="D:/my.csv" together with waveform="arb". This server never creates, uploads or deletes instrument files - it only selects one that is already there.
modulation configures AM/FM/PM (internal source only; there is no external modulation input). Give a dict with any of: enabled (bool), type ("am"/"fm"/"pm"), am_depth_percent (0-120), fm_deviation_hz (>0), pm_deviation_deg (0-360), frequency_hz (the MODULATING frequency, not the carrier - 2 mHz to 1 MHz), waveform (sine/square/triangle/upramp/ dnramp/noise, the modulating waveform). frequency_hz and waveform are routed to the type given in the same call, or otherwise to whatever type is currently set on the instrument. The instrument silently ignores modulation parameter writes while modulation is off, so pass enabled=true together with the parameters (the server sends the enable before the parameters); parameters alone are rejected while modulation is off. Enabling modulation does NOT turn the output on, but if the output is already on, modulation takes effect immediately.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| channel | No | ||
| arb_file | No | ||
| offset_v | No | ||
| waveform | No | ||
| impedance | No | ||
| phase_deg | No | ||
| modulation | No | ||
| duty_percent | No | ||
| frequency_hz | No | ||
| amplitude_vpp | No | ||
| symmetry_percent | No |