GregC

I’ve been trying to make a ladder program for a pulsing water meter.

Every pulse of the water meter is 10 liters.

I use about 8m3 per hour so that would be 800 pulses per hour.

If I irrigate for 8 hours, that would be 6400 pulses.

I have been using an upcounter and the maximum input to the PV of the counter is 32767 which indicates to me it is an INT.

At the rate of 6400 pulses per irrigation day. I will max out my upcounter in 5 sessions.

Is there a way of increasing the PV number or another way I could program without using counters. Would I have more luck in FBD?

I am reading the information in ScadaBR so you can see in my ladder program I’ve had to use a multiplier and divider to read liters and cubic meters.

 

Any suggestions would be great.

[203128%2F8791456%2Fmceclip0]

Reply 0 0
thiagoralves
Your variable is an INT, so it can only count up to 32767. If you change it to UINT it will count up to 65535. But better than that is to use a CTU_ULINT instead of the CTU block. That block internal count is 64-bit wide, so it can count up to 18,446,744,073,709,551,615. I don't think you need a number bigger than that. To send it back to ScadaBR, if you're using the Linux runtime you can store the ULINT on %ML0 and read that using Modbus. Just keep in mind that since each Modbus register is 16-bit wide, you will have to read 4 registers and concatenate them (ScadaBR has a config for that). If you're not on the Linux runtime, the other option is to divide the ULINT number into fractions that will fit in 16 bit variables in %QW0, %QW1, etc..
Reply 0 0
GregC
Thank you for that. I overlooked the other counters once I had set up the initial INT counter. 
Reply 0 0
JimWilks
Your other option is to cascade 2 counters.  Have the 1st count to 10,000 and when it is done, reset itself and simultaneously trigger a 2nd counter that can count to 32767.  The available count is now 10000*32767=327,670,000
Reply 0 0
GregC
Yep, that would look like working. At 10 liters per pulse, that would give me 3,276,700 m3, that's a lot of water to record and if that's not enough, Thiago has the answer above.
Reply 0 0
Reply