PyTektronixScope icon indicating copy to clipboard operation
PyTektronixScope copied to clipboard

Wrong time axis when DATa:STOP is higher than the selected record length

Open rbansemer opened this issue 4 months ago • 0 comments

The construction of the time axis in PyTektronixScope is implemented as self.x_0 + np.arange(self.data_start-1, self.data_stop)*self.delta_x. This approach is correct in principle - x0 is the result of WFMO:XZE? (time coordinate of the first point in the outgoing waveform), data_start and data_stop are determined as DATa:STARt? and DATa:STOP?, and delta_x is the result of WFMO:XIN?, the sampling interval.

When choosing a record length below the maximum record length supported by the scope, this however can lead to an incorrect time axis. The value returned by DATa:STOP? cannot be higher than the maximum record length, but it can be higher than the record length that is currently set. In such a case, when the value of DATa:STOP is between the record length set in the oscilloscope and maximum record length, the returned time axis has more data points than the voltage waveform.

I will suggest a fix.

rbansemer avatar Oct 07 '24 14:10 rbansemer