How to count pulse from water flow or energy meter ?

tparvais

Member
Hello

I wonder how the web control can be used to count pulse going out energy meter ( 1 pulse per w/h) or water flow meter (1 pulse per liter )

I,Owen an 'old'' PLC without pulse function. Is that possible on multiple RTL inputs ? I have many pulse counters needed

How is it possible with the new firm aware ?

And finally, why can t I not,upgrade the firmware myself !

Leaving in Belgium will cause a lot of expensive post cost if I have to send to board back

Thank you

Thomas
 
How long are the pulses, and what is your typical power consumption? At 1kW load, thats a pulse about every 3 seconds.
A simple pulse-stretcher may be enough for you to reliably count and accumulate pulses in software.

I agree updating firmware on-site would be highly beneficial, but CAI are more than "reluctant" to provide assistance for it.
 
Hello

I wonder how the web control can be used to count pulse going out energy meter ( 1 pulse per w/h) or water flow meter (1 pulse per liter )

I,Owen an 'old'' PLC without pulse function. Is that possible on multiple RTL inputs ? I have many pulse counters needed

How is it possible with the new firm aware ?

And finally, why can t I not,upgrade the firmware myself !

Leaving in Belgium will cause a lot of expensive post cost if I have to send to board back

Thank you

Thomas

As slow as those pulses would be, you should be able to count them just using PLC code. No need for a special pulse counting firmware/hardware implementation.

You need to use 2 variable per counter. One variable counts the pulses, the second variable locks out the count adding subroutine until it reverts to off (thus preventing counting the same pulse multiple times). You must write your plc code so as to not ever got locked up in any loops or it will miss counts.

I believe this should work: (haven't tested it and haven't written plc code in 6 months so I might be rusty.


Start
Testeq IP1 1
Callsub water
Testeq ip1 0
Set ram1 0
end

Water:
Testeq ram1 0
Inc var1
Set ram1 1
ret
 
If you configure the IP1 as pulse counter,  it can count as fast as 2MHz pulses, Or frequency counter will be able to measure frequency as fast as 2MHz.
 
However frequency counter sample time is less than a second, so that if pulses are very slow, you will need to use pulse counter feature on IP1, then do your math in PLC by over a longer period of time.
 
There is no special firmware needed. this feature is in for a long time.  If you board does not have that feature, your board does not have bootloader, either.  All boards shipped recently have bootloader allowing user to update firmware yourself.  If your board does not have bootloader, then the only way to get that is to send board to us, we will then update the board with bootloader, from then on, you can update firmware on your own.
 
Thanks, is IP1 the only input that has this capability?  What would be the maximum pulse counter rate if you use the other inputs?
 
IP1 is the only one has this capacity.  It is hardware counter, so never lose a beat from that. Others input can not count that reliable.
Please note its counting is for a pulse going up, then going down.  If just go down, or just go up, it does not count pulse half way.
 
OK, so for the other inputs what is their typical scan rate?  Or, in other words how often does the input status get updated?
 
Agree with other poster that pulses could be counted by scanning parallel bit inputs.
 
Assuming from the Kp this is a self-contained rated electrical metering device.
With 220V x 60A x 90% pf = 11,880W
 
at kp = 1.0 pulse rate would be 11,800W = 11,800kWh/h. In one second = 3.3 pulses / sec maximum.
 
The PLC code programming should be able to count a few of them and stuff the results online elswhere easily, escpecially if you just use cumulative quantities and lave the time integration to  master computer or control board. 
 
Be careful of pulse definitions. Some define a pulse as every transition, positive and negative. You would have to double your Kp/Ke/Ki value. Some 3W pulse inputs take two out-of-phase (alternating) inputs to register a valid count.
 
For ease of installation use a WebControl board for each pulse input and stuff them (via Ethernet) into another board like ISY994i etc. Something with more memory will be required for logging data.
    or
Use one WebControl to count inputs and a second WebControl to integrate in time to create rate logic and external device control if one doesn't have enough CPU power.
 
All this dependent on how much challenge you like.  Personally I love it but it will take some time.
 
Other input is scanned every 50ms or less time interval.  For example, each time PLC instruction checking for the input state, it will go out read it.
But if pulse is shorter than 50ms, it is not guaranteed to detect that state change.  Especially if there is a critical operation of other devices or network, the interrupted may be blocked.
 
However, you can expand that to use I2C counter from LS7366R or other I2C counters.  Or those Maxim clock/counter chip.
 
Other input is scanned every 50ms or less time interval. For example, each time PLC instruction checking for the input state, it will go out read it.

But if pulse is shorter than 50ms, it is not guaranteed to detect that state change. Especially if there is a critical operation of other devices or network, the interrupted may be blocked.


Clarification please!
 
1a.) Are the hardware input changes sensed on interrupt triggered drivers and then copied to a memory location for  PLC inspection later. (I understand that IP1 will be this way for freq/counter)
 
   or
 
1b.) are the hardware inputs bit's only read from the hardware port when only PLC firmware encounters an IPx instruction?
 
 
2.) If 1a.) above  is the hardware totally IRQ driven or is there a 50ms  IRQ clock that does a software scan every 50ms as suggested?
 
Thanks!
 
IP1 does not depending on anything, it has hardware counter counting.  That is a lot faster than IRQ driven. That is why IP1 not missing a beat in count.
Other inputs are handled in firmware/PLC logic, they are slower, not as reliable as IP1.  In WC8, there are few software engines handling things in their own queue. Our scheduler must take CPU time and give to each software engine enough time to handle its task.  During this CPU handles one thing, it will not handle the other.
 
If you need more counters, please consider the I2C or SPI.  A lot of I2C real time clock chip can be used as counter,  just let input pulses send to the clock input pin. So that clock chip's counting will be actual number of pulses.
 
Just got reply from Maxim IC support, their RTC can count based on clock, not in the sense of the counter we are talked about
 
Hi Automate,
 
If your hardware is v 2.2.2 (printed on the PCB), then you can send it to us for firmware update. Once that is updated, it will allow you to self update to any version you like, including latest with I2C and SPI support.
 
Back
Top