set up a pulse width trigger

Post discussions on applications you are writing
Post Reply
Posts: 0
Joined: Fri Mar 10, 2023 1:06 pm

set up a pulse width trigger

Post by francisco.dutra »

I am writing a python code that will record data that will go to channel A. The signal in A is either high or low (0 or 1).
I just want the data when the signal is high so I think pulse width trigger with rapid block mode will do the job, because I do not know the time that is going to be high and I need to capture multiple signals. I am not sure about this so I am open to other suggestions. The high state of the signal in A will have a duration no more than 5s and it will repeat for 5-10 times.

Here is the trigger code

Code: Select all

triggerConditions = ps.PS5000A_CONDITION(ps.PS5000A_CHANNEL["PS5000A_CHANNEL_A"],

clear = 1
add = 2
self._status["setTriggerChannelConditions"] = ps.ps5000aSetPulseWidthQualifierConditions(self._chandle, ctypes.byref(triggerConditions), 1, (clear + add))

triggerDirections = ps.PS5000A_DIRECTION(ps.PS5000A_CHANNEL["PS5000A_CHANNEL_A"], 

self._status["setTriggerChannelDirections"] = ps.ps5000aSetPulseWidthQualifierDirections(self._chandle, ctypes.byref(triggerDirections), 1)

upper = 2000
lower = 2000
self._status["setPulseWidthQualifierProperties"] = ps.ps5000aSetPulseWidthQualifierProperties(self._chandle, lower, upper, ps.PS5000A_PULSE_WIDTH_TYPE["PSXXXX_PW_TYPE_GREATER_THAN"])

I have an error in ps.PS5000A_PULSE_WIDTH_TYPE["PSXXXX_PW_TYPE_GREATER_THAN"] and I try multiple things but it did not work.

Post Reply