|Download Help (Windows Only)|
NI-RFmx is a family of instrument drivers that share a single session handle across multiple drivers. You must open one RFmx session per signal analyzer and use that single session handle to configure and perform measurements with the different drivers, such as SpecAn, Demod, LTE, and so on.
The RFmx driver has a shared set of API functions for opening and closing the RFmx session as well as configuring hardware settings, such as the Reference Clock configuration, that are shared across drivers. These shared functions are called the RFmxInstr driver. RFmxInstr does not contain any measurements, and you always use RFmxInstr along with one or more other RFmx drivers that expose the measurements you need to perform.
Some of the commonly used RFmxInstr-related APIs are replicated in other RFmx drivers. For example, RFmxSpecAn has an Initialize function, which in turn calls the Initialize function of RFmxInstr, so you can use the Initialize function of RFmxSpecAn to create the RFmx session. Similarly, some of the other commonly used APIs in RFmxInstr are replicated in the other drivers.
The following is an example of how you can use the NI-RFmx API drivers in C to capture a spectrum using the NI-RFmx SpecAn driver. The same sequence applies to other ADEs as well.
RFmxInstr_Initialize(resourceName, "", &instrumentHandle, NULL);//Step 1
RFmxInstr_CfgFrequencyReference(instrumentHandle, "", frequencyReferenceSource, frequency);//Step 2
RFmxSpecAn_CfgRF(instrumentHandle, "", centerFrequency, referenceLevel, externalAttenuation);//Step 3
RFmxSpecAn_SpectrumCfgSpan(instrumentHandle, "", span);
RFmxSpecAn_SelectMeasurements(instrumentHandle, "", RFMXSPECAN_VAL_SPECTRUM, RFMXSPECAN_VAL_TRUE);//Step 4
RFmxSpecAn_Initiate(instrumentHandle, "", "");//Step 5
RFmxSpecAn_SpectrumFetchSpectrum(instrumentHandle, "", timeout, &x0, &dx, spectrum, arraySize, NULL);//Step 6
RFmxInstr_Close(instrumentHandle, RFMXSPECAN_VAL_FALSE);//Step 7
When you use RFmxInstr functions to configure hardware settings in an RFmx session, those settings apply to all the RFmx drivers that are present in the same RFmx session. However, the following settings are RFmx driver-specific and are not shared across different RFmx drivers within the same RFmx session:
For example, if you are making both RFmx LTE and RFmx WCDMA measurements within one RFmx session, setting the frequency in RFmx LTE does not affect the frequency used in RFmx WCDMA.