Keysight 89600 VSA .NET API
SaveWaveformToFile Method
See Also  Example
Keysight.SA.Vsa.FlexFrame.Interfaces Assembly > Keysight.SA.Vsa.FlexFrame Namespace > MeasurementExtension Class : SaveWaveformToFile Method


carrierIndex
Zero-based index of the component carrier to save. Use -1 to save all carriers; in that case, the method appends _CCk before the file extension for each carrier k.
fileName
Destination file path. When carrierIndex is -1, this is treated as a base path; per-carrier files are written as <baseName>_CCk<extension> in the same directory. The directory is created if it does not exist.

Glossary Item Box

Saves the generated waveform to a file for one carrier or for all carriers, writing in MAT v7 format via the platform data-file utility.

Syntax

Visual Basic (Declaration) 
Public Overridable Sub SaveWaveformToFile( _
   ByVal carrierIndex As Integer, _
   ByVal fileName As String _
) 
C# 
public virtual void SaveWaveformToFile( 
   int carrierIndex,
   string fileName
)
C++/CLI 
public:
virtual void SaveWaveformToFile( 
   int carrierIndex,
   String^ fileName
) 

Parameters

carrierIndex
Zero-based index of the component carrier to save. Use -1 to save all carriers; in that case, the method appends _CCk before the file extension for each carrier k.
fileName
Destination file path. When carrierIndex is -1, this is treated as a base path; per-carrier files are written as <baseName>_CCk<extension> in the same directory. The directory is created if it does not exist.

Exceptions

ExceptionDescription
System.ObjectDisposedException Thrown if the owning object has been disposed.
System.ArgumentNullExceptionThrown when fileName is null.
System.ArgumentExceptionThrown when fileName is empty or whitespace.
System.ArgumentOutOfRangeExceptionThrown when carrierIndex is not in the valid range (0..N-1) and is not -1.
System.InvalidOperationException Thrown when no component carriers are configured; when the measurement subsystem or the file-utility service is unavailable; when no valid waveform data are present for the requested carrier(s); or when FlexFrame waveform generation is not licensed (if required).
System.IO.DirectoryNotFoundException Thrown when the directory cannot be created or resolved.
System.IO.IOException Thrown on I/O errors while writing or replacing the file.

Remarks

The method validates that measurement data CC{k}_Generated_Time1 exist, are marked as valid, and contain at least one point. Files are written atomically: data are first written to a temporary file and then moved/replaced at the destination. If a destination file already exists, it is replaced. The MAT header includes the carrier center frequency and the time-step (XDelta).

Example

C#Copy Code
// Save a single carrier
SaveWaveformToFile(1, @"C:\Temp\wave.mat"); // writes C:\Temp\wave.mat
            
// Save all carriers (e.g., 3 CCs)
SaveWaveformToFile(-1, @"C:\Temp\wave.mat");
// writes:
//   C:\Temp\wave_CC0.mat
//   C:\Temp\wave_CC1.mat
//   C:\Temp\wave_CC2.mat

Requirements

Target Platforms: Windows 11 Professional or Enterprise; Windows 10 Professional, Enterprise, or Education (64-bit)

Minimum Software Version Requirement: Keysight 89600 VSA Ver 30.00

See Also