Trying to Measure Pulse Width and Send a Trigger if Pulse Width is Out of Range

Post your LabVIEW discussions here
Post Reply
LearningLabVIEW1
Newbie
Posts: 0
Joined: Wed Feb 08, 2023 3:24 pm

Trying to Measure Pulse Width and Send a Trigger if Pulse Width is Out of Range

Post by LearningLabVIEW1 »

Hello,

I am using a PicoScope 5244B, LabVIEW 2020 64 bit. I am trying to have the PicoScope measure the pulse width of an inputted pulse signal, determine if it is out of range, and shut down power to system if it is.

The pulse width I am measuring should be around 4ms. So I would want to check if it is between 3.9ms and 4.1ms.

Does the PicoScope 5244B do this? I was trying to use the "PicoScope5000aExampleAdvancedTriggerV2.vi" But I do not see a trigger happening (maybe I am missing something?). I am trying to test with this VI but using a signal generator connected to channel A of the PicoScope. My settings for a test signal from the signal generator were: 100Hz Frequency, 1 Vpp Amplitude, Pulse Width 4ms.

AndrewA
PICO STAFF
PICO STAFF
Posts: 400
Joined: Tue Oct 21, 2014 3:07 pm

Re: Trying to Measure Pulse Width and Send a Trigger if Pulse Width is Out of Range

Post by AndrewA »

Do you have a screenshot of the examples front panel controls?
Regards Andrew
Technical Specialist

LearningLabVIEW1
Newbie
Posts: 0
Joined: Wed Feb 08, 2023 3:24 pm

Re: Trying to Measure Pulse Width and Send a Trigger if Pulse Width is Out of Range

Post by LearningLabVIEW1 »

I have added screenshots of what i did for now.

I am able to accurately measure a pulse width with this, but once the pulse changes too far out of the acquisition settings, it is no longer a viable option and the calculated value is no longer accurate.

I have been messing around with it and the accuracy of the pulse width calculation comes down to the acquisition settings. So in order to use this I would have to know exactly what I was expecting to see in terms of the signal I am trying to measure.
Attachments
front panel.PNG
block diagram.PNG

AndrewA
PICO STAFF
PICO STAFF
Posts: 400
Joined: Tue Oct 21, 2014 3:07 pm

Re: Trying to Measure Pulse Width and Send a Trigger if Pulse Width is Out of Range

Post by AndrewA »

Yes you can do this with the Pulse Width Qualifier using the advance trigger functions.
Here is the Advance trigger example for the ps5000a setup to trigger on a positive pulse between 3.9-4.1ms
Note the Pulse Width Qualifier triggers at the end of the pulse not the start.
Also I have AND this a falling edge trigger.
I have highlighted the controls that you need to change from the default ones.
The "Lower Limit" is in scope samples (3.9ms / 784ns)
The "Upper Limit" is the same (4.1ms / 784ns)
4ms positive pulse PWQ 3_9-4_1ms controls.png
Here the setup but for a negative pulse, note the ChA trigger is set to Rising, and the "Pulse Width Direction" control set to "Falling"
4ms negative pulse PWQ 3_9-4_1ms.png
Regards Andrew
Technical Specialist

LearningLabVIEW1
Newbie
Posts: 0
Joined: Wed Feb 08, 2023 3:24 pm

Re: Trying to Measure Pulse Width and Send a Trigger if Pulse Width is Out of Range

Post by LearningLabVIEW1 »

Thank you for this example. When it triggers, is there a flag raised, boolean changed, etc. to know that a pulse out of range has been detected?

Post Reply