Flow Meter Pulse Counting
Posted 13 August 2012 - 02:29 PM
I am a beginner with labjack and DaqFactory express.
I have a flow meter which produces a pulse output, which can be related to the total flow volume by a constant. I would like to use DaqFactory express with a U6 labjack to count and record the number of pulse over a set time period in order to determine the flow rate, although I haven't a clue where to begin
You input would be greatly welcome
Posted 14 August 2012 - 11:11 AM
You described counting. Start by using the test panel in LJControlPanel to see if you can get the counter working there:
After you have it working in the test panel, then move on to DAQFactory:
Posted 14 August 2012 - 11:48 AM
For me I don't see counts very much, though I can get as high as 1 count per minute.
To avoid using a timer/counter channel I just connected my gas meter into an AIO port. My pulse is actually a switch that closes on the count. I have it set to increment when it sees the falling edge.
my code is really basic, enhanced by the help here:
if (DGM - DGM > 1 && DGM > 4 DGM_Count++ endif
Normally my DGM voltage reading is -2.4 (labjack default). When the switch is closed it connects the AIO to the Vs source so I read ~5v. Once this drops off it returns to -2.4, though sometimes the reading catches it funny and will read like 2-3v before going back to steady state. This is why I just have the change in voltage to be 1v instead of something like 5.
Since I have it looking for a previous state of greater than 4, the only chance of not catching the edge is if it dropped from 5 to 4.0+ then dropped again to 3ish, never satisfying the 1v change. Though in my experiments this hasn't really occured. I had to add the additional safeguard instead of just having a voltage change only because noise in the system can generate >1v at times.
Posted 14 August 2012 - 11:54 AM
Also, note that you need to keep your readings somewhat slow, and your switch states long, otherwise you will need to introduce some sort of debounce, either in hardware or software. Technically, reading slowly with long switch states basically does debounce since the bounce is very rapid.
Posted 16 August 2012 - 09:04 AM
Posted 03 September 2012 - 06:22 AM
Thanks for your replies, I have it working in the test panel, just need a little help with the DAQFactory.
Posted 04 September 2012 - 10:38 AM