Marnus Wisse

Micro830 -Calculating Flow Rate from pulses with EII

12 posts in this topic

Good day,

I need to calculate the Flow rate from a pulse input.

I read on one of the other forum topics that TIM Wilborne made a suggestion to do this with an EII and to time the spacing between each pulse. It make the flow rate looks a little more "real time".

Can anybody assit me on how to do this?

I know hoe to create an EII, but do not know how to use it.

 

Share this post


Link to post
Share on other sites

Hi Marnus.  You only want an ADD instruction with a Source A of the Flow Total Count, a Source B of 1, and a Destination of the Flow Total Count in the EII.  Since it interrupts the regular program, it needs to be a lean as possible.  Then do the flow rate calculation in regular ladder such as I did in one of these lessons depending on the PLC you are using.

RsLogix 500 https://www.theautomationstore.com/rslogix-500-training-how-to-calculate-the-rate-speed-or-rpm-on-a-high-speed-counter-in-rslogix-500-for-a-micrologix-plc/

Connected Components Workbench https://www.theautomationstore.com/calculating-rate-on-a-high-speed-counter-in-an-allen-bradley-micro800-micro850-plc/

Depending on how slow your pulses is, the above could make it jumpy.  If it does then you only want to log a timestamp in the EII then still calculate the flow rate in a regular ladder program based off of the change in the timestamp.

Share this post


Link to post
Share on other sites

Hi Tim,

Thank you so much for the advice. I have a Micro830 and do not have the High speed counter plug in module.

Can I use a normal counter instead of a High speed counter?

My flow meter is only giving me an average of about 20pulses/sec. 

1 Litre of oil is pumped every 403pulses

I need to display the flow rate, as well as the cumulative oil pumped.

 

 

 

 

 

Share this post


Link to post
Share on other sites

Hi Tim,

Okay, I managed to calculate the flow - thank you.

But yes it is jumpy. So how do I log the timestamp in the EII/ or how exactly do I fix this?

Thanks again for your assistance.

 

 

Share this post


Link to post
Share on other sites

Great video, Tim, but it left me with a question way off this topic. I left the RS500 world a few years ago for ControlLogix, and the CLX processors have only recently updated to have 64 bit words. Specifically, the L8 is the only CLX controller (that I know of) with a 64 bit word, the LINT. The thing that jumped out at me immediately in your video was the L data file in the RS500 program. A quick search showed me two SLC 5/05 controllers that are 64 bit. Who knew? I didn't! Anyway, just for fun I created a new RS500 project using an L553 and still can't find L as an available data file type. I'm using RS500 Pro, V12. Where can I find that L data file?!

Share this post


Link to post
Share on other sites
16 hours ago, Marnus Wisse said:

But yes it is jumpy. So how do I log the timestamp in the EII/ or how exactly do I fix this?

Given the distance between your pulses, if the flow isn't consistent then it will still be jumpy.

If it is just to make it pleasing to the operator viewing the HMI then below is a little cheat I do sometimes too slow the transition from one value to another.  I think I'll make a video on it.  See if you can figure out how to put it in Connected Components Workbench.

FilteredRate = FilteredRate + Constant * (CalculatedRate - FilteredRate)
The constant will be a value between 0-1.  The smaller the value, the slower the response, the closer to 1, the faster the response
 

8 hours ago, ElectronGuru said:

Great video, Tim, but it left me with a question way off this topic. I left the RS500 world a few years ago for ControlLogix, and the CLX processors have only recently updated to have 64 bit words. Specifically, the L8 is the only CLX controller (that I know of) with a 64 bit word, the LINT. The thing that jumped out at me immediately in your video was the L data file in the RS500 program. A quick search showed me two SLC 5/05 controllers that are 64 bit. Who knew? I didn't! Anyway, just for fun I created a new RS500 project using an L553 and still can't find L as an available data file type. I'm using RS500 Pro, V12. Where can I find that L data file?!

The "Long" data type is only available in the MicroLogix 1100, 1200, 1400 and 1500.  However it is not a 64 bit word, it is a 32 bit word.  I really don't know how the naming evolved in RsLogix 500 that it doesn't line up with Studio 5000 but...

RsLogix 500 = Studio 5000

N Integer = SINT Single Integer

L Long Integer = DINT Double Integer

Doesn't exist = LINT 64 bit Integer.  Interestingly we assume the stands for long integer but I don't find any reference stating it.

1 person likes this

Share this post


Link to post
Share on other sites

Posted (edited)

Hi Tim,

Thank you for the response. I will see if I can get it figured out in my components workbench. :lookingaround:

By the way, I have a pule generator that I test with, so I can simulate a constant flow.

When the Simulated pulse is on a round number, eg: 18.00Hz, then the reading is constant.

As soon as it is something like 18.52Hz for example, that is when it is jumping. 

I can understand why this is, but yes, the client is not going to like to see jumping values.

Looking forward to that video  :dance:

 

 

Edited by Marnus Wisse

Share this post


Link to post
Share on other sites

Allen Bradley does not seem to keep things consistent from one version of software & equipment to another. And I should've remembered hearing that in RS 500, high speed counters are only available on the Micros. That would've helped me figure this out on my own. 

My understanding is that in Studio 5000:

S = SINT = short integer = 8 bits. In my experience, this is mostly used for talking to legacy equipment.

I = INT = integer = 16 bits

D = DINT = double integer = 32 bits. This is the default data type in Studio 5000.

L = LINT = long integer = 64 bits. This is only available in the CLX L8 controllers.

The frustrating thing is that in other software, like FactoryTalk View Studio, they refer to a 32 bit word as a long integer. It gets to be a pain when programming a PanelView to read data from a CLX controller and PV says 32 bits is a LINT, while Studio says 32 bits is a DINT.

In your video, when I saw the counter accumulator go over 64,000 in an RS500 program (and I assumed a SLC controller), and then saw the L data type, my Studio5000/CLX mind went straight to the 64 bit LINT. In responding to my question, you reminded me of the lack of nomenclature consistency in various AB products. 

Thanks for taking the time and I'm looking forward to watching more of your videos!

Share this post


Link to post
Share on other sites
On 5/17/2020 at 10:20 PM, ElectronGuru said:

Great video, Tim, but it left me with a question way off this topic. I left the RS500 world a few years ago for ControlLogix, and the CLX processors have only recently updated to have 64 bit words. Specifically, the L8 is the only CLX controller (that I know of) with a 64 bit word, the LINT. The thing that jumped out at me immediately in your video was the L data file in the RS500 program. A quick search showed me two SLC 5/05 controllers that are 64 bit. Who knew? I didn't! Anyway, just for fun I created a new RS500 project using an L553 and still can't find L as an available data file type. I'm using RS500 Pro, V12. Where can I find that L data file?!

From the manual here:   https://literature.rockwellautomation.com/idc/groups/literature/documents/rm/1756-rm003_-en-p.pdf    Page 852.

 

These processors use a LINT as well:   LINT data type is a 64-bit integer. The LINT data type can be used in numerous instructions on Compact GuardLogix 5380, CompactLogix 5380, CompactLogix 5480, ControlLogix 5580, or GuardLogix 5580 controller however the LINT data type cannot be used in most instructions on CompactLogix 5370, ControlLogix 5570, Compact GuardLogix 5370, GuardLogix 5570 controllers. Consider the following when using LINT data type on CompactLogix 5370, ControlLogix 5570, Compact GuardLogix 5370, GuardLogix 5570 controllers.

 

Tip: LINTs can only be used with copy (COP, CPS) instructions. They are used with the CST/WallClock Time attribute, time synchronization and Add-On Instructions. You cannot add, subtract, multiply, or divide this tag type.

1 person likes this

Share this post


Link to post
Share on other sites

Thanks for the correction, Armadillo. I did say only CLX, and LINT can be used in any L8 controller. The use is so limited in the L7s that I have never tried to do anything with it there.

1 person likes this

Share this post


Link to post
Share on other sites

I was just curious myself is why I looked it up. Honestly never gave it much thought until this post. 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now