Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: PLCwannabe on September 23, 2019, 02:46:44 PM

Title: Counter outputs
Post by: PLCwannabe on September 23, 2019, 02:46:44 PM
 Hello,
   I'm looking at a project with 2 flowmeters  {pulse output} that I need to scale down the counts and send to 2 counter displays. The flowmeter pulses are about 400 hz max at 5 litres/second.  The regular counter display needs to see 10 Pulses per liter. Everything is 12vdc. Do i need a special counter for this or will a regular PLC work?I'm also looking for an example on how to convert the pulses to the slower rate and output them to the counter display.Thanks for any help.
Title: Re: Counter outputs
Post by: Controls Guy on September 23, 2019, 03:04:28 PM
The flowmeter is apparently 80 pulses/liter, so you want to divide by 8 (in addition to getting a fast enough input for your 500Hz)

1) Reset your pulse count after every eight pulses.  Leave your output pulse on from the reset to the leading edge of the fourth pulse, or:

2) If you can't readily reset after every eighth pulse, turn on your output when [Pulse count % 8] < 5.

Either way, this will be a max of 62.5Hz (500/8) or one state change every 8ms, so you can probably just do the count checking and output setting in ladder depending on the complexity of the rest of the program, if any, but you might conceivably need to do it as an interrupt.
Title: Re: Counter outputs
Post by: ATU on September 23, 2019, 03:29:49 PM
Couldn't you use the Rate option on the high speed inputs in BRX?
 Its not really high speed but it would be an easy way do all the calculations.
Title: Re: Counter outputs
Post by: Controls Guy on September 23, 2019, 05:49:04 PM
Yeah, I forgot to suggest he lose the pulse input panel meters if possible, since a small HMI should be the same cost or less, and if he has other things to do with the PLC, then his UI is free.  In that case, where he needs the rate in numerical form, I agree, RATE would be the way to go.

But, if he wants to use the panel meters, then I think the pulse dividing is more direct than figuring rate, then translating that back into pulses.
Title: Re: Counter outputs
Post by: PLCwannabe on September 23, 2019, 06:14:06 PM
This system is part of a diesel fuel tanker truck, so the displays are mounted in an explosion proof enviroment where i can't mount HMI,s. Basically I'm bypassing the complete computer/security/printer system that came with this unit, with a simple key switch and (hopefully) functioning display meters, for muliple users here on the farm.
Title: Re: Counter outputs
Post by: BobO on September 23, 2019, 11:38:02 PM
At low frequency Timer with Interval scaling is a better choice than Counter with Rate scaling.
Title: Re: Counter outputs
Post by: PLCwannabe on September 24, 2019, 12:30:11 PM
Does the low frequency timer have a pulse output that can be scaled?
Title: Re: Counter outputs
Post by: Controls Guy on September 24, 2019, 12:55:55 PM
At low frequency Timer with Interval scaling is a better choice than Counter with Rate scaling.

Yeah, but if it's pulse in, pulse out, isn't it easier to just flip the output every four input pulses, especially if the PLC doesn't care about the rate internally for other reasons?
Title: Re: Counter outputs
Post by: BobO on September 24, 2019, 02:24:12 PM
Yeah, but if it's pulse in, pulse out, isn't it easier to just flip the output every four input pulses, especially if the PLC doesn't care about the rate internally for other reasons?

Wasn't really solving the app, just responding to ATU's comment about using rate on a counter.
Title: Re: Counter outputs
Post by: BobO on September 24, 2019, 02:28:11 PM
I think the easiest way to solve this would be to use AXGEAR, following a counter input.
Title: Re: Counter outputs
Post by: Controls Guy on September 24, 2019, 03:23:21 PM
Wasn't really solving the app, just responding to ATU's comment about using rate on a counter.

OK, that makes sense.