LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How can i measure the time between two successive rising edges ,using digital input ..

Solved!
Go to solution

yes !! ,when i did the mechanical action thing ,it calculated the time 🙂 and I can't understand why 😄 hahah ...thanks chrissy 

Now instead of the bolean button ,im going to wire a digital input ,how does the mechanical action thing can be applied in case of the digital input ?

0 Kudos
Message 11 of 20
(2,785 Views)

I'm glad it worked! You should take the time to understand the mechanical actions of buttons - it'll pay off later.

 

In your main program you'll need to wire the boolean output of your detection subVI to your timing case structure, so that whenever a rising edge is detected the boolean goes true and the times can be compared.

 

If you post your subVIs as well as the main VI we can debug the whole program.

 

-CC

----------------------------------------------------------------------------------------------------------------------------
"If anyone needs me, I'll be in the Angry Dome!"


Message 12 of 20
(2,780 Views)

Hi, 

 

as you do not have a hardware counter in your system. 

 

So your time measurement is software based. the accuracy of your solution depends on several factors. 

Your FieldPoint System, Host PC and all the background tasks of windows that can effect your result. 

 

Maybe you can give us more details about your system. 

 

As an attachment you can find a possible way how to measure the time between two rising edges. (software timed only)

So the results may vary depending on your system. 

 

I described the different parts of the expample with labels. The for loop is used to generate a simulated digital siganl. 
How can try to replace that with our digtal Signal of the FieldPoint. 

 

The VI is saved in LabVIEW 2012. 

 

I hope i could help you with that infos.

 

Andreas K.

NI Germany

Message 13 of 20
(2,771 Views)

Thanks a lot Andreas ,can you please save it in Labview 2011 format so i can run it for test ? 🙂 

0 Kudos
Message 14 of 20
(2,754 Views)
Solution
Accepted by topic author shadymohamed

VI saved for LabVIEW 2011

 

Andreas K.

NI Germany

0 Kudos
Message 15 of 20
(2,744 Views)

Hello Guys 

 

When I removed the boolean control (In both Chrissy's and Andreas's VI's)  and wired the output of my FP READ Subvi ,the time was always zero ,I thought it was because of the mechanical action thing that the output of the FP Read did not behave like it did ..so I made some modification that I wanted to show to you coz it actually worked.

 

I used a subvi Name " Point By Point Boolean Crossing" and I wired it right after the output of my fp read in order to detect the rising edge and triggeer the True or False Case Structure ,...I'm glad it worked 😄 ,although I cannot fully understand why it did in the first place 😄 haha.

 

Anyway ,I thought I'd have to share it with you 🙂 

Program

 

Message 16 of 20
(2,726 Views)

hi, i have try your method to count. but i having that sometimes the time will be extra few second. do you know why?

0 Kudos
Message 17 of 20
(2,610 Views)

Hello Andreas,

 

i ve seen your code and i am trying to modify it so it measures the period of an analogue signal (typically sinusoidal).

basically i have an ni myrio that does not have a counter and i am trying to measure an analogue period. so i am trying to design a code that does the job.

i would appreciate if you could help because i am trying since a lot fo time but not managed to get it right.

 

Thanks in advance

 

Regards

 

Ali 

0 Kudos
Message 18 of 20
(2,565 Views)

Hi Ali,

 

on the myRIO you have to program it into the FPGA. 

 

You could possibly use the "Analog Period Measurement Express VI". 

That VI is listed in the Palett -> Programming -> FPGA Math & Analysis -> Analog Period Measurement.

 

Analog Period Help.JPGAnalog Period.JPG

 

Where do you come from?

 

Have FUN with your myRIO 😉

 

Greetings from Austria

Andreas K

0 Kudos
Message 19 of 20
(2,551 Views)

Hello Andreas,

 

Thanks for your reply, I appreciate.

 

I knew about the Analogue period maesurement for FPGA but i was trying to design the code from scratch just for interest. now i have managed it by improvsing your code a little bit and it is working fine. so thanks so much. I have also attached a code for reference. 

 

and regarding your question, I am lebanese and i live in the UK. 

 

Thanks for your help and you have a great time. 

 

Kind Regards

 

Ali

 

 

0 Kudos
Message 20 of 20
(2,548 Views)