05-04-2012 06:11 AM
Hi All,
I'm looking for a good and stabile way to count current(4-20mA) pulses to a PXI-6238 card.
4 mA = 0
Appr. 16 mA = 1
I need to count the pulses in intervals on 1 sec to calculate the flow from a liquid flowmeter...
Could anyone point me in a direction here, and give me some help?:)
05-04-2012 08:42 AM
I would use a daq card with high speed counter that can easily do this for you. If you look into most of NI's daq cards you will see that many of them have a high speed counter. All you have to do is put a resistor across the input to gert it to voltage and you are off and running.
05-04-2012 09:04 AM
I was thinking about that.
But i dont have any experience with counters, do you have a base code that i can use to work with?
05-04-2012 12:05 PM
If you look at the examples that ship with LabVIEW you can look up high speed counters and there will be many different examples there.
05-05-2012 03:53 AM
The problem is that there is a jungel of examples there:p
Can you please spesify?
We have the PXI-6238 card, i dont think it is capable with hi speed counters.
05-05-2012 04:23 AM
The maximum frequency is 2000.
Compered to use the counter input, is it a bad ide to use the analog current inpu and use softwarecounter in Labview?
05-07-2012 04:37 AM
Anyone that have any input here?
05-07-2012 10:33 AM
You can post process the analog data by just running through the data and searching for transitions using a for loop. Just look for when the current goes above 16mA for a rising edge and going below 4mA for a falling edge. This kind of code can get tricky, so I would recommend using the counter capability of the PXI-6238. If you search in the example finder "Count Digital Events" you will find some examples.
05-07-2012 10:41 AM - edited 05-07-2012 10:45 AM
The counters in your card should fast enough for your flowmeter 😉
Lock for the buffered count edges examples.
The current input would need some minor conditioning: try a 1k Ohm resistor from the counter input (PFI 0..5) to Counter (P0.)GND (parallel to the input to split the current) together with the input impedance you should get a 0 to ~13V Signal . Best checked with a scope , the input voltage should be below 30V but >10V (higher resistor -> higher voltage) , You can add additional protection circuitry ( Z-diode (~22V) maybe one more resistor serial )
Maybe additional debouncing is useful (depending on how the pulse is generated)
05-08-2012 04:04 AM
Thanks for the responds guys:)
We have now tried to pulse a 5 V signal thru a OP-AMP generating 12,5 V input to the DAQmx card.
We used "Meas Dig Frequency-Low Freq 1 Ctr.vi" from Example finder... This meashured the same frequency that we gave:) So this is kind of a breakethru for us.
Afterwords we tried using a audio generator to check if that worked as well, and it did:)
The question is if this VI we are now usin is usable for measuring that we are looking for. Does it calculate the frequency from 1 secund, of the duration of a pulse?
I tried to find the VI example that you where talking about, without much sucsess... Maybe you have a link for it?