matt_daleParticipantmatt_dale July 2, 2019 at 11:44 am
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.
RogerModeratorRoger July 2, 2019 at 1:19 pm
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.
matt_daleParticipantmatt_dale July 2, 2019 at 3:32 pm
You must be logged in to reply to this topic.