11-30-2022 04:57 AM
Hi,
How can I read the time difference between a rising edge in the CTR 0 B(PFI 1) channel and a falling edge in the CTR 0 B(PFI 0)? I am using a NI USB-6210 DAQ and the digital pulses come from a Keyence GT2-71D LVDT
Thanks
11-30-2022 08:15 AM
Sounds like a perfect use case for the counter measurement mode "Two Edge Separation Measurement". It's pretty flexible -- you can configure the terminal and polarity for both the first and second edges.
-Kevin P
11-30-2022 08:42 AM
Hi
It's the first time I am using digital inputs, that measurement mode might work, but: What do I use as minimum and maximum? and, as I have two channels, how do I set the edges I need to measure? Because I need the rise of the second channel, that rises after the first, and the falling of the first channel
Thanks
11-30-2022 04:46 PM
Min and Max help DAQmx select a timebase to use to measure the interval time. It will typically pick the fastest one (thus the finest time resolution) that lets it count up to the Max time without overflowing the (probably 32-bit) counter. For your M-series device, as long as Max is less than 50-some seconds, it'll use the fastest timebase - 80 MHz.
To implement: start with a shipping example for counter input shown below. Expand the property node that lets you identify the terminals for the first and second edges. Then select the properties that let you define which edge to be concerned with (rising or falling) for each.
-Kevin P
12-01-2022 03:12 AM
Hi,
I used that example as a base guide to build the VI that I attach. Can you tell me if if is doing the thing that appears on the image in the VI (Reading the rising of the second channel and the falling of the first)? Because there are numbers appearing but I don't know if they are correct.
Thanks
12-05-2022 08:03 AM
Sorry, I can't open the attached vi. Can you go to File->Save For Previous Version... back to LV 2018 or so?
-Kevin P
12-05-2022 08:25 AM
Hi
I think now is in LV 2018 or 2017
12-05-2022 12:16 PM
No, you need to expand the property node to define which edge (rising or falling) of the first signal *starts* the time measurement and which edge of the second signal ends it. Otherwise the task will use default values for both, probably both rising or both falling.
I took your code, then chose Edit->Clean Up Diagram to make it more legible. Then I added the things I mentioned above. I also changed your file writing express vi to *append* rather than overwrite every iteration. Give it another try.
-Kevin P
12-07-2022 03:43 AM
Hi,
I gave it another try and it's not working, but I think it is not a problem with the LabView code, I think it's the LVDT that it's not working correctly or that I don't know how it works.