Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions picoscope/picobase.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
23 changes: 22 additions & 1 deletion picoscope/ps4000a.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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."""
Expand Down