11-14-2008 02:35 PM
I am using the PCI-6154, M series card to detect changes on 8 digital inputs, record the state of the inputs, and use a counter to save the timestamp from the counter. Sometimes when two of the inputs change nearly at the same time I can getting two change detection readings and only one timestamp. Is there a way to slow the change detection sampling rate down? Or I might be doing something else wrong so please refer to attached VI.
Thanks
11-17-2008
02:37 PM
- last edited on
04-25-2024
03:47 PM
by
Content Cleaner
Hi kvan,
Thanks for posting on the NI Discussion Forums! Unfortunately, this type of issue is sometimes possible to encounter due to the fact that the Change Detection Event signal has a longer pulse width than the amount of time which may trigger the event (since it uses an 80 MHz clock signal). Thus, these event triggers which are used with the counter for timestamping may sometimes overlap. Unfortunately, at this time, there is not really anyway around this when using an M Series device (I assume you possibly mean that you are using a PCI-6254 as opposed to the 6154 S Series device).
One possible workaround would be to use a device which supports digital filtering on the DIO lines for change detection. By setting an appropriate filter, you could make sure that the change detection only takes place for the amount of time that the event pulse is high, so that you will not overlap the signals to the counter. You could then route the change detection event back to the device with the counter to timestamp the signals. One such device capable of filtering the digital inputs would be the NI 6509, and more information about the digital filtering used with the change detection can be found in the user manual. However, with this device, the maximum rate of change detection will be system dependent as it uses interrupts.
A similar post to this one may also be found here. Please let me know if you have any further questions/concerns regarding this issue. Hope this helps,
11-17-2008 03:15 PM
Yes I am using the PCI-6254.
OK, I am unable to get two timestamps when the time between change detection events is less the width of the signal but I don't need data that fast. At maximum I would need data at 1 MS/s and if signals changed multiple times in between that I don't care. Does this open up any other options and still use the change detection function.
11-17-2008
05:04 PM
- last edited on
04-25-2024
03:48 PM
by
Content Cleaner
Hi kvan,
Unfortunately, even if you don't need the data that fast, the change detection circuitry will always operate off of the 80 MHz timebase. Thus, if you have any type of glitch or somehow you get a change that occurs within 150 ns of a previous change, it will acquire this change without being able to timestamp it on the counter (due to the event trigger overlapping). Thus, the only way to force the change detection circuitry from acquiring that quickly is to filter the input signals on those DIO lines such that such a quick change does not get detected.
One possible method of implementing this type of "debounce" filter is to trigger a single counter pulse whose width is as long as the Change Detection Event. Thus, the pulse from the counter would be wired to the change detection and any input that occurs while this pulse is high would be ignored since the counter is already generating the pulse. The only problem with this method is that it would require an output counter for each signal to generate the pulse on, which means 8 separate counters just for filtering purposes in your case. (More information is available on this debounce method in the KnowledgeBase article 30KHKH6I.) Therefore, as I mentioned in my previous post, the only other potential workaround for this problem is to use another device which can filter the digital inputs or somehow implement external circuitry to filter your signal.