Bode Automation Interface Overview
Here, you get an overview of the most important automation functions to communicate with the Bode 100 device and perform your first automated measurement using the Bode Automation Interface.
The Bode 100 requires a client computer with the OMICRON Lab VNA business logic and the required USB drivers installed.
Find more information about the software architecture and structure of the available interfaces for automated measurements using the Bode 100 here.
On a Windows computer, the Bode Analyzer Suite (BAS) installer will automatically install the necessary USB drivers and VNA business logic.
On a Linux-based computer, install the USB drivers and VNA business logic manually.
The Bode Analyzer Suite installer for Windows computer and a Linux package are available on our OMICRON Lab Download Area.
The minimum system requirements for using one device are available on the general System Requirements site.
The measurement modes available for our APIs and their default settings are in the Measurement Modes and Default Settings section.
To get an overview of the changes in version history, go to Changelog.
Note
- The Bode Automation Interface (BAS) is only available for Bode 100 devices and Windows.
- Using COM is not recommended for new developments. We recommend using the SCPI interface.
- To perform automated measurements with Bode 500 devices, use SCPI or LabVIEW ™.
- You can still access the automation interface if you're using a language other than C#. For detailed instructions, refer to Add AI Reference.
- The initial connection to the Bode 100 device may take around one minute because of the internal device calibration, which is performed when a Bode 100 is connected for the first time to a PC.
- Shut down the Bode 100 device after you have completed your measurements using the ShutDown() function.
- For programming languages that need enumerations as int, string, decimal, or other formats, look at the OmicronLab.VectorNetworkAnalysis.AutomationInterface.Enumerations.
General Structure of an Automated Application
The general structure of an automated application using the Bode Automation Interface basically consists of 4 parts.
On this page, we will first explain these four parts in detail.
We provide a clear step-by-step example in C# on ‘How to create a Bode Automation Interface Application for the Bode 100’ for a practical demonstration.
BodeAutomationInterface
- The OmicronLab.VectorNetworkAnalysis.AutomationInterface.Interfaces.BodeAutomationInterface class acts as the entry point for the application.
- With this class, it is possible to search and connect to devices.
- The two events “DeviceAdded” and “DeviceRemoved” can be used to track whenever a Bode 100 is connected or disconnected from the computer.
BodeAutomationInterface Class Overview
Property / Method / Event | Parameters | Return Type | Description |
---|---|---|---|
Version | - | String | Version number as text |
Connect | None | BodeDevice | Connects to the first found Bode 100 device. |
ConnectWithSerialNumber | 1: [String] serial number | BodeDevice | Takes serial number as parameter. Connects to the Bode 100 device with the given serial number. |
ScanForAttachedDevices | None | String[] | Returns the serial numbers of all attached Bode 100 devices. |
ScanForFreeDevices | None | String[] | Returns the serial numbers of all free Bode 100 devices. |
SetLogToFile | 1: [String] log file path 2: [LogLevel] the log level | None | Sets up a file logger. |
SetLogToUdpStream | 1: [int] streaming port 2: [LogLevel] the log level | None | Sets up a stream logger. |
Dispose | - | - | Allows to free unneeded resources |
DeviceAdded | - | - | Triggers an event when a new Device is connected to the PC |
DeviceRemoved | - | - | Triggers an event when a connected device is removed from the PC |
InternalCalibrationUpdate | 1: [double] progress | - | Triggers an event during the internal device calibration |
BodeDevice
The OmicronLab.VectorNetworkAnalysis.AutomationInterface.Interfaces.BodeDevice represents a bode device. Here we can:
- Check the “DeviceType” (Bode 100 Revision 1 or 2).
- Trigger an "InternalCalibration".
- Select the "SourceMode" of the Device.
- Create a Measurement from an available Measurement Category.
To create a measurement, you can choose from three categories: Reflection, Impedance, and Transmission.
Connecting to a Bode device is not a big deal:
//Create the Bode Automation Interface
BodeAutomationInterface auto = new BodeAutomation();
//Automatically search and connect to the first found Bode 100
BodeDevice bode = auto.Connect();
BodeDevice Class Overview
Property / Method / Event | Parameters | Return Type | Description |
---|---|---|---|
DeviceType | - | String | Returns the DeviceType (Rev. 1 or Rev. 2) |
SerialNumber | - | String | Returns the serial number of the device |
InternalCalibration | - | InternalCalibration | Gets the internal calibration class. |
Reflection | - | Reflection | Gets the factory to create Reflection measurements. |
Impedance | - | Impedance | Gets the factory to create Impedance measurements. |
Transmission | - | Transmission | Gets the factory to create Transmission measurements. |
SourceMode | - | SourceMode | Select the SourceMode of the Device: AutoOff, AlwaysOn |
ShutDown | None | None | Shuts down the Device. This function is mandatory before ending the program. |
Measurement
The Bode devices support different Measurement Modes, which can be divided into three different Measurement Categories.
Measurement Categories
Reflection | Impedance | Transmission |
---|---|---|
S11ExternalCouplerMeasurement | OnePortMeasurement | GainMeasurement |
S11OnePortMeasurement | AdapterMeasurement | S21Measurement |
- | ExternalBridgeMeasurement | - |
- | SeriesThruMeasurement | - |
- | ShuntThruMeasurement | - |
- | VoltageCurrentGainMeasurement | - |
There are slightly different settings available for every measurement mode. For the standard measurement settings, have a look at Measurement Modes.
Note
The only mandatory setting is to configure the frequency range and the measurement points.
Measurement Classes Overview
In this section all possible Properties, Methods and Events from a measurement are listed. Have a look at the class description to see which of these are actually visible in the measurement mode of interest.
Property / Method / Event | Parameters | Return Type | Description |
---|---|---|---|
Attenuation | - | Attenuation | With this property the Attenuation Value for Channel1 and Channel2 can be changed. |
Calibration | - | GainCalibration ImpedanceCalibration |
Execute and Save/Load the Calibration. |
DutDelay | - | - | Gets or sets the Device under Test Delay value for the measurement. |
MeasurementFrequencies | - | double[] | Gets the measurement frequencies configure in "ConfigureSweep". |
NumberOfpoints | - | int | Gets the number of configured measurement points. |
ReveiverBandwidth | - | ReceiverBandwidth | Gets the configured max. receiver bandwidth. |
Results | - | ImpedanceResult GainResults |
Gets the Result object depending on the configured measurement mode. |
Shaping | - | Shaping | Gets shape object. There all shape configuration can be done. |
PortExtension | - | PortExtension | Gets port-extension object. There all port-extension related configurations can be done. |
StartFrequency | - | double | Gets the configured start frequency. |
StopFrequency | - | double | Gets the configured stop frequency. |
SweepMode | - | SweepMode | Gets the configured sweep mode. |
TerminationChannel1 | - | Termination | Gets or sets the Termination for Channel1. |
TerminationChannel2 | - | Termination | Gets or sets the Termination for Channel2. |
NominalImpedanceZ0 | - | - | Gets or sets the nominal impedance Z0. |
CalculateMeasurementTime | None | double | Precalculates the measurement time of a measurement. Note that this is just an approximation. |
ConfigureCustomSweep | 1: double[] frequencies | - | Configure a sweep measurement with custom frequencies. |
ConfigureSinglePoint | 1: double frequency | - | Configure a single point measurement. |
ConfigureSweep | 1: double StartFrequency 2: double StopFrequency 3: int NumberOfPoints 4: SweepMode |
- | Configure a sweep measurement with start and stop frequency, numberOfPoints and sweep mode. The frequencies will be calculated by these values. |
ExecuteMeasurement | None | ExecutionState | Executes the measurement, returns the state of the execution. |
GetSourceLevel | 1: LevelUnit | double | Return the source level depending ob the given unit. |
SetSourceLevel | - | double LevelUnit |
Sets the source leven depending on the unit. |
StopCurrentExecution | - | - | Stops the current execution. |
NewResultAvailable | 1: int result index | - | This event will be triggered everytime a new result is available. As parameter the actual measured frequency index is delivered. |
Averaging | - | Averaging | With this property the settings for the Averaging calculation can be changed. |
The following code snippet shows how a measurement can be created:
//Create a S21 Measurement
S21Measurement s21Measurement = bode.Transmission.CreateS21Measurement();
//Create a OnePort Measurement
OnePortMesurement onePortMeasurement = bode.Impedance.CreateOnePortMeasurement();
//Create a S11OnePort Measurement
S11OnePortMesurement measurement = bode.Reflection.CreateS11OnePortMeasurement();
Result
After creating and configuring a measurement, execute the measurement to obtain measurement results:
//Execute the measurement
ExecutionState state = s21Measurement.ExecuteMeasurement();
There are three different result classes available depending on the selected measurement mode.
- Transmission Measurements will return a GainResult.
- Impedance Measurements will return an ImpedanceResult.
- Reflection Measurements will return a ReflectionResult.
Every measurement allows access to the measured results by reading the Results property. Results are normally read after the execution has been completed.
Additionally, it is possible to get results during a running measurement by attaching to the NewResultAvailable(int index) event.
All result types allow access to the whole result array (e.g. Results.Magnitude) or index-based by using the "At" variant (e.g. Results.MagnitudeAt). The relation between index and frequency can be obtained easily by reading Results.MeasurementFrequency respectively Results.MeasurementFrequencyAt at the specific index.
Note
- Please do NOT use the functions returning the whole array DURING a measurement (e.g measurement.result.Magnitude(MagnitudeUnit unit)) because they are very slow.
- Please do NOT read QTg and Tg results during the sweep since they are calculated using next neighbour difference.
- Please look at the Best Practice for accessing QTg or Tg in combination with NewResultAvailable(int index).
- It is possible to convert impedance, reflection, or admittance results using the ImpedanceResult.AsAdmittance and the ReflectionResult.AsAdmittance property.
For more information about the Result Classes have a look at Result Types.
Reading Measurement Results Example:
//Read out the magnitude in dB.
double[] magnitudes = s21Measurement.Results.Magnitude(MagnitudeUnit.dB);
//Read out the measurement frequencies.
double[] measurementFrequencies = s21Measurement.Results.MeasurementFrequencies;
Console.WriteLine($"First frequency = {measurementFrequencies[0]}Hz");