Multifunction DAQ

cancel
Showing results for 
Search instead for 
Did you mean: 

QMH: create user Event in Consumer Loop

Solved!
Go to solution

A couple notes for you:

 

1. There's no need (and some danger!) unpacking those time stamps into "date-time records" before doing all your math to figure out delta time.  All you need to do is subtract one timestamp from another!  The result will be delta time in seconds, including sub-millisec resolution.

   The "danger" is that your method will fail when time wraps around midnight to a new day.  That may or may not affect you, depending on when this equipment can be running.

 

2. Another concern with your debounce method is that you're setting yourself to react to the *beginning* of bounce.  If every bounce always ends up with a stable transition to a different state, you'll be ok.  But if the bounce might end by reverting back to the original state, then you'll have reacted to a false transition.

   Looking back to the beginning of the thread, I see you're using an X-series device that will support debounce in the hardware via "digital filtering".  That method will only pass through stable states after all the bounce is done, so the issue raised above wouldn't affect it.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
Message 21 of 23
(394 Views)

Hi Kevin,

 

thanks for the hint with the subtraction of timestamps; didn't now that and this really helps!!

 

regarding the debouncing:

can I set the debouncing on an element which I'm watching for events?

 

like this:

WWolf78_0-1623301048350.png

 

(thought this does not work so this require hardware debouncing or "selfmade" software debouncing)

0 Kudos
Message 22 of 23
(374 Views)

I'm not 100% sure I've done that, but I strongly suspect it should work fine.  The digital filter operation would have to be upstream of the change detection circuitry for it to make any sense.

 

Dig around in the DAQmx Channel property node and you should find what you need to set up a digital filter on the line(s) of interest.

 

 

-Kevin P

CAUTION! New LabVIEW adopters -- it's too late for me, but you *can* save yourself. The new subscription policy for LabVIEW puts NI's hand in your wallet for the rest of your working life. Are you sure you're *that* dedicated to LabVIEW? (Summary of my reasons in this post, part of a voluminous thread of mostly complaints starting here).
0 Kudos
Message 23 of 23
(369 Views)