AnsweredAssumed Answered


Question asked by Jason1969 on Nov 30, 2011
Latest reply on Dec 2, 2011 by Jason1969
I calibrated a two-port PNA and saved the cal as "Test1.csa." What I want to do is, recall the file, and get the 4 S-Parameters, in Amplitude and Angle format(or Magnitude and Phase), just like the .s2p file. Do I have to sweep it 4 times (one for each S-parameter?) The code below produces S11 Magnitude only. How do I get Amplitude and Angle for all S-parameters? Thanks in Advance

  Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        vi = New Ivi.Visa.Interop.FormattedIO488
        drm = New Ivi.Visa.Interop.ResourceManager
        Dim opc_comp As String = Nothing
        Dim points As Single = 0
        Dim data() As Single

        'connect to pna
        vi.IO = drm.Open("GPIB0::16::INSTR", Ivi.Visa.Interop.AccessMode.NO_LOCK, 0, "")
        'preset the pna
        vi.WriteString(":SYST:PRES;*OPC?", True)
        opc_comp = vi.ReadString()
        'Set TimeOut to 2 minutes
        vi.IO.Timeout = 1000 * 60 * 2
        'Get Handle to default measurement
        vi.WriteString(":CALC1:PAR:SEL 'CH1_S11_1'", True)
        'Recall saved .csa file
        vi.WriteString("MMEM:LOAD 'Test1.csa'")
        'set group trigger
        vi.WriteString(":SENS1:SWE:GRO:COUN 1", True)
        'execute group trigger
        vi.WriteString(":SENS1:SWE:MODE GRO; *OPC?", True)
        opc_comp = vi.ReadString()
        'get the number of points
        vi.WriteString(":SENS1:SWE:POIN?", True)
        points = vi.ReadNumber(Ivi.Visa.Interop.IEEEASCIIType.ASCIIType_R8, True)
        ReDim data(points)
        'set the return format
        vi.WriteString(":FORM:BORD NORM; :FORM:DATA REAL,32", True)
        'read data
        vi.WriteString(":CALC1:DATA? FDATA", True)
        ' Read binary block from PNA to an array of Single
        data = vi.ReadIEEEBlock(Ivi.Visa.Interop.IEEEBinaryType.BinaryType_R4, True, True)

        'parse data into DatagGridView
        Dim k As Integer = 0
        For Each d In data
            DataGridView1.Item(0, k).Value = d
            k += 1
    End Sub