diff --git a/picoscope/picobase.py b/picoscope/picobase.py index 2f47d92..0affd25 100644 --- a/picoscope/picobase.py +++ b/picoscope/picobase.py @@ -247,10 +247,14 @@ def setChannel(self, channel='A', coupling="AC", VRange=2.0, if not isinstance(BWLimited, int): BWLimited = self.BW_LIMITS[BWLimited] - if BWLimited == 2: - BWLimited = 2 # Bandwidth Limiter for PicoScope 6404 + if BWLimited == 3: + BWLimited = 3 # 1MHz Bandwidth Limiter for PicoScope 4444 + elif BWLimited == 2: + BWLimited = 2 # Bandwidth Limiter for PicoScope 6404, + # 100kHz Bandwidth Limiter for PicoScope 4444 elif BWLimited == 1: - BWLimited = 1 # Bandwidth Limiter for PicoScope 6402/6403 + BWLimited = 1 # Bandwidth Limiter for PicoScope 6402/6403, + # 20kHz Bandwidth Limiter for PicoScope 4444 else: BWLimited = 0 diff --git a/picoscope/ps4000a.py b/picoscope/ps4000a.py index e7bbcfc..2d55da9 100644 --- a/picoscope/ps4000a.py +++ b/picoscope/ps4000a.py @@ -145,9 +145,19 @@ def _lowLevelOpenUnit(self, sn): serialNullTermStr = None # Passing None is the same as passing NULL m = self.lib.ps4000aOpenUnit(byref(c_handle), serialNullTermStr) - self.checkResult(m) self.handle = c_handle.value + # This will check if the power supply is not connected + # and change the power supply accordingly + # Personally (me = Mark), I don't like this + # since the user should address this immediately, and we + # shouldn't let this go as a soft error + # but I think this should do for now + if m == 0x11A: + self.changePowerSource(m) + else: + self.checkResult(m) + self.model = self.getUnitInfo('VariantInfo') def _lowLevelOpenUnitAsync(self, sn): @@ -216,6 +226,11 @@ def _lowLevelSetChannel(self, chNum, enabled, coupling, VRange, VOffset, c_enum(VRange), c_float(VOffset)) self.checkResult(m) + m = self.lib.ps4000aSetBandwidthFilter(c_int16(self.handle), + c_enum(chNum), + c_enum(BWLimited)) + self.checkResult(m) + def _lowLevelStop(self): m = self.lib.ps4000aStop(c_int16(self.handle)) self.checkResult(m) @@ -406,6 +421,12 @@ def _lowLevelSetDeviceResolution(self, resolution): c_enum(resolution)) self.checkResult(m) + def _lowLevelChangePowerSource(self, powerstate): + m = self.lib.ps4000aChangePowerSource( + c_int16(self.handle), + c_enum(powerstate)) + self.checkResult(m) + def _lowLevelGetValuesBulk(self, numSamples, fromSegment, toSegment, downSampleRatio, downSampleMode, overflow): """Copy data from several memory segments at once."""