How to use setPulseWidthQualifier?

Post your C and C++ discussions here
Post Reply
elzaphod
Newbie
Posts: 0
Joined: Tue Sep 15, 2015 11:17 am

How to use setPulseWidthQualifier?

Post by elzaphod »

Hi y'all,

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:

Code: Select all

tTriggerConditions tConds{
PS6000_TRIGGER_STATE   PS6000_CONDITION_TRUE,		// ChA
PS6000_TRIGGER_STATE   PS6000_CONDITION_DONT_CARE,	// ChB
PS6000_TRIGGER_STATE   PS6000_CONDITION_DONT_CARE,	// ChC
PS6000_TRIGGER_STATE   PS6000_CONDITION_DONT_CARE,	// ChD
PS6000_TRIGGER_STATE   PS6000_CONDITION_DONT_CARE,	// ext
PS6000_TRIGGER_STATE   PS6000_CONDITION_DONT_CARE,	// aux
PS6000_TRIGGER_STATE   PS6000_CONDITION_TRUE		// pwq
} 	
given to the ps6000SetTriggerChannelConditions method and

Code: Select all

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.

Cheers,
Hendrik
Attachments
pulseWidthTriggerIssue.png

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

Re: How to use setPulseWidthQualifier?

Post by Martyn »

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.
Attachments
WindowsPulseWidth.PNG
Martyn
Technical Support Manager

elzaphod
Newbie
Posts: 0
Joined: Tue Sep 15, 2015 11:17 am

Re: How to use setPulseWidthQualifier?

Post by elzaphod »

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 ?
Correct!

I'll try this in the Windows PicoScope 6 software and if successful hack it into my code. I'll let you know about the outcome. Thanks!

elzaphod
Newbie
Posts: 0
Joined: Tue Sep 15, 2015 11:17 am

Re: How to use setPulseWidthQualifier?

Post by elzaphod »

Hi,

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.

Is that somehow possible?


Cheers,
Hendrik
Attachments
pulseWidthTriggerIssue.png

elzaphod
Newbie
Posts: 0
Joined: Tue Sep 15, 2015 11:17 am

Re: How to use setPulseWidthQualifier?

Post by elzaphod »

Hi,

I just would like to push that question once more. Can any Picoscope do what I described above?

Cheers,
Hendrik

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

Re: How to use setPulseWidthQualifier?

Post by Martyn »

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.
Martyn
Technical Support Manager

elzaphod
Newbie
Posts: 0
Joined: Tue Sep 15, 2015 11:17 am

Re: How to use setPulseWidthQualifier?

Post by elzaphod »

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.

bennog
Advanced User
Advanced User
Posts: 206
Joined: Mon Nov 26, 2012 9:16 am
Location: Netherlands

Re: How to use setPulseWidthQualifier?

Post by bennog »

What is the resolution above the 508 ns you want it to fire.
I am thinking about streaming mode en generate trigger moment yourselves.

Benno

Post Reply