News:

  • August 14, 2026, 11:49:38 PM

Login with username, password and session length

Author Topic: Counter outputs  (Read 13293 times)

PLCwannabe

  • Hero Member
  • *****
  • Posts: 208
Counter outputs
« 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.

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3626
  • Darth Ladder
Re: Counter outputs
« Reply #1 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.
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

ATU

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 2126
  • YKPAIHA
    • ATU, Inc.
Re: Counter outputs
« Reply #2 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.

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3626
  • Darth Ladder
Re: Counter outputs
« Reply #3 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.
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

PLCwannabe

  • Hero Member
  • *****
  • Posts: 208
Re: Counter outputs
« Reply #4 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.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6170
  • Yes Pinky, Do-more will control the world!
Re: Counter outputs
« Reply #5 on: September 23, 2019, 11:38:02 PM »
At low frequency Timer with Interval scaling is a better choice than Counter with Rate scaling.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

PLCwannabe

  • Hero Member
  • *****
  • Posts: 208
Re: Counter outputs
« Reply #6 on: September 24, 2019, 12:30:11 PM »
Does the low frequency timer have a pulse output that can be scaled?

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3626
  • Darth Ladder
Re: Counter outputs
« Reply #7 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?
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6170
  • Yes Pinky, Do-more will control the world!
Re: Counter outputs
« Reply #8 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.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

BobO

  • Host Moderator
  • Hero Member
  • *****
  • Posts: 6170
  • Yes Pinky, Do-more will control the world!
Re: Counter outputs
« Reply #9 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.
"It has recently come to our attention that users spend 95% of their time using 5% of the available features. That might be relevant." -BobO

Controls Guy

  • Internal Dev
  • Hero Member
  • ****
  • Posts: 3626
  • Darth Ladder
Re: Counter outputs
« Reply #10 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.
I retract my earlier statement that half of all politicians are crooks.  Half of all politicians are NOT crooks.  There.