LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Counting current pulses 4-20 mA

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?:)

0 Kudos
Message 1 of 13
(3,574 Views)

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.

Tim
GHSP
0 Kudos
Message 2 of 13
(3,561 Views)

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?

0 Kudos
Message 3 of 13
(3,556 Views)

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.

Tim
GHSP
0 Kudos
Message 4 of 13
(3,549 Views)

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.

 

0 Kudos
Message 5 of 13
(3,533 Views)

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?

 

0 Kudos
Message 6 of 13
(3,532 Views)

Anyone that have any input here?

0 Kudos
Message 7 of 13
(3,515 Views)

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.


GCentral
There are only two ways to tell somebody thanks: Kudos and Marked Solutions
Unofficial Forum Rules and Guidelines
"Not that we are sufficient in ourselves to claim anything as coming from us, but our sufficiency is from God" - 2 Corinthians 3:5
0 Kudos
Message 8 of 13
(3,497 Views)

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)

 

 

 

Greetings from Germany
Henrik

LV since v3.1

“ground” is a convenient fantasy

'˙˙˙˙uıɐƃɐ lɐıp puɐ °06 ǝuoɥd ɹnoʎ uɹnʇ ǝsɐǝld 'ʎɹɐuıƃɐɯı sı pǝlɐıp ǝʌɐɥ noʎ ɹǝqɯnu ǝɥʇ'


0 Kudos
Message 9 of 13
(3,496 Views)

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?

0 Kudos
Message 10 of 13
(3,483 Views)