Forums › SA Series Discussions › API saGetSweep value units
- This topic has 2 replies, 2 voices, and was last updated 7 years, 3 months ago by
matt_dale.
- AuthorPosts
- July 2, 2019 at 11:44 am #227115
matt_dale
ParticipantHello,
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 sweeppyarr = [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.July 2, 2019 at 1:19 pm #227118
RogerModeratorHi 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,
RogerJuly 2, 2019 at 3:32 pm #227133matt_dale
ParticipantPerfect!
Thank you - AuthorPosts
- You must be logged in to reply to this topic.
