Totalizing FlowRate RSLlogix 500

nick88

Member
Join Date
Oct 2015
Location
West Virginia
Posts
12
Hello,

I am wanting to totalize barrels by interpolating a flowrate in the PLC.

I have a MicroLogix 1400 plc w/ an IF4 expansion card. I am bringing in a (4-20ma) analog input measuring flowrate in BBL/DAY. I am scaling the range from 515 to 6000 bbl/day using the SCP function block and setting it in the register F8:1.

To totalize my barrels, I am using an STI (periodic) task to run a program with a 1 second delay between scans.

At the beginning of the periodic program, I take the floating point register (F8:1) and then multiply by .000012 to convert to bbl/sec and set that value in F8:2. The next rung, I add F8:2 (flowrate) and F8:3 (total) and set equal to F8:3.

When my total is greater than 1000, I add .001 to an integer (N7:13) to get millions of barrels. I then subtract 1000 from F8:3 to reset it.

To implement a STI program, do I need to just configure the STI function file under the STI tab in function files?

Do I appear to be on the right track with my code?
 
Last edited:
When my total is greater than 1000, I add .001 to an integer (N7:13) to get millions of barrels. I then subtract 1000 from F8:3 to reset it.

The 'N' data type does not support fractional portions, just integers. You can't add .001 to it.

The 1400 supports the Long data type. Create a Long data type table. (e.g.L10)

Then each time add 1 to L10:0 and subtract your 1000.0 from F8:3.

The long (given that '1' equals 1000 barrels) could represent up to 536870911000 barrels. (536.8 trillion barrels).

Given that there are about 34 billion barrels of oil produced in the world in a year it should be a large enough number. Though you didn't specify exactly which liquid you are measuring.

Maybe it's beer?
 
Last edited:
How about first try this

Each second just add your scaled value to a float total.

Any time you want divide the accumulated float by 86,400 to get barrels to that point.

I think you will loose more precision doing the way you show.
 
Last edited:
Any chance you can get volume pulses from the meter to the PLC? That would make your life much easier plus your measurement of your flow totals would be much more accurate.
 
The liquid we are measuring is water which is being pumped into a disposal well.

Each second just add your scaled value to a float total.

Any time you want divide the accumulated float by 86,400 to get barrels to that point.[/
QUOTE]

I will try this method. When I divide out the accumulated float, can I place this logic in a regular program, or should it remain in the STI program I have created?

The meter does output volume pulses, but speaking with Rockwell, the model Micrologix 1400 I have does not support a HSC. I am trying to avoid adding a second PLC just to accumulate pulses.
 
Last edited:
I will try this method. When I divide out the accumulated float, can I place this logic in a regular program, or should it remain in the STI program I have created?

Place the accumulation in the STI. You can do the divide at any time. I don't think an STI will interrupt mid-instruction.
 
nick88 said:
...The meter does output volume pulses, but speaking with Rockwell, the model Micrologix 1400 I have does not support a HSC. I am trying to avoid adding a second PLC just to accumulate pulses.

That's funny because the 1400 is the most well endowed High Speed Counter of the MicroLogix family?...

The MicroLogix 1400 has six 100Khz High-Speed Counters (HSC).

There are three main high-speed counters (counters 0, 1, and 2) and three sub high speed counters (counters 3, 4, and 5).

Each main high-speed counter has four dedicated inputs...

Main Counters:
HSC0 utilizes inputs 0,1,2,3
HSC1 utilizes inputs 4,5,6,7
HSC2 utilizes inputs 8,9,10,11

Each sub high-speed counter has two dedicated inputs...

Sub Counters:
HSC3 utilizes inputs 2 & 3
HSC4 utilizes inputs 6 & 7
HSC5 utilizes inputs 10 & 11

In RSLogix 500, you configure the counters under the "HSC" tab in "Function Files".

Input device connection depends on the counter mode selected.

The MicroLogix 1400 uses a 32-bit signed integer for the HSC. This allows for a count range of (+/-) 2,147,483,647.

You can use an STI in conjunction with one of the built-in HSC to count input pulses and calculate a rate value, or if you have a known volume pulse from your flowmeter you can totalize...

19445 - Use STI to calculate High Speed Counter input Rate Value on MicroLogix controllers
Access Level: TechConnect

I haven't time to "paraphrase" this one, if you do not have a TechConnect contract, but if you need further assistance, do let us know and I or others I'm sure can help.

Regards,
George
 
He is using an 1766-L32AWA with AC inputs.All MicroLogix 1400, except the 1766-L32AWA and 1766_L32AWAA, have six 100kHz high-speed counters.
If you need AC inputs then use AC expansion modules.
 
Good spot!

I thought I had read BWA, but hadn't read it twice. Thanks again!

To confirm...

64681 - Connecting encoders into embedded MicroLogix inputs
Access Level: TechConnect

Regards,
George
 
There doesn't seem to be a HSC Card available for the Micrologix 1400. If you dont have to use AC inputs maybe consider changing the PLC to a BWA model. It will give you DC inputs/Relay Outputs and HSC like George talked about.
 
You can do it with the analog set up as you have it, but it will never exactly match the totalizer on the meter (if one exists). If you can tolerate some inaccuracy, then there is not a great need to change hardware to switch to a pulse counter.

Additionally, if the pulse rate is slow enough (both on and off times of each pulse) you may be able to do it with regular old slow inputs.

The drawback to pulses is knowing if or when you missed some of them. The drawbacks to analog is cost per point and matching the accuracy of the indicator sending the signals.
 

Similar Topics

Hello everyone! I've got something I'm trying to figure out and I'm possibly overthinking it. I've got a 25,000 gallon bulk chemical tank with an...
Replies
12
Views
2,179
Hello, all. I’ve worked with totalizers based on a flow meter. However, I am trying to use ladder logic on totalizing a tank based on volume. I...
Replies
1
Views
1,135
Is this reasonable to do? I am using a SLC 5/05 so there's no totalizing instruction, I think I have to make my own. Anybody done this, any...
Replies
14
Views
4,342
Hi, please i wish to do batch totalizing ( automatic flow control) i wish to use Endress+Hauser flow transmitter with Allen Bradley 1400 to do...
Replies
30
Views
6,056
Hey GE guys, wondering if any of you had any experience with getting the TOTALIZER instruction working in Proficy Machine Edition. Seems...
Replies
9
Views
3,762
Back
Top Bottom