The RSM Class provides a easy means for controlling a remote spectrum monitor. The properties and methods of this class map directly to the SCPI commands described in the instrument Programming Manual.
Since the properties and methods act directly on a remote spectrum monitor, you must first set the URL property before using other properties and methods.
Properties
RSM.AntennaPort Property
Gets or sets the active antenna port of multi-channel remote spectrum monitors such as MS27103A.
Type: String. Units are expected. If no units are provided, Hz is assumed.
Remarks
Setting the Center Frequency does not change the span, but does change both the start and stop frequencies. Allowed units are 'Hz', 'kHz', 'MHz' and 'GHz'. The Vision API verifies that the value is positive but does not verify the upper range, as this can vary across the support products. If the value is not valid, nothing is set. Reading back the value is the best way to verify success.
RSM.ChannelPower Property
Returns the Channel Power calculated for the most recent trace acquired from the active remote spectrum monitor.
Gets or sets a parameter that determines how GPS coordinates are displayed.
VB
Public Property GPSDisplay() As GPSDisplayMode
C#
public GPSDisplayMode GPSDisplay {get; set;}
C++
public GPSDisplayMode GPSDisplay {get; set;}
Property Value
Either GPSDisplayMode.GPS_Decimal or GPSDisplayMode.GPS_DMS
Remarks
Sets whether GPS coordinates are displayed as decimal numbers, or with degree-minute-second format. This is not a setting on the remote spectrum monitor. It affects the Vision API behavior only.
Type: String. The value is expected to carry units (kHz or MHz). If no units are included, Hz is assumed.
The allowed values are limited to a redefined set. These are: 13.3 kHz, 26.7 kHz, 66.7 kHz, 133 kHz, 267 kHz, 667 kHz, 1.33 MHz, 2.67 MHz, 6.67 MHz, 13.3 MHz and 20 MHz. If you try to set a different value, the next higher value is chosen. So if you try to set it to 200 kHz, you will get 267 kHz.
Remarks
Setting the bandwidth also sets the sample rate. Higher bandwidths use higher sample rates.
You can refer to the UG for the remote spectrum monitor for the exact correlation to bandwidth and sample rates. Generally, the sample rate is about equal to the bandwidth. For example, a bandwidth of 133 kHz has a sample rate of 150,000 I/Q samples/second. A bandwidth of 20 MHz has a sample rate of about 25,000,000 sample per second. So increasing the sample rate greatly increases the number of bytes that have to be transfered and stored when doing an I/Q capture. Consequently, the capture length can be constrained by the bandwidth. At lower capture bandwidths you can do 10 second captures. At higher bandwidths this is not possible. At 20 MHz, 2 seconds is the longest allowed capture length.
Setting the bit depth affects several aspects of the I/Q capture process.
First, the higher the bit resolution, the larger the capture size in bytes. When compared to an 8 bit capture, a 24 bit capture takes 3 times as long to download from the probe, and also occupies 3 times as much disk space. The remote probes have a fixed amount of memory for storing I/Q capture data, so higher resolution may affect available capture lengths.
Second, a higher bit resolution greatly increases the integrity of the captured signal. An 8 bit capture usually is insufficient for a useful capture. If the reference level is not set near to the peak level of the signal being captured, then the effective resolution is lower, as several of the higher bits will never be used. It isn't unusual in an 8 bit capture to only use 4 bits for the actual data because of where the reference level is set. When this is plotted, the I/Q pairs will form a series of columns and rows on the plot showing the very low resolution of the actual data capture. In most cases, 16 bit is the best trade-off between data integrity and size/speed considerations.
When doing TDOA, one of the bits in each sample is used to carry timing information. For 10 and 24 bit depths, there are extra bits available and the resolution is not affected. For 8 and 16 bit depths, turning on the time stamping effectively lowers the resolution by one bit.
RSM.IQCaptureLength Property
Gets or sets the time length of an I/Q capture. Input is in milliseconds
Type: Integer. The number of milliseconds to capture.
Remarks
Capture length is directly proportional to capture size. The allowed length is constrained to some degree by both the bit solution and by the capture bandwidth.
Following a successful I/Q capture, use IQ_I to return a reference to the integer array hold the I values. Use IQ_I.Count to get the number of samples. Use IQ_I.Clone to make a deep copy.
RSM.IQ_Plot Property
Returns a bitmap of the IQ values plotted with I on the horizontal axis and Q on the vertical. This must follow a call to IQCapture.
VB
Public ReadOnly Property IQ_Plot(ByVal Width As Integer,ByVal Height As Integer) As Bitmap
C#
[System.Runtime.CompilerServices.IndexerName("IQ_Plot")] public Bitmap this[intWidth,intHeight] {get;}
C++
[System.Runtime.CompilerServices.IndexerName("IQ_Plot")] public Bitmap this[intWidth,intHeight] {get;}
Parameters
Width: The width of the resultant bitmap.
Height: The height of the resultant bitmap.
Property Value
Type: Bitmap
Remarks
Typically, you will define a target, such as s picture box or panel that you want to assign the bitmap to, using either the Image property or the BackgroundImage property of the target control. Then you can use PictureBox.Image = Probe.IQPlot().
Since the IQPlot method returns a reference to a standard Windows Bitmap, you can use it anyplace in code where you might use a bitmap reference. To save directly to file, you can use the Save property of the Bitmap object. For example, Probe.IQPlot().Save(Filename, Filetype).
This value is the display reference level, which means it has the reference level offset applied. It also means that a change to the reference level offset will change this setting (though the actual, unadjusted reference level will stay the same).
RSM.ReferenceLevelOffset Property
Gets or sets the reference level offset value for the y-axis.
This offset is used for display purposes only, and does not affect the actual reference level used for auto attenuation coupling, or any other settings that depend on reference level.
RSM.StartFrequency Property
Gets or sets the start frequency for the active remote spectrum monitor.
Type: String. Units are expected. If no units are provided, 'Hz' is assumed.
Remarks
Setting the Start Frequency also changes the span and center frequency. It does not change the stop frequency. Frequency inputs are ranged checked to be positive, but no upper range is verified as the frequency range varies across supported products.Remarkse best way to verify the setting is to read back the value.
RSM.StopFrequency Property
Gets or sets the Stop Frequency of the active remote spectrum monitor.
Type: String. Units are expected. If no units are provided, 'Hz' is assumed.
Remarks
Setting the Stop Frequency also changes the span and center frequency. It does not change the start frequency. Frequency inputs are ranged checked to be positive, but no upper range is verified as the frequency range varies across supported products. The best way to verify the setting is to read back the value.
RSM.Streaming Property (Read Only)
AM/FM streaming is a continuous process that once started, continues until it is either stopped by the RSM.StopStreaming() method or by a change in sweep parameters on the RSM. To determine if the RSM is still streaming audio, check this property.
True is AM or FM audio is currently streaming; False otherwise.
RSM.SweepMode Property
Gets or sets the type of sweep mode for active remote spectrum monitor. Modes are Single Trace, All Traces, Min Hold Trace, Max Hold Trace, and Average Trace.
Gets or sets the type of sweep mode for active remote spectrum monitor. Modes are Normal Trace, Rolling Min, Rolling Averaging, Rolling Max, and Trace Count.
Type: String. Default value is null reference (Nothing in Visual Basic)
Remarks
This property must be set before other methods and property can be used in any meaningful way.
The URL can be an IP address (xxx.xxx.xxx.xxx) or a host name registered with a domain name server. It is the same name for the probe that would be used if accessing the probe via the web browser interface.
RSM.Units Property
Gets or sets the units of the desired measurement type.
This value is not sent to the remote spectrum monitor and does not affect its display. The Vision API generates its own trace graphs from trace data downloaded from the remote probe. This value is internal only. Valid values range from 1 to 20 dBm/Division.
Methods
RSM.AMModulation Method
Sets the frequency of the RSM and an appropriate bandwidth for an AM signal. Measures the AM Modulation for the indicated time, then returns a numeric value indicating the Modulation Index as a percentage.
(ByValue CarrierFrequency as Long, ByVal RunTimeSeconds as Integer)
Input Fields
VB
Public AmModulation(ByVal CarrierFrequency As String,ByVal Integer,ByVal RunTimeSecondsInteger)
C#
public AmModulation(stringCarrierFrequency,intRunTimeSeconds,int
C++
public AmModulation(stringCarrierFrequency,intRunTimeSeconds,int
Remarks
Input Fields
CarrierFrequency (String): The carrier frequency of the signal to measure. Units are allowed. If units are not included, Hz is assumed.
RunTimeSeconds (Integer): The number of seconds to perform the measurement.
Return Type: SingleReturns the AM modulation index at the set frequency, measured over the set time, as a percentage.
RSM.CaptureIQ Method
Initiates IQ capture on the current probe. When complete, the I/Q sample pairs are available using the IQ_I and IQ_Q properties of the class.
Type: Boolean. Returns true if the IQ capture is successful; otherwise, returns false.
Remarks
Before using the CaptureIQ method, you must first set the following properties: center frequency, reference level, IQBitDepth, IQBandwidth, & IQCaptureLength. Failing to do so will produce undefined results, meaning previous or default values may be used. If you are making repeat measurements on the same probe and with the same capture parameters, you do not need to reset them between each call to IQCapture. However, if another remote user accesses the probe, the parameters may change.
On a multi-channel probe, be sure to set the correct antenna channel.
This function may take several seconds to return, depending on the capture length, bit depth and bandwidth, and also on the Internet connection bandwidth. I/Q captures can produce very large result arrays, so the download time will be long on a slow network connection. For instance, a 16 bit capture at 20 MHz for 1 second produces 100 MBytes of data.
RSM.CheckOption Method
VB
Public Function CheckOption(ByVal As String) Return Type As Boolean
C#
public string CheckOption as(bool)
C++
public string CheckOption as(bool)
Return Value
True if the option is installed; False if it is not installed.
RSM.CreatePlayBackWaveFile
When streaming AM or FM audio, small (~ 3 second) sound chunks are received and stored as .wav files in a temporary folder on your PC. This method combines these files into a single output file and moves it to the location of your choice. The smaller files are deleted from the temporary folder.
There is a program named Lame.exe that is included in the application folder. If this program is present, then it is used to convert the .wav output into mp3 format. The .wav files are uncompressed audio, and take up a lot of space. The mp3 files are much more compact. If you intended to capture a lot of audio, you will want to use the compressed format.
This can produce decent output if you have captured an AM signal, with appropriate depth and bandwidth. For best results, set the reference level within 10 dB of the signal peak height.
RSM.PlayIQ_FM Method
This attempts to do an FM demodulation of the current I/Q capture data and play it on the system speaker.
This can produce decent output if you have captured an FM signal, with appropriate depth and bandwidth. Wide-band FM typically works best with 267 khz capture bandwidth at 16 bit resolution. You can capture upto 5 seconds of audio with these parameters. For narrow-band FM, you can capture longer. For best results, set the reference level within 10 dB of the signal peak height.
Under unusual circumstances, the Ethernet port that receives and processes SCPI commands on the remote probe can get stuck. When this occurs, this API command may remove the obstruction.
Filename: Filename where the data is to be saved. This includes full path information. Network paths must be mapped to a drive letter.
Remarks
Existing files will be overwritten. If you want overwrite protection, provide that in the parent application. If you write to a protected folder, or try to overwrite an open file, an error will be returned.
Output format is ASCII. Two columns of integer values (I, Q) tab delimited, with each line ending in carriage return/line feed.
RSM.SaveIQ_AM Method
Save AM demodulated audio to a Windows .wav file for future playback.
RemoteFilename: The filename under which to save the measurement file. A folder can be specified as part of the filename. If a folder is given, that folder is expected to exist.
RSM.SaveSetup Method
Initiates a save configuration setup set by parameters.
VB
Public Function SaveSetup(ByVal RemoteFilename As String) As Boolean
RemoteFilename: The filename under which to save the current instrument setup. A folder can be specified as part of the filename. If a folder is given, that folder is expected to exist.
RSM.SendCommand Method
This method provides a means to send a SCPI command directly to the remote spectrum monitor. Although the properties and methods of this class cover most SCPI commands, there may be occasions where a user wants direct control to send exactly a sequence of Commands, or to send a command that is not mapped in the RSM Class. This method provides a simple interface to send any command detailed in the RSM Programming Manual directly to the RSM.
RSM.SweepGraph Method
Returns an image as a Windows Bitmap with the height and width as specified in the Parameters. This image is the Trace sweep graphed in standard X-Y coordinates.
VB
Public Function SweepGraph(ByVal Width As Integer,ByVal Height As Integer) As Bitmap
Returns an image as a Base64 encoded string of a Windows Bitmap, with the height and width as specified in the Parameters. This image is the Trace sweep graphed in standard X-Y coordinates.
VB
Public Function SweepGraph64(ByVal Width As Integer,ByVal Height As Integer) As String
Designates the number of bits used in I/Q captures. Higher bit resolution increases the size of the download from each target receiver. Lower bit resolution is not appropriate for most purposes; the I/Q plot will look odd, with I/Q values lining up in rows and columns. The best choice for most applications is 16 bits.
Value
BitDepth Values and Definitions
Value
Definition
Eight
8-bits used for each I & Q value.
Ten
10-bits used for each I & Q value.
Sixteen
16-bits used for each I & Q value.
TwentyFour
24-bits used for each I & Q value.
GPSDisplayMode Enumeration
Designates the display format for GPS coordinates.
Value
GPSDisplayMode Values and Definitions
Value
Definition
GPS_Decimal
Sets GPS display format to decimal notation.
GPS_DMS
Sets GPS display format to Degrees-Minutes-Seconds.