having my C++ code using the advanced trigger works wonderful since two years. Now I would like to extend it using the pulse width qualifier settings.
The attached picture describes what I expect to achieve:
- Picoscope PS6404D
- negative signal on channel A
- if signal stays under threshold y over time x -> fire!
In my imagination I should reach it quite easy with:
PS6000_PWQ_CONDITIONS pwqc{
PS6000_CONDITION_TRUE, // ChA
PS6000_CONDITION_DONT_CARE, // ChB
PS6000_CONDITION_DONT_CARE, // ChC
PS6000_CONDITION_DONT_CARE, // ChD
PS6000_CONDITION_DONT_CARE, // ext
PS6000_CONDITION_DONT_CARE, // aux
};
PS6000_PWQ_CONDITIONS pwqcv[1]{pwqc};
ps6000SetPulseWidthQualifier(
m_handle,
pwqcv,
1,
PS6000_FALLING_LOWER, // I am not sure about this one here. The manual could elaborate more on this
635, // timebase 2 -> 0.8ns
0,
PS6000_PW_TYPE_GREATER_THAN);
and advanced trigger settings with thresholdDir_A = PS6000_FALLING, thresholdMode = PS6000_LEVEL, thresholdUpper = -8000.
But unfortunately this seems not to be the answer. With those settings the trigger style seems random in the sense that every now and then it triggers perfectly as it should be (top case in the picture) and the rest of the time the auto trigger fires (set to 5s). The test signal is 1kHz.
Another misunderstanding arises when reading the on page 71 in the programmers guide the bullet point 'direction' and the possible direction options. Could one elaborate more on this?
Thanks a lot in advance for the answers. If I can get this running we probably buy up to four new 6404D oscilloscopes.
But unfortunately this seems not to be the answer. With those settings the trigger style seems random in the sense that every now and then it triggers perfectly as it should be (top case in the picture) and the rest of the time the auto trigger fires (set to 5s). The test signal is 1kHz.
Just to confirm that you have a repeating signal as per the top case being repeated at 1kHz, but you are only getting occasional true triggers ?
I believe you need to be considering a Windows Pulse Width approach, not level trigger, as used in the PicoScope 6 software. It may be worth setting it up in PicoScope 6 to see if this captures all events correctly.
I was partially successful. But I realized that I have to tell the whole truth about the task:
After the pico was triggered I would like to send out a signal with the waveform generator (wfg). This does work with one constraint, the signal (from wfg) is send AFTER the input signal is back to zero and not after the trigger conditions are fulfilled. I updated the drawing from the first post for clarification.
In an extreme case this would mean if my signal goes forever, the pico will never trigger.
Unfortunately the current setup with PicoScope 6 for a PulseWidthTrigger requires the end of the pulse to occur to be considered an active trigger.
I believe you probably need some combination of Pulse Width and Level Dropout so if you email support@picotech.com one of the team can see if they can code an example in C++ to do this.
Advanced triggering is a powerful tool but unfortunately very difficult to set up in code through the API.
Thanks for the answer. Unfortunately I am not even able to make it work in the official PicoScope6 software. I tried a lot of combinations. The window pulse width you mentioned above didn't do the job.