AnsweredAssumed Answered

In python (usbtmc) loosing 1 sample in DSO-X 2024A

Question asked by ishoro13 on Feb 23, 2017
Latest reply on Mar 2, 2017 by inf_persistence
I have problem with following function "scopeGrab", occasionally I receive 1 sample less than number of time samples (i.e voltage = 3839 and time = 3840).
The code I'm using:
 self.scope= usb.tmc('/dev/usbtmc0')
self.scope.write(":WAVEFORM:POINTS 5000")


    def scopeGrab(self):
        time.sleep(1);
            self.scope.write(":CHANnel1:OFFSet?")
            self.yoff = float(self.scope.read(20))
            self.scope.write(":WAVEFORM:FORMAT ASCII");
            self.scope.write(":VIEW CHANNEL1")
            self.scope.write(":DIGITIZE CHANNEL1")
            self.scope.write(":WAVEFORM:DATA?")
            self.tmp=self.scope.read(5)
            self.numstr=self.scope.read(5)
            self.stringData=self.scope.read(int(self.numstr))
            self.normdata = np.fromstring(self.stringData,sep=",")-self.yoff;
            self.scope.write(":RUN")
        return self.normdata
It happens when the number of bytes to be transmitted equals to  53745 instead of 53759.

I'm wondering what could be the reason for that and how to fix it?

I read in the Programmer's Guide page 639, it says the data can be clipped due to the "Hole". 

Outcomes