ETS Mode Error - PICO_

Post general discussions on using our drivers to write your own software here
Post Reply
kile
Newbie
Posts: 0
Joined: Fri Nov 10, 2023 10:13 pm

ETS Mode Error - PICO_

Post by kile »

Hi,

I'm using PicoSDK 10.7.25 with the python wrappers (picosdk) with a Pico 3406D and have been reading data successfully with ETS disabled. Now I am looking for better temporal resolution and would like to enable ETS mode. The documentation seems to say that is as simple as getting the max ETS values and then calling ps3000aSetEts().

When I do this, I get PICO_TRIGGER_ERROR when I go call the ps3000aRunBlock() function. I am setting up the trigger using the ps3000aSetSimpleTrigger() function.

A code snippet, which was working before I added ETS is below. I tried different numbers of samples/interleaving, but you'll see they're both set to 1 below.

Code: Select all

        # PICO_STATUS ps3000aSetEts
        # (
        # short handle,
        # PS3000A_ETS_MODE mode,
        # short etsCycles,
        # short etsInterleave,
        # long * sampleTimePicoseconds
        # )
        numSamples = 1
        numInterleave = 1
        self.effectiveSampleRatePs = ctypes.c_long()
        ets_mode = 2 #slow
        self.status["setEts"] = ps.ps3000aSetEts(self.chandle, ets_mode, numSamples, numInterleave, ctypes.byref(self.effectiveSampleRatePs) )
        print(f'ETS Status={self.status["setEts"]}. Effective sampling {self.effectiveSampleRatePs}.')
        assert_pico_ok(self.status["setEts"])

        # Sets up single trigger
        # Handle = self.chandle
        # Source = ps3000A_channel_B = 0
        # Enable = 0
        # Threshold = 1024 ADC counts
        # Direction = ps3000A_Falling = 3
        # Delay = 0
        # autoTrigger_ms = 1000
        autoTrigDelayMS = 10000
        TrigThresh = 0 # ADC level
        trigSource = 1 # Firing signal
        delay = 000
        self.status["trigger"] = ps.ps3000aSetSimpleTrigger(self.chandle, 1, trigSource, TrigThresh, 
                                                            ps.PS3000A_THRESHOLD_DIRECTION["PS3000A_FALLING"], delay, autoTrigDelayMS)
        assert_pico_ok(self.status["trigger"])
        
        
        # Gets timebase innfomation
        # WARNING: When using this example it may not be possible to access all Timebases as all channels are enabled by default when opening the scope.  
        # To access these Timebases, set any unused analogue channels to off.
        # Handle = self.chandle
        # Timebase = 2 = timebase
        # Nosample = maxsamples
        # TimeIntervalNanoseconds = ctypes.byref(timeIntervalns)
        # MaxSamples = ctypes.byref(returnedMaxSamples)
        # Segement index = 0
        timebase = TIMEBASE_TYPES["4ns"]
        timeIntervalns = ctypes.c_float()
        returnedMaxSamples = ctypes.c_int16()
        self.status["GetTimebase"] = ps.ps3000aGetTimebase2(self.chandle, timebase, self.maxsamples, ctypes.byref(timeIntervalns), 1, ctypes.byref(returnedMaxSamples), 0)
        assert_pico_ok(self.status["GetTimebase"])


Post Reply