4227 advanced triggering on external input

Post any questions you may have about our current range of oscilloscopes
Post Reply
cpc333
Newbie
Posts: 0
Joined: Sat Aug 18, 2012 5:31 pm

4227 advanced triggering on external input

Post by cpc333 »

Is it possible to setup an advanced trigger using the external trigger input... like a pulse width trigger?

Thanks!

cpc333
Newbie
Posts: 0
Joined: Sat Aug 18, 2012 5:31 pm

Re: 4227 advanced triggering on external input

Post by cpc333 »

Actually, I've figured out how to do it with the Picoscope6 software and it works fine, but I can't seem to program a pulse width trigger using the EXT input.

I have a Picoscope4227. I've managed to program it using channel A as the trigger input... The programmer's guide also says that EXT input is ignored for the advanced triggering functions.

It just seems weird that it's possible in Picoscope6 but not when programming with the dll.

Any work around? Thanks!

Martyn
Site Admin
Site Admin
Posts: 4491
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: 4227 advanced triggering on external input

Post by Martyn »

Can you post some code showing exactly what trigger you are trying to set up, and also the psdata file for PicoScope 6 showing the set up you have.

We can then check this out for you as PicoScope 6 uses the same API, so what can be done with one can be done with the other.
Martyn
Technical Support Manager

cpc333
Newbie
Posts: 0
Joined: Sat Aug 18, 2012 5:31 pm

Re: 4227 advanced triggering on external input

Post by cpc333 »

Played with the code a bit... I think it's a problem there. I'm using Python 3.3. I think the issue is with passing the structure to the C function.

Here's some pieces of code that work (ie no error) when I set trigConditions.channelA=CONDITION_TRUE, but gives a 0x22 error (PICO_CONDITIONS. One or more of the conditions are incorrect) when I set trigConditions.channelB=CONDITION_TRUE... even though channel B is enabled. I'm using dll version 1.1.0.288

Code: Select all

#Trigger states
CONDITION_DONT_CARE = 0
CONDITION_TRUE = 1 
CONDITION_FALSE = 2
CONDITION_MAX = 3

class structTrigConditions(ctypes.Structure):
	_pack_ = 1
	_fields_ = [
		('channelA', ctypes.c_short),
		('channelB', ctypes.c_short),
		('channelC', ctypes.c_short),
		('channelD', ctypes.c_short),                      
		('external', ctypes.c_short),
		('aux', ctypes.c_short),
		('pulseWidthQualifier',ctypes.c_short)]

class PS4000(object):
	def setTrigger( self ):
		#Trigger conditions
		trigConditions = structTrigConditions()
		trigConditions.channelA = CONDITION_DONT_CARE
		trigConditions.channelB = CONDITION_TRUE
		trigConditions.channelC = CONDITION_DONT_CARE
		trigConditions.channelD = CONDITION_DONT_CARE
		trigConditions.external = CONDITION_DONT_CARE
		trigConditions.aux = CONDITION_DONT_CARE
		trigConditions.pulseWidthQualifier = CONDITION_DONT_CARE
		numTrigConditions = 1
		message = self.lib.ps4000SetTriggerChannelConditions(self.handle, ctypes.byref(trigConditions), numTrigConditions)

cpc333
Newbie
Posts: 0
Joined: Sat Aug 18, 2012 5:31 pm

Re: 4227 advanced triggering on external input

Post by cpc333 »

Figured out the problem... I should have been using c_int instead of c_short. I guess it was trying to read the wrong memory segment or something. Everything works as expected now! :D

Post Reply