print sl.writeDAC(1,1.0) sl.tranTriggeredPlot(1.5,sl.tmodeFall) print print " [ ] Command P checked if you get a step in next curve" print sl.stepPlot(0.0,1.0) print print " [ ] Commands W and V checked if you get:" print " Two periods of a sine wave on ADC1" print sl.waveSine(1.0,2.0,100) sl.wavePlot(1,tinit=0.1) print print " [ ] Command X checked if you also get:" print " Two periods of a sine wave on ADC1" print sl.singleWavePlot() print print " [ ] Commands w and v checked if you get:" print " Two periods of a sine wave on ADC1" print " One period of a triangle wave on ADC2" print sl.waveTriangle(1.0,2.0,200,second=True)
fc = 72 Hz ''' # Locate slab in the parent folder import sys sys.path.append('..') sys.path.append('.') import slab # Set prefix to locate calibrations slab.setFilePrefix("../") # Open serial communication slab.connect() # Set storage requirements slab.setTransientStorage(100, 2) # Set wave slab.waveSine(1.0, 2.0, 100) # Set frequency slab.setWaveFrequency(72.3) # Measure slab.wavePlot(10) # Close serial communication slab.disconnect()
def squareResponse(v1=1, v2=2, freq=100): slab.waveSquare(v1, v2, 100) slab.setWaveFrequency(freq) slab.tranStore(500, 4) slab.wavePlot()
# Set prefix to locate calibrations slab.setFilePrefix("../") # Open serial communication slab.connect() # Set sample time to 100us slab.setSampleTime(0.0001) # Set storage requirements slab.setTransientStorage(200, 1) # (A) Creates and measures a square wave slab.waveSquare(1.0, 2.0, 100) slab.wavePlot() # (B) Creates and measures a triangle wave slab.waveTriangle(1.0, 2.0, 100) slab.wavePlot() # (C) Creates and measures a sawtooth wave slab.waveSawtooth(1.0, 2.0, 100) slab.wavePlot() # (D) Creates and measures a sine wave slab.waveSine(1.0, 2.0, 100) slab.wavePlot() # (E) Creates and measures a 10% duty pulse wave slab.wavePulse(1.0, 2.0, 100, 90)
def triangleResponse(vmin=1, vmax=2, freq=100): slab.waveTriangle(vmin, vmax, 100) slab.setWaveFrequency(freq) slab.tranStore(500, 4) slab.wavePlot()