LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Getting time in milliseconds between transitions

Grettings I have a problem. I want to measure the time that passes between the low to high transitions. I´m using a "boolean crossing point by point.VI" to choose the directions of the detection.The signal I´m receiving from the input is real time so I have to get the time of one detection than the time from the other detection but I can´t wait for the time of the second one in a loop. I would lose points :(.  Can someone help here.
I´m sending my vi in attach. Thanks in advance.
0 Kudos
Message 1 of 6
(3,210 Views)
My vi is in attach
0 Kudos
Message 2 of 6
(3,208 Views)
Hi Nuno,

when your data is already boolean you can use simple boolean operations to detect state transitions:
false -> true: NOT(sample(n-1)) AND sample(n)
true -> false: sample(n-1) AND NOT(sample(n))

You can use the 'Compound Arithmetic' function found in the boolean palette. To do the NOT-operation you can invert the appropriate inputs (and output too, if needed).

See the attached example!
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
0 Kudos
Message 3 of 6
(3,201 Views)
LOL hello GerdW. I would love to see the vi but my version is labview 8.0. Sorry I forgot to mension. Please attach a compatible vi. Thanks!
0 Kudos
Message 4 of 6
(3,199 Views)
Hi Nuno,

here you are!
Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 5 of 6
(3,196 Views)
Thank you =D. This is what I needed. Best regards! I´ve rated your answer.
0 Kudos
Message 6 of 6
(3,192 Views)