From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.
We appreciate your patience as we improve our online experience.
01-26-2022 08:13 AM
Excuse me,
does anyone know how to find the duration? like this picture.
Please help me.
Thank you
01-26-2022 08:25 AM
Hi Danny,
@Danny29434 wrote:
does anyone know how to find the duration? like this picture.
You need two steps:
Subtract both times…
What have you tried?
(In the end it boils down to comparisons and search array functions.)
01-26-2022 10:09 AM
To make things simple, square each point and then take a square root, now, the signal is single-sided, now, you can do all sorts of comparisons to find the duration above a threshold.
01-26-2022 10:17 PM
Hi gerdW,
Thank you for the advice
I try this but it's not work
I don't have idea about finding the first time and last time (What function should I use?)
My English's not good and I don't understand some function ---> that's my problem
Thank you Very much.
01-27-2022 02:44 AM - edited 01-27-2022 02:47 AM
Hi Danny,
like this:
(There's a small bug: you need to search for TRUE both times.)
Hint: time duration is the number of sample (aka difference of indices) multiplied by dt (aka time interval between samples)…
Recommendation: cleaning up the block diagram helps to improve readability of your code!
01-29-2022 08:51 AM
Hi GerdW,
I tried following your advice. But it still doesn't work.
Maybe I misunderstood something. Can you help me check my code? (Thank you very much)
I tried this (picture 1) and the result (picture 2)
picture 1
picture 2
index of rising is correct but the index of falling is not
then I tried this (picture 3) and the result (picture 4)
picture 3
01-30-2022 09:28 AM - edited 01-30-2022 09:42 AM
Hint.
Threshold array x2, array size, reverse array and subtractx2 (or a compound math.) You don't need any of the silly comparisons.
You'll get there.
If you search my old posts for "Trim.vim" you might find an example that I believe even has a waveform datatype case.