Specifying Setting Parameters
- Updated2023-02-21
- 5 minute(s) read
You can specify the following parameters for the sweep setting inside of the setting brackets: AveragingFactor, freq, freqStart,freqStop, IFBW, numPoints, numPorts, portPower, segments, stepSize, and type.
Refer to the following table for more information about the sweep setting parameters.
| Parameter Name | Description | Data Type | ||
|---|---|---|---|---|
| AveragingFactor | Specifies the number of times the data in the sweep is averaged before being calculated in all segment types. This parameter is required for all segment types. | Number | ||
| freq | Specifies the frequency in a zeroSpan segment type. This parameter is required for the zeroSpan segment type and is invalid for the startStop and the startStep segment types. | Number | ||
| freqStart | Specifies the beginning of the frequency range. This parameter is required for the startStop and the startStep segment types and is invalid for the zeroSpan segment type. | Number | ||
| freqStop | Specifies the end of the frequency range. This parameter is required for the startStop segment type and is invalid for the startStep and the zeroSpan segment types. | Number | ||
| IFBW | Specifies the intermediate frequency bandwidth in all segment types. This parameter is required for all segment types. | Number | ||
| numPoints | Specifies the number of points in all segment types. This parameter is required for all segment types. | Number | ||
| numPorts | Specifies how many ports are swept.
|
Number | ||
| portPower | Specifies the power at each respective port, depending on the numPorts parameter specified in all segment types. This parameter is composed of a table that is specified by an opening and closing brace, for example, {}. This parameter is required for all segment types.
|
Number(s) | ||
| segments | Specifies the start of the list of segments in the configuration file. | String | ||
| stepSize | Specifies the step size of the frequency range. You can use this parameter along with the numPoints and freqStart parameters to calculate the end of the frequency range. This parameter is required for the startStep segment type and is invalid for the startStop and the zeroSpan segment types. | Number | ||
| type | Specifies the type of segment. The following values are valid for the type parameter:
|
String |
Formatting Parameters
You must nest all the previous parameters except for numPorts and segments underneath the segments parameter. The following example shows the format of a startStop segment of setting1 and its parameters:
SweepSettings["setting1"] =
{
["numPorts"] = 2,
["segments"] =
{
{
["type"] = "startStop",
["freqStart"] = 10*Mega,
["freqStop"] = 1*Giga,
["IFBW"] = 100*kilo,
["numPoints"] = 3,
["portPower"] =
{
1,
1
},
["AveragingFactor"] = 1
},
}
};
You must place a comma after the closing brace of each segment and after you specify a value for a parameter, unless the parameter is the final parameter in the segment.
![]() |
Note Placing a comma incorrectly results in a NIVNA_ERROR_INVALID_CFG_FORMAT error. |
All parameters are case-sensitive and must be specified using the correct case. For example, NumPoints is not valid, whereas numPoints is valid. All parameters must also be surrounded by open and closed brackets as well as opening and closing quotation marks, for example, ["parameterName"], where parameterName is the name of a parameter.
Formatting the portPower Parameter
The portPower parameter is the only parameter that deviates from the format of the other parameters specified in the segments parameter. The portPower parameter can be described as either one or two parameters, so it has a table format.
After specifying the portPower parameter, you must create open and close braces which end in a comma depending on if portPower is the last parameter defined in the segment. Inside of the portPower braces, you must specify the port powers at each port and the last port power should not have a comma after it. If you specify only one port power then the table will contain only one number as shown in the following example:
["portPower"] =
{
-5
}
Parameter Data Ranges
Most of the setting parameters have valid data ranges that you can specify. If you set the value of a parameter to a value outside the data range, NI-VNA returns the error NIVNA_ERROR_DATA_OUT_OF_RANGE.
Refer to the following table for the valid data ranges of the setting parameters.
| Parameter Name | Lower Bound | Upper Bound |
|---|---|---|
| AveragingFactor | 1 | 1024 |
| freq | 50 Hz | 8.5 GHz |
| freqStart | 50 Hz | 8.5 GHz |
| freqStop | 50 Hz | 8.5 GHz |
| IFBW | 10 Hz | 500 kHz |
| numPoints | 1 | 20001 |
| numPorts | 1 | 2 |
| portPower | -30 dB | 30 dB |
The value that you specify for each of the previous parameters must be greater than or equal to the value in the Lower Bound column and less than or equal to the value in the Upper Bound column to be valid.
Implicitly Defined Parameters
You can implicitly use previously defined values for the AveragingFactor, IFBW, and portPower parameters in any subsequent segment of the first segment in the segments list. If you do not define a value for the AveragingFactor, IFBW, and/or portPower parameter in any subsequent segment of the first segment, NI-VNA uses the most recently defined value of that parameter.
![]() |
Note You must define a value for all required parameters for the first segment in the segments list, otherwise NI-VNA returns the error NIVNA_ERROR_REQUIRED_PARAMETER_NOT_FOUND. |
The following example shows the AveragingFactor, IFBW, and portPower parameters using previously defined values:
SweepSettings["setting1"] =
{
["numPorts"] = 2,
["segments"] =
{{
["type"] = "startStop",
["freqStart"] = 10*Mega,
["freqStop"] = 1*Giga,
["IFBW"] = 100*kilo,
["numPoints"] = 3,
["portPower"] =
{1,
1},
["AveragingFactor"] = 1},
{["type"] = "startStep",
["freqStart"] = 2*Giga,
["stepSize"] = 10*kilo,
["IFBW"] = 1*kilo,
["numPoints"] = 5,
["portPower"] =
{0,
-5}
}, --Note: the AveragingFactor parameter uses the value in the startStop segment.
{["type"] = "zeroSpan",
["freq"] = 1*Giga,
["numPoints"] = 5}, --Note: the IFBW and portPower parameters use the values in the startStep segment and the AveragingFactor parameter uses the value in the startStop segment.
}
};
In the previous example, the first segment, startStop, defines all required parameters, including AveragingFactor, IFBW, and portPower. The AveragingFactor parameter is missing in the second segment, startStep, because it uses the value of 1 in the previous segment, startStop. The IFBW and portPower parameters are missing in the third segment, zeroSpan, because they use the values of 1*kilo and {0,-5} respectively, in the second segment, startStep.
