Can anyone enlighten me as to what the direction parameter is doing with the pulse width qualifier? I can't anywhere in the docs see much about it beyond "the direction of the signal required for the trigger to fire".
I posit that it's the direction that resets the counter, but that's not written down anywhere. Can it be the same as the edge trigger used to actually trigger? Can it be different?
I recall from earlier work on a 3000a series device that the lower thresholds should be used for the PWQ, but I might be mis-recalling. Is this something I need to think about?
This is with a 4227 device, using ps4000SetPulseWidthQualifier.
You are correct, the direction for Pulse Width Qualifier (PWQ) is the direction that resets the counter. The pulse width qualifier is a counter which resets when it meets an edge in the direction that is specified and begins counting. When the trigger condition is met (if a trigger condition is specified), there is a process which qualifies whether it meets the overall conditions specified.
You should be able to use either an upper or lower threshold for the PWQ, but the direction enumeration cannot be the same for the trigger and PWQ e.g. if RISING is selected for the trigger, then for a reset on a rising edge for the PWQ, you should specify RISING_LOWER (or vice-versa).
You can certainly combine different directions e.g. for a positive pulse you would reset the PWQ on a rising edge, and trigger on a falling edge.
I will notify our Technical Publications team about updating the Programmer's Guide as required.