AnsweredAssumed Answered

PNA 5230A: retrieveng data, altering Display Traces?

Question asked by aforns on Aug 20, 2009
Latest reply on Aug 20, 2009 by odanzy

I had done a VB function to retrieve measurement data with the PNA 5230A, but I need to improve it. It works well, but each S parameter I retrieve I have to "create" and "delete" a mesurement and thus a new trace is created and deleted each time in the screen. Altough I need all the S parameter data, not all the S parameters are present in the display, because I am working with 4 port PNA. I'd like not to alter the trace configuration and if it's possible to make the retriving faster.

I've tried some SCPI commands for the retreiving part, but it doesnt work.

The code part is:

For pIn = 1 To NumberOfPorts
        For pOut = 1 To NumberOfPorts

                NA.Channels.item("Channel1").Measurements.item("Measurement1").Create pOut, pIn
                NA.Channels.item("Channel1").Measurements.item("Measurement1").SetSParameter pOut, pIn
                NA.Channels.item("Channel1").Measurements.item("Measurement1").Format = AgilentNAMeasurementPhase
                PhaseX() = NA.Channels.item("Channel1").Measurements.item("Measurement1").FetchFormatted
                NA.Channels.item("Channel1").Measurements.item("Measurement1").Format = AgilentNAMeasurementLogMag
                MagnitudeX() = NA.Channels.item("Channel1").Measurements.item("Measurement1").FetchFormatted

            If pIn = 1 And pOut = 1 Then
                ReDim Magnitude(1 To NumberOfPorts, 1 To NumberOfPorts, LBound(MagnitudeX()) To UBound(MagnitudeX()))
                ReDim Phase(1 To NumberOfPorts, 1 To NumberOfPorts, LBound(PhaseX()) To UBound(PhaseX()))
            End If
            For iVal = LBound(MagnitudeX()) To UBound(MagnitudeX())
                Magnitude(pOut, pIn, iVal) = Round(MagnitudeX(iVal), 3)
                Phase(pOut, pIn, iVal) = Round(PhaseX(iVal), 3)
            Next iVal
            Erase MagnitudeX()
            Erase PhaseX()
            On Error Resume Next
            On Error GoTo 0
        Next pOut
    Next pIn

Thank you.