The brand-new PN400 Phase Noise Test System is available for purchase! →

API saGetSweep value units

Forums › SA Series Discussions › API saGetSweep value units

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #227115
    matt_dale
    Participant

    Hello,

    I’m working with a SA44B using the API in Python. I’m able to utilize the API just as I would have anticipated.
    The issue I’m having is that the “min” and “max” arrays values don’t correspond to dBm as I would have suspected. The values do follow the level as expected, but not the values. An example is attached.

    Is there a function to convert these values to dBm?
    Perhaps it has to do with the way that I instantiate the two arrays? This is the code I’m using to create the min/max arrays before calling the saGetSweep method, where swlen is the length of the sweep

            pyarr = [x for x in range(swlen.value)]
            arr = (ct.c_int * len(pyarr))(*pyarr)
            arr2 = (ct.c_int * len(pyarr))(*pyarr)
            min_pointer = ct.pointer(arr)
            max_pointer = ct.pointer(arr2)
            res = self.sa.saGetSweep_32f(self.deviceHandle, min_pointer, max_pointer)
    Attachments:
    You must be logged in to view attached files.
    #227118
    RogerRoger
    Moderator

    Hi Matt,

    The min and max arrays populated by saGetSweep_32f are 32-bit floating point numbers, not ints. So, use ct.c_float instead of ct.c_int in your array initializations.

    Regards,
    Roger

    #227133
    matt_dale
    Participant

    Perfect!
    Thank you

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.