LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

fpga detecting falling edges on two digital inputs

Hello LabVIEW-Fans,

 

I spent a lot of time for fixing my problem...

 

I want to detect falling edges on two digital inputs. The two inputs sample an identical signal. So the edge detection should

detect the both simultaneous edges at the same time -> in the same loop iteration. But many times the edges are detected

in two following loop iterations.

 

My goal is to bring the two occurred edges together. No matter if there are differences between 1 and 10 loop iterations. If they

occur in that time window they should be handled as common edges, if not as not common edges.

 

Import too is, that the timedifferences between two falling edges are calculated. These timediffs should belong together like

the common edges. They must be timeconsistent.

 

How can I realize that the edges in between the 1-10 loop iterations of the two channels are accepted as common edges?

 

Thank you for your help.

marco

 

0 Kudos
Message 1 of 5
(2,952 Views)

Hi M,

 

Thanks for the post and I hope your well.

 

So to clarify,

 

You have Two signals which could have a drift of X number of edges. But because these are related you only one to registor this event in software once, if two edges (one on each channel) happened within X edges?

 

For example,

 

Channel A has an Edge then 2 pulses later Channel B has an Edge = Software sees 1 edge?

Channel A has an edge then 12 pulses later Channel B has an edge = software sees 2 edges?

 

Sorry if I haven't understood.  

Kind Regards
James Hillman
Applications Engineer 2008 to 2009 National Instruments UK & Ireland
Loughborough University UK - 2006 to 2011
Remember Kudos those who help! 😉
0 Kudos
Message 2 of 5
(2,927 Views)

hi marco,

 

sounds like an application for timed loops. These provide you with more flexibility through the possibilty to configure each

single loop iteration and to react on what happened before.

By the way, the edge detection like in your picture won´t work anyway. The result will always be FALSE. Use "greater than" instead

 

 

Marco Brauner NIG

0 Kudos
Message 3 of 5
(2,895 Views)

Hello, thank you for your replies and a happy new year.

 

@Hillman: You understand my problem the exact way. 

 

@Marco Brauer: Yes, I noticed my mistake just after I made openend the topic but didnt know how to edit my message.

 

Mostly the edges are detected simultanously, but sometimes there is the phenomenon, that the two edges are detected in two following loop iterations.

Maybe they are detected simultanously, but the GetTicks for both channels will start asynchronously. Perhaps this will cause the phenomenon.

 

Do you have some experience with that?

 

marco

 

 

0 Kudos
Message 4 of 5
(2,810 Views)

@Marco Brauer: Oh, I was speaking about another mistake. The shift registers on the right must be connected to the TickCount.

But in contrast what you said, the edge detection works probably.

0 Kudos
Message 5 of 5
(2,808 Views)