SM API
|
Any application using the SM API will follow these steps to interact and perform measurements on the device.
How a device is opened depends on whether the device operates over USB 3.0 or 10GbE.
Opening a USB 3.0 device is done through the smOpenDevice or smOpenDeviceBySerial functions. These functions will perform the full initialization of the device and if successful, will return an integer handle which can be used to reference the device for the remainder of your program. See the list of all USB SM devices connected to the PC via the smGetDeviceList function.
Opening a networked device is done through the smOpenNetworkedDevice function. All networked devices have a default network configuration that can be modified using the methods described below.
There are two ways to change the network settings of a 10GbE based SM spectrum analyzer.
Once the device is open, the next step is to configure the device for a measurement. The available measurement modes are listed on the mainpage. Each mode has specific configurations routines, which set a temporary configuration state. Once all configuration routines have been called, calling the smConfigure function copies the temporary configuration state into the active measurement state and the device is ready for measurements. The provided code examples showcase how to configure the device for each measurement mode.
After the device has been successfully configured, the API provides several functions for acquiring measurements. Only certain measurements are available depending on the active measurement mode. For example, I/Q data acquisition is not available when the device is in a sweep measurement mode.
Stopping all measurements is achieved through the smAbort function. This causes the device to cancel or finish any pending operations and return to an idle state. Calling smAbort is never required, as it is called by default if you attempt to change the measurement mode or close the device, but it can be useful to do this.
When finished making measurements, you can close the device and free all resources related to the device with the smCloseDevice function. Once closed, the device will appear in the open device list again. It is possible to open and close a device multiple times during the execution of a program.
Recalibration is performed each time the device is reconfigured (smConfigure). For instance, when the device is configured for I/Q streaming, the instrument and measurement is calibrated for the current environment and will not be calibrated again until the device measurement is aborted and started again (read: the device will not recalibrate in the middle of measurements, as this would interrupt measurements such as I/Q streaming or real-time analysis).
Large temperature changes affect measurements the most, and it is recommended to reconfigure the device once a large temperature delta has been recorded.
It is recommended to use the RFBoard temperature from the smGetFullDeviceDiagnostics function to detect a temperature drift and recalibrate again when you see a drift of 2-4 degrees Celsius. Using the temperature returned from smGetDeviceDiagnostics is also a valid approach but this function returns the FPGA temperature which has less correlation with the temperature corrections and tends to be more volatile.