01-23-2020 01:29 PM
I'm using the WLAN Rfmx library in the Analysis Only Mode to process some IQ I've captured from a NI VST(5840). I need to process the IQ separately. However when I call the analyse method I get the following error:
NationalInstruments.RFmx.WlanMX: -380469: Configure measurement failed to find the stored measurement sessions for active signal.
All the examples seem to be based on using the RfMx library to make the capture and analysis. I do however have this working in a similar way for some 5G stuff and so can't work out what I'm doing wrong with the WLAN library.
I'm using version 19.1.0.49152 of the WLAN library.
I've included some code below...I've snipped the code that configures the RFSG and RFSA components.
Any help would be much appreciated.
RFmxWlanMX wlan;
RFmxInstrMX instrSession = new RFmxInstrMX("", "AnalysisOnly=1");
double outputLevel = -30;
double headRoom = 10;
double inputLevel = outputLevel + headRoom;
double centerFrequency = 2e9;
double externalAttenuation = 0;
RFmxWlanMXStandard standard = RFmxWlanMXStandard.Standard802_11ax;
double channelBandwidth = 40e6;
int mcsIndex = 11;
int ruSize = 26; //?
int ruOffset = 0; //?
RFmxWlanMXOfdmGuardIntervalType guardIntervalType = RFmxWlanMXOfdmGuardIntervalType.OneByFour;
RFmxWlanMXOfdmHELtfSize heLtfSize = RFmxWlanMXOfdmHELtfSize.HELtfSize1x; // my waveform was set to zero.
int peDisambiguity = 0;
int measurementOffset = 0; /* (symbols) */
int maximumMeasurementLength = 9; /* (symbols) */
RFmxWlanMXOfdmModAccUnusedToneErrorMaskReference unusedToneErrorMaskReference = RFmxWlanMXOfdmModAccUnusedToneErrorMaskReference.Limit1;
RFmxWlanMXOfdmModAccAveragingEnabled averagingEnabled = RFmxWlanMXOfdmModAccAveragingEnabled.False;
int averagingCount = 10;
double timeout = 10.0;
bool averagingDone = false;
double compositeRmsEvmMean;
double compositeDataRmsEvmMean;
double compositePilotRmsEvmMean;
// Config WLAN
wlan = instrSession.GetWlanSignalConfiguration(); /* Create a new RFmx Session */
wlan.ConfigureFrequency("", centerFrequency);
wlan.ConfigureReferenceLevel("", inputLevel);
wlan.ConfigureExternalAttenuation("", externalAttenuation);
wlan.ConfigureStandard("", standard);
wlan.ConfigureChannelBandwidth("", channelBandwidth);
wlan.SetOfdmMcsIndex("", mcsIndex);
wlan.SetOfdmRUSize("", ruSize);
wlan.SetOfdmRUOffset("", ruOffset);
wlan.SetOfdmGuardIntervalType("", guardIntervalType);
wlan.SetOfdmHELtfSize("", heLtfSize);
wlan.SetOfdmPEDisambiguity("", peDisambiguity);
wlan.SelectMeasurements("", RFmxWlanMXMeasurementTypes.OfdmModAcc, true);
wlan.OfdmModAcc.Configuration.ConfigureMeasurementLength("", measurementOffset, maximumMeasurementLength);
wlan.OfdmModAcc.Configuration.SetUnusedToneErrorMaskReference("", unusedToneErrorMaskReference);
wlan.OfdmModAcc.Configuration.ConfigureAveraging("", averagingEnabled, averagingCount);
double seconds = 1 / rfsa.SamplingFreq;
NationalInstruments.PrecisionTimeSpan wtp = new NationalInstruments.PrecisionTimeSpan(seconds);
string resultString = RFmxWlanMX.BuildResultString("wlan");
// Create an object to hold the IQ data.
ComplexWaveform<ComplexSingle> iq = new ComplexWaveform<ComplexSingle>(0);
iq.PrecisionTiming = NationalInstruments.PrecisionWaveformTiming.CreateWithRegularInterval(wtp);
// Calulcate the total number of samples for the instantanious capture.
int TotalDwellSamples = (int)(rfsa.DwellTime * rfsa.SamplingFreq);
// Copy all of the stored IQ data into the NI object.
ComplexSingle[] iqData = new ComplexSingle[TotalDwellSamples];
for (int index = 0; index < TotalDwellSamples; index++)
{
iqData[index] = new NationalInstruments.ComplexSingle(rfsa.IBuffer[index], rfsa.QBuffer[index]);
}
iq.Append(iqData);
// Perform analysis.
wlan.AnalyzeIQ1Waveform("", resultString, iq, false, 0); //added result tag
// Fecth back results.
wlan.OfdmModAcc.Results.FetchCompositeRmsEvm("", timeout, out compositeRmsEvmMean, out compositeDataRmsEvmMean, out compositePilotRmsEvmMean);
Console.WriteLine("Composite Rms Evm Mean\t: {0} dB", compositeRmsEvmMean);
Console.WriteLine("Composite Rms(Data) Evm Mean\t: {0} dB", compositeDataRmsEvmMean);
Console.WriteLine("Composite Rms(Pilot) Evm Mean\t: {0} dB", compositePilotRmsEvmMean);
01-24-2020 12:50 PM
which line of code is causing the error ?
01-27-2020 07:50 AM
The following line was causing the error:
wlan.AnalyzeIQ1Waveform("", resultString, iq, false, 0); //added result tag
I have however fixed the issue ( thanks to Michael )
I had to add the a 'Commit' command before the Analyze method.
I had to also change the reset value in the analyze method arguments to true.
and finally I had to change the read evm back to include the resultString variable.
01-27-2020 09:07 AM
It is good that Michael whoever he is was able to help.
It is unhelpful to post a question and not follow up with a solution that you were given by "Michael".
.
01-27-2020 09:21 AM
I thought I did just reply with the solution?
01-27-2020 09:25 AM
Only after I posted.
.
01-27-2020 09:33 AM
I got some help from Michael Whitten an AE and replied to the forum shortly after I had tested the fix out....but yes I do agree you should always reply and no it wasn't because of your post.
Thanks for taking the time to view my post though.
Regards
01-27-2020 09:36 AM
bad timing I guess
01-28-2020 03:42 AM
It is not required to call "RFmx Commit" before AnalyzeIQ1Wfm.
However it is required to have the reset flag set to true for the analysis of the first record.
If Averaging is Enabled and greater than 1, the reset flag should be set to false starting from the second record.
See the RFmxSpecAn Analysis Only mode example for more information.
Hope this helps.