AnsweredAssumed Answered

PNA c COM Channel management and measurement ??

Question asked by bluehound on Jul 18, 2009
Latest reply on Jul 21, 2009 by daras
Hi,

We have decides to start the cross over to C# and COM software in our test engineering.

I am doing some excersises to become familiar with controlling our PNAXs.

I have 4 channels (Iset up manually), and I want to jump through each one and grab the activetrace.

My code is only returning the last channel I manually selected.

What am I missing ?   heres what I have ....

************************************************************************************
            AgilentPNA835x.IApplication4 pnaxHandle;

            Type pna = Type.GetTypeFromProgID("AgilentPNA835x.Application", connectString);
            pnaxHandle = (AgilentPNA835x.IApplication4)Activator.CreateInstance(pna);
            pnaxHandle.ActiveChannel.Single(false);
            int NumberOfPoints = pnaxHandle.ActiveChannel.NumberOfPoints;

            float[] MagData = new float[NumberOfPoints];
            float[] PhaseData = new float[NumberOfPoints];

            AgilentPNA835x.IArrayTransfer Measurement;

            pnaxHandle.Channel(1);
            pnaxHandle.ActiveChannel.Single(true);
            Measurement = (AgilentPNA835x.IArrayTransfer)pnaxHandle.ActiveMeasurement;
            Measurement.getPairedData(AgilentPNA835x.NADataStore.naCorrectedData, AgilentPNA835x.NAPairedDataFormat.naLogMagPhase, ref NumberOfPoints, out MagData[0], out PhaseData[0]);
            pnaxHandle.ActiveChannel.Single(false);
            waveformGraph1.PlotWaveform(NationalInstruments.AnalogWaveform.FromArray1D(MagData));

            pnaxHandle.Channel(2);
            pnaxHandle.ActiveChannel.Single(true);
            Measurement = (AgilentPNA835x.IArrayTransfer)pnaxHandle.ActiveMeasurement;
            Measurement.getPairedData(AgilentPNA835x.NADataStore.naCorrectedData, AgilentPNA835x.NAPairedDataFormat.naLogMagPhase, ref NumberOfPoints, out MagData[0], out PhaseData[0]);
            pnaxHandle.ActiveChannel.Single(false);
            waveformGraph2.PlotWaveform(NationalInstruments.AnalogWaveform.FromArray1D(MagData));

            pnaxHandle.Channel(3);
            pnaxHandle.ActiveChannel.Single(true);
            Measurement = (AgilentPNA835x.IArrayTransfer)pnaxHandle.ActiveMeasurement;
            Measurement.getPairedData(AgilentPNA835x.NADataStore.naCorrectedData, AgilentPNA835x.NAPairedDataFormat.naLogMagPhase, ref NumberOfPoints, out MagData[0], out PhaseData[0]);
            pnaxHandle.ActiveChannel.Single(false);
            waveformGraph3.PlotWaveform(NationalInstruments.AnalogWaveform.FromArray1D(MagData));

            pnaxHandle.Channel(4);
            pnaxHandle.ActiveChannel.Single(true);
            Measurement = (AgilentPNA835x.IArrayTransfer)pnaxHandle.ActiveMeasurement;
            Measurement.getPairedData(AgilentPNA835x.NADataStore.naCorrectedData, AgilentPNA835x.NAPairedDataFormat.naLogMagPhase, ref NumberOfPoints, out MagData[0], out PhaseData[0]);
            pnaxHandle.ActiveChannel.Single(false);
            waveformGraph4.PlotWaveform(NationalInstruments.AnalogWaveform.FromArray1D(MagData));

************************************************************************************

Thanks !
Brent  

Outcomes