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
Attachments:
screenie_fpga_TwoEdgeDetect.png ‏15 KB

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!

Similar Messages

  • 6602 Two Digital Input Counters Synching

    Hi,
    I'm trying to set up a system that counts the edges of digital pulses coming in. I have two inputs but both are related so I need to be able to properly reference the time both signals are coming in to properly analyse the data. I'm using a 6602 and using a sample clock to determine the time between each pulse in the data from one source and another sample clock to determine the time between pulses in the second source but if I try to relate the two sources the positions change each time I restart the program because the sample clocks are not triggered to begin at the same time. I've tried using the daqmx trigger off a digital edge but its telling me it is not applicable to the task.
    Aside from this the program works fine, the data appears as expected, just not properly referenced to each other. I just need it to always begin counting at the same time to properly reference one source to the other. I have seen many articles on multi device synching but can't find anything on counter synching between two counters in the one device.
    Any help would be greatly appreciated.

    Hi Tony,
    Have you seen the example at http://zone.ni.com/devzone/cda/epd/p/id/4836? It shows how to read from up to 8 counters using your board that are synchronised. This should do the trick for you, have a look and modify the program slightly to use only two counters.
    Two things that the example does that I think were causing you problems:
    The counters are configured to work from the same timebase that is provided externally (for example, you could use a spare counter to provide this timebase). This is important in synchronising the counters
    The counters are all configured to use a digital edge as a trigger. Have a look at how this is done in the example; I'm not sure how you're trying to implement your trigger but the example should help.
    I hope this helps you, good luck!
    Best regards,
    Tom
    Applications Engineering, NI UK

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

    Hello
    I'm trying to measure the time in seconds between each two successive rising edges on a digital input .
    Till now I have managed to detect the rising edge ,increment a counter with each rising edge ,and snap the time at which the rising edge happenned
    all I need now is to subtract the current rising edge time from the previous rising edge time in order to calculate (T) which can be 1/frequency and display it in realtime to the user.
    but I don't know how to do this
    Can somebody please help me !!!
    note: the time that I'm measuring ranges between 200 ms - 2 seconds
    Solved!
    Go to Solution.
    Attachments:
    Counter without time.vi ‏11 KB

    Cheers for that. It's always a good idea to post your SubVIs as well - the problem could be in one of those.
    To help you out:
    You already know how to use shift registers so why not use one again for time? Create a new shift register for  the time then simply compare the "rising edge time" to the the previous time stored in the shift register and then write the new time to the shift register.
    Just a few other pointers:
    1. You'll want to initialise your shift registers ie wire a constant to the left hand register outside of the loop. This will cause the register to be reset each time the program is run. This is so that your counter will start from zero each time you run your code.
    2. You don't need to use the "greater than?" compare function with boolean as they can only be true or false (1 or 0)! The "Equal?" function is what you should use here.
    3. Lastly, it's a small thing but you can use the same tunnel that feeds into a case structure in each of the cases - no need to create two tunnels for the true and false cases, use the same one.
    -CC
    "If anyone needs me, I'll be in the Angry Dome!"

  • How can I measure the time between each two successive rising edges ,using Digital Input ?

    Hello
    I'm trying two measure the time in seconds between each two successive rising edges on a digital input .
    Till now I have managed to detect the rising edge ,increment a counter with each rising edge ,and snap the time at which the rising edge happenned
    all I need now is to subtract the current rising edge time from the previous rising edge time in order to calculate (T) which can be 1/frequency and display it in realtime to the user.
    but I don't know how to do this
    Can somebody please help me !!!
    Solved!
    Go to Solution.
    Attachments:
    Counter without time.vi ‏11 KB

    Woah!  
    Sorry Apok, but your code is becoming way too complicated/messy. I don't think that all of those shift registers or boolean conversion/operators are needed at all.
    If you want to measure the timing between two button presses then this is a different (much less complicated) way. It simply records the timing of the button press into a shift register then compares the two.
    Spoiler (Highlight to read)
    Of course this is a very quick and basic solution just to show you that it can be much simpler than you are making it (remember to use the mechanical actions of the buttons to get the behaviour you want).
    A better way would be to use an event structure looking at value changes of the buttons to determine the timings between clicks.
    -CC
    "If anyone needs me, I'll be in the Angry Dome!"
    Attachments:
    Time between clicks.vi ‏9 KB

  • Comparing digital input and output from two different DAQs

    I want to create this program where the digital output lights up LEDs at random and push buttons are the digital input part of another DAQ are pushed. When the correct button is pushed, the score will increase by 1. My code doesn't work though. Can someone point my errors to me? Both the DAQs i'm using are USB-6008 DAQs. thanks
    Attachments:
    Untitled 1.vi ‏41 KB

    Let's start with the digital output
    What is this code all about?
    Do you want only one of the 8 led's to lit randomly or are multiple led's also ok?
    The two possible codes are in attached file SNAG-003.jpg
    Connect the output of the "Scale by power of 2" function or the "Multiply" output directly to the Write DAQmx vi
    I don't understand the purpose of the "Boolean Value" and "Replace subset array" thing, so I skipped it
    Attachments:
    SNAG-002.jpg ‏49 KB
    SNAG-003.jpg ‏22 KB

  • FPGA digital inputs

    I'm using an NI 7811R. This might be a stupid question, but do the digital inputs on the 7811R have a specific impedance or current limit? 
    When I plug my quadrature pulse signal into the 7811R (via connector block) I get a reduction in voltage. Additionally, the quadrature input pulses seem to show up slightly on different digital channels. For example, I can see a blip on channel A when channel B goes to a zero.
    I want to try to make changes on my circuit to accommodate a specific load (if possible) but the manual only seems to give info regarding current on the outputs.

    Hi Pewt,
    Generally speaking the input impedance can be assumed to be relatively high in relation to the TTL standard, i.e. very little current will be drawn or sunk. It is hard to define this precisely with TTL due to its variation under different conditions which is why I believe a value hasn't been provided on the datasheet.
    Could you provide any more details about your quadrature pulse source such as voltage and relative output impedance? Is it a TTL device?
    This is a digital device, so ghosting won't be the issue here regarding the apparent crosstalk. How large is the blip you are seeing?
    Paul
    http://www.paulharris.engineering

  • Sbrio 9612 digital input

    I have found a really nice example on how to measure frequency on a fpga digital input.  However, when I am trying to find the same method I can't find the wait for rising edge method.  Where can I find that or what am I missing? 
    Thanks,
    Eric.

    I just ran in to the same problem.  My code worked fine on a 7853R, but when I ported it over to sbRIO 9632, LabVIEW throws an error and doesn't recognize my wait on falling edge.  Basically after reading the forums and scanning the help, it appears that the method is not available for all targets... specifically the 9632 for me.  So I'm going to have to create my own logic for the rising edge. 
    See two screen shots attached of LV help for the 7853R and the 9612 and then a screenshot of a vi that worked on the 7853R, but is an unrecognized method on the sbRIO 9632.
    If anyone has an efficient way to wait on a particular edge, please post it.  Otherwise I will just use a while loop and wait for the updated value to be different than the previous and the correct level.
    Attachments:
    sbRIO9612 IO Methods.png ‏164 KB
    7853R IO Methods.png ‏206 KB
    functional method on 7853R-Nonfunc sbRIO.png ‏86 KB

  • Two digital triggers

    Hi!,
    I´m in need for a little help. My problem is that I´dont know is it possible to use two digital triggers simultaneusly in 6225-daq. I try to do two same tests at same time. PFI4 line should be as a trigger for a line ai20 and PFI5 should be as a trigger for a line ai52. PFI4 and PFI5 lines get rising edges almost simultaneosly but, you can´t be sure which one happens first.  
    Program should be able to tell if PFI4 and/or PFI5 lines get rising edge at all. If example PFI4 line gets rising edge and PFI5 line doesn´t,program needs to acquire data from ai20 when PFI4 rises. if PFI5 line doesn´t rise in 0,5 s program should not acquire data from ai52 and it should give for example boolean value or something so you can write to file that test to this other device failed.
    I can use digital triggers and all is just fine when I get rising edges to trigger lines but when not, program falls.
    Attachments:
    sama trig linja eri measure linjat 1_11_2005.vi ‏110 KB

    Hi Jetfire,
    do you know the difference between BMP and JPG?
    Size! (And that's the reason BMPs are banned in this forum.)
    Just renaming a file doesn't change the dataformat. Please attach real JPGs (or even better PNGs) next time!
    Jetfire created a related thread, now with a VI instead of a picture...
    Best regards,
    GerdW
    CLAD, using 2009SP1 + LV2011SP1 + LV2014SP1 on WinXP+Win7+cRIO
    Kudos are welcome

  • I have two discontinous input TTL

    signals, I want to measure the arrival time of each pulse at the two inputs. How do I trigger the two pulses using Labview on E-6062 card? How do I direct the two signals to two different triggers and output the time each time a pulse arrives at the input?

    signals, I want to measure the arrival time of each pulse at the two inputs. How do I trigger the two pulses using Labview on E-6062 card? How do I direct the two signals to two different triggers and output the time each time a pulse arrives at the input?Boualem,
    You will want to use a buffered counter operation to accomplish your goal. I am not clear if you want the time between each pulse that comes in (on a single pulse) or the absolute time of each edge, so I will explain both of these methods.
    If you want the absolute time of each edge, you will use Buffered Event Counting. You will connect your TTL signal to the gate of the counter. Each time a signal comes in on the gate, the counter will latch its current value into a buffer. When you read the buffer you will be able to see the time when the pulses came into the DAQ card. By knowing the timebase of the source (100k or 20M if using an internal source) you know the time of each pulse. Note the first number in the buffer is the number of counter between the armin
    g of the counter and the first gate edge, so you may want to ignore this value.
    If you need to know the time between each pulse, you should use Buffered Period Measurement. Connect your TTL signal to the counter Gate. Each time there is a pulse on the gate, the counter latches the current value and then resets the count, so that you get the number of counts between rising (or falling) edges.
    There are examples that ship with NI-DAQ (install support for LabVIEW) that show how to do both of these. See \examples\daq\counter\DAQ-STC.llb for the counter examples for E-Series boards. These examples are setup to work with one counters, you will need to duplicate the code to work with multiple counters. There is an example in NI�s Developers Zone that shows how to configure multiple counters on NI-TIO and DAQ-STC based boards. www.ni.com/zone -> then search on �multiple counters.� The first hit (Simultaneous Buffered-Event�) will be the one you want to look at.
    Nick Wil
    son
    Applications Engineering
    National Instruments
    www.ni.con/ask

  • How can i connect 24VDC to digital input (usb 6008)

    hello,
    how can i connect 24VDC to digital input (usb 6008), is it possible with some optocoupler?
    thanks

    The 6008 is a static DIO, so speed shouldn't be an issue.  Therefore an optocoupler should work.  Just make sure you get one the meets your specs.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • How to I connect Sourcing digital output from My Interface Board to NI USB 6501 channel configured as Digital input

    When I connect an input to DI channel of USB 6501 card  from my board which has sourcing Output t, iIn the Off state it is not pulled down properly. The volatge on the port in is 2.1V -2.5V based on the pull down resistor on my board. I suspect that  it acts as a voltage divider.
    The state on the card is still show as "HIGH "state, even my sourcing output driver has a pull down  resister.  when I use this interface board for PCI mseries devices it works fine. Do the pull down resister on my sourcing output is not worth. Is this because of pull up resister 4.7k inside USB card 6501.
    USB 6501 specifications shows the Digital input accepts both source and sink modes. By default the card is in sourcing digital input mode. How do we can convert this in Sinkind digital input mode.
    Could anyone Please give your suggestions to overcome this issue .
    Thanks you.

    You really should not have both a pull up and pull down on the same line.  Really weird things can happen.  If you insist on having a pull down on your board, then I highly recommend putting a digital buffer chip between the DAQ and your board.
    Some boards with DIO have a pull up, while others have pull down.  You just have to watch the specs.
    There are only two ways to tell somebody thanks: Kudos and Marked Solutions
    Unofficial Forum Rules and Guidelines

  • Triggering an event with a digital input

    Hello all,
    I'm writing my first Labview program.  I used an architecture I found on the forums here, and it has been very helpful in getting me started.  This architecture uses two while loops, one containing an event structure and one containing a case structure.  (This is a queued state machine architecture, I believe).
    Part way through the programming, we decided we needed a sensor to make sure the part was in the test fixture during the test.  If the part is removed during the test, we'd like to safely stop the test.  So basically, I need to monitor a digital input (on an NI-USB-6525 module) and enter the "Stop" case if the digital input turns off.  I would also like to make sure this digital input is on before entering the "Start" case.  I don't care if the input changes state when the test is not running, nor do I care about its state during the "Exit" case.
    I'm really not sure how to add this functionality to my "stop" case.  I don't even know if it's possible.  I've been researching DAQmx events, but I haven't found an example or answer that aligns with my particular problem. 
    I've attached my code.  It's incomplete right now - I still have a large number of steps to add.  I wanted to get this issue figured out before I programmed any more steps.  A preview of the code showing the basic architecture is shown in the picture below.
    Does anyone have any ideas or suggestions for me, or questions if my problem is unclear?  Also, if you see anything else in my code that will be problematic, please let me know.
    Thanks in advance!
    Attachments:
    Main_Loop_072412.vi ‏195 KB

    I should also add that I looked into event dynamic registration, but it seemed incompatible with my issue.  I don't want my top loop to run only when an event triggers it - I want it to run all the time so that it can immediately respond to button presses. Also, most of the triggering I found was based on value change.  I care about the actual value, not just that it changed.
    I don't want to do anything that will bog the code down too much since it is important that the system respond immediately to inputs, especially to the stop or exit button presses.
    I'm sure I am missing something very basic here.  I'm used to ladder logic, where everything is simple and straightforward. 

  • Digital Input Cannot Display this Video Mode Optimum Resolution 1280 x 1024 60hz.

    HP Pavilion h8-1360t, Windows7 home premium 64-bit,  AMD Radeon HD 7570 graphics card.
    error message: Digital Input Cannot Display this Video Mode Optimum Resolution 1280 x 1024 60hz. 
    I get the error message as soon as Windows opens and the desktop displays.  Then it goes black with that message.  I've been using the computer for awhile and I had it so that when I maximized a window it would go across both screens.  I have two monitors on the graphics card.  Somehow I changed the settings so that a program would maximize to one monitor or the other.   That is how I want it to work.  Maybe I activated HydraVision.  Now I have the problem when I start.
    Also now when I boot to Safe Mode I get the message that there is no AMD graphics driver installed, or it is not functioning properly.  I have tried to update it and the computer tells me I have the most recent version installed.   I would like to uninstall it and reinstall it, but I'm a little worried I won't get it installed and be without video.  Something like that happened to me once before years ago.
    Could someone tell me what I should do please?
    Thanks,
    Jim Allen

    HP support is here:
    http://www8.hp.com/us/en/contact-hp/contact.html
    In safe mode you should uninstall the driver, then try to boot normal again.
    Then check if driver was installed by win7.
    If not go go AMD website and download latest driver for your card.
    V.
    *** Say 'Thanks' with Kudos ***

  • Simultaneous Digital Input and Output from NI 9403

    Hi,
    I was wondering if it is possible to digital output through one line in this module(NI 9403) while simultaneously reading from 10 other lines?
    Basically what I need is for line0 to always be closed(true), and read lines1:10 - at very least 1sample/second.
    I have attached a stripped down version of my code illustrating my error. I thought I was getting the error because the two tasks were using different clock configurations, but I tried using the same inputs and that doesn't work for me.
    Any input is greatly appreciated.
    Thank you
    Attachments:
    Digital I-O.vi ‏22 KB

    Hi Matthew,
    The behavior you're seeing is expected for the 9403 module, since it is a serial module. The DAQmx help has the following restrictions in the Digital I/O Considerations for C Series Devices section.
    Timed digital input/output restrictions:
    You cannot use parallel and serial modules together on the same hardware timed task. 
    You cannot use serial modules for triggering. 
    You cannot do both static and timed tasks at the same time on a single serial module. 
    You can only do hardware timing in one direction at a time on a serial bidirectional module.
    So you can only do timed input or output at one time, but not both. However, based on the VI you attached and the description of what you want to do, you don't necessarily need both timed tasks in your loop. You can create a static output task to update that one line and after that, you can just start your timed input task on the rest of the lines. This should maintain the state on the DO line, since you're not acquiring from it.
    Cheers,
    Cristina
    Cristina

  • Producer consumer with analog and digital inputs and outputs

    Hi everyone,
    I am working on a control system program for some practical test work. Currently I am working on the data acuisition component of the Labview program. My architecture is produced-consumer loops with a que. My system will have analog inputs, analog outputs, digital inputs and digital outputs. It's not a time critical sytem, but I would like all of the data acquisition to be synchronised. I have attached my program as it is at the moment. I am having trouble getting all of the data into the que since I have two data types. Also, I'm not sure if i've synchronised the four read/write sequences correctly. I would greatly appreciate if somebody could take a look at my program and give me some advice. Thanks in advance.
    Solved!
    Go to Solution.
    Attachments:
    control_v2_DAQ loop.vi ‏46 KB

    Robert, the specific error that I get is:
    Error -200462 occurred at DAQmx Start Task.vi:6
    Possible reason(s):
    Generation cannot be started because the output buffer is empty. 
    Write data before starting a buffered generation. The following actions can empty the buffer: changing the size of the buffer, unreserving a task, setting the Regeneration Mode property, changing the Sample Mode, or configuring retriggering.
    Task Name: Heater testing lab digital outputs
    This error occurs at the 'DAQmx write.vi' function. I just want to sent one sample per second, for each channel. I would like the producer and consumer loops to each run once every second.
    I have attached part of my code with just the data acquisition and writing. Any help would be greatly appreciated.
    Attachments:
    control_v2_ML_simple.vi ‏83 KB

Maybe you are looking for