08-20-2021 02:19 PM - edited 08-20-2021 02:20 PM
Looking to for help to count the pulses in a while loop, any suggestions?
The signal seems reasonable, I just can't figure out the logic and would appreciate a push in the right direction.
08-20-2021 02:50 PM
You didn't mention the HW you're using to count pulses and did not share any code that you already have to provide any sort of help.
08-20-2021 03:04 PM
08-20-2021 04:10 PM
Hi Santhosh,
I’m using a Keyence FD-Q flow meter:
https://www.movetec.fi/images/pdf/AS_79677_FD-Q_C_600I65_GB_WW_1058-3.pdf
I have no code, all I’ve done is wired in the sensor to the DAQ. I’ve just plotted the signal for reference. I’ll take a snap shot on Monday - however all you’re seeing is a AI channel in a loop recording the test signals.
08-20-2021 04:17 PM - edited 08-20-2021 04:18 PM
Hi Altenbach,
I’ll try and answer remaining questions Monday - I appreciate your support.
08-24-2021 12:59 PM
I grabbed an edge counter, how can I increment the value each time the edge rises and falls?
The signal is just voltage where the flow meter throws +10V every time it detects 0.5L passing through the system.
08-24-2021 08:08 PM
@JCuneo wrote:
I grabbed an edge counter,.
I probably would not call that a real edge counter? In what dark corner did you find that?
08-25-2021 02:01 AM - edited 08-25-2021 02:03 AM
Hi JCuneo,
@JCuneo wrote:
I grabbed an edge counter, how can I increment the value each time the edge rises and falls?
Where did you "grab" that "edge counter?
Why not start with a more simple approach using functions provided by NI?
I count only rising edges in this snippet (that's how flowmeters work in my experience), but you can easily switch to count both edges using the BooleanCrossing function…
08-25-2021 08:27 AM
You mentioned that you hooked it up to a DAQ but didn't mention the model.
If the DAQ has a counter input you can directly use that feature, it accumulates the counts which is what you're trying to achieve.
Only concern I have is that the counter input are digital and typically 5V, since your flow meter is 10V you might need to put a resistor divider or an optocoupler to protect the DAQ inputs.