Terrabits / rohdeschwarz

Rohde & Schwarz python instrument control toolbox
https://vna.rs-us.net/python/
Other
37 stars 18 forks source link

Vna.py: VnaChannel::sweep_time_ms wrong for segmented sweeps #4

Closed Terrabits closed 7 years ago

Terrabits commented 8 years ago

In the current version of rohdeschwarz (0.5.5dev1), the sweep time is misreported for segmented sweeps.

This effects the VnaChannel::sweep_time_ms method, and by extension the Vna::sweep_time_ms command (which relies on the channel command).

The SCPI command currently used to query the sweep time for all channel types (linear, log, segmented etc) is: SENS<Ch>:SWE:TIME?

Unfortunately there is a separate command for querying segmented sweep time. Also, unfortunately, the command above is not "smart" enough to report the correct time for segmented sweeps (even though it is used for all other sweep types).

The correct command for segmented sweeps is: SENS<Ch>:SEGM:SWE:TIME:SUM?

In addition to this oversight, it also occurred to me that the VnaChannel::sweep_time_ms command does not take into account the sweep count (the number of sweeps that occur after a trigger, usually used to populate the averaging buffer with new measurements).

The fix is to update the sweep_time_ms method for the appropriate segmented sweep command as well as take into account sweep count.

Terrabits commented 8 years ago

Version 0.5.6dev1 should fix this issue:

I will run some additional testing and wait for others to provide feedback on this fix before I close it.