import mylabjack import sys import datetime import time class spectrum(): def __init__(self): self.handle=mylabjack.openLabJack() print("Starting stream trigger test v1.04") mylabjack.config_DIO_EF(self.handle) self.changeTemp(25) def __del__(self): #self.wait() mylabjack.closeLabJack(self.handle) def run(self): return mylabjack.acquireSpectrum(self.handle) #self.acquisitionDone.emit(ain) def changeTemp(self, newTemp): mylabjack.updateVoltage(self.handle,mylabjack.tempToVoltage(newTemp),0) ## Start Qt event loop unless running in interactive mode or using pyside. if __name__ == '__main__': spec = spectrum() numTests = 100 negEdges = 0 posEdges = 0 for i in range(numTests): print("Test %s: %s / %s" % (i, posEdges, negEdges)) StartEdge = spec.run() if StartEdge == 1 : posEdges += 1 else : negEdges += 1 print("%s tests ran" % numTests) print("Positive edges: %s" % posEdges) print("Negative edges: %s" % negEdges) #print("trigger edge: %s" % StartEdge)