DoACSweep
- Updated2026-03-24
- 1 minute(s) read
Runs an AC sweep analysis.
Syntax
Sub DoACSweep( _
ByVal SweepType As SweepType, _
ByVal numPoints As int32, _
ByVal startFrequency As Double, _
ByVal stopFrequency As Double, _
ByVal outputNames As Variant)
Parameters
sweepType—Type of sweep required: decade, octave or linear.
numPoints—The number of data points to simulate. If sweepType is linear, this value equals the total number of points, otherwise it is the number of points per decade/octave.
startFrequency—Frequency at which to start the sweep.
stopFrequency—Frequency at which to end the sweep.
outputNames—Array of output names for which data is stored.
Remarks
Results are generated for all outputs in the outputNames array. The results can be retrieved by the GetOutputData function.
This function is asynchronous and can trigger SimulationStop events or a return from WaitForNextOutput.
Any of the names in the list returned by EnumOutputs may be used in the outputNames list.
Example
Dim outputs() As String
outputs = Circuit.EnumOutputs(SimulationIOAll)
Dim nPoints As Integer
Dim startFreq As Double
Dim stopFreq As Double
nPoints = 100
startFreq = 1
stopFreq = 100
Call Circuit.DoACSweep(sType, nPoints, startFreq, stopFreq, outputs)
Circuit.WaitForNextOutput
Do While (Not Circuit.OutputReady(outputs(0)))
Loop
' Retrieve the outputs
Dim dataArray As Variant
Call Circuit.GetOutputData(outputs(0), dataArray, SimulationInterpolationRaw)