Unable to detect Pulse Width Trigger via API (detectable via PicoScope App)

Forum for discussing PicoScope (version 5)
Post Reply
prakashsatya1729
Newbie
Posts: 0
Joined: Fri Aug 04, 2023 4:43 pm

Unable to detect Pulse Width Trigger via API (detectable via PicoScope App)

Post by prakashsatya1729 »

I am trying to setup a pulse width trigger in a Python code environment. The pulse width trigger works find with the PicoScope Application as shown in attachment. But with the API the trigger is not working as expected. The code is below:

Code: Select all

lower = sample_count_for_2us
upper = sample_count_for_5us
ps5000aSetPulseWidthQualifierProperties(chandle, lower, upper, PS5000A_PW_TYPE_IN_RANGE)
conds = [PS5000A_CONDITION(PICO_CHANNEL_A, PS5000A_CONDITION_TRUE),
         PS5000A_CONDITION(PICO_CHANNEL_B, PS5000A_CONDITION_DONT_CARE),
         PS5000A_CONDITION(PICO_EXTERNAL, PS5000A_CONDITION_DONT_CARE)]
ps5000aSetPulseWidthQualifierConditions(chandle, (PS5000A_CONDITION*3)(*conds), 3, PS5000A_CLEAR)
direc = [PS5000A_DIRECTION(trigger_channel, PS5000A_FALLING, PS5000A_LEVEL)]
ps5000aSetPulseWidthQualifierDirections(chandle, (PS5000A_DIRECTION * 1)(*direc), 1)
Is there something wrong with the trigger setup in the code ?
Attachments
Screenshot 2023-08-04 at 9.54.49 AM.png

Post Reply