Micrologix Analog Value Storing (Min, Max and Average)

toddp65

Member
Join Date
Aug 2014
Location
Florence, Ky
Posts
282
Hi all--

I need to create code in a Micrologix 1400 project that requires minimum, maximum and running average calculated values (Flows and pH)and stored for the current day and previous 6 days. This is for a wastewater pH leveling and monitoring system.
I'm looking for some insight or online example of how this could be performed.

Thx!
 
for the average do you just want the average of min-max or an average of all samples.
What is your sample rate.
You will need to set up the Real Time Clock in 1400 to set your sample rate and shift them into a holding register (if only sampling say every hour) to be simple, and could do an average of the register values. For Max I would use a one shot that moved Ph value into a register that had a GTR in front of it with the same register & the same for min only use a LES.
 
this is the narrative verbatim:
The following analog signals shall have min, max and running average calculated values: flows and pH. Instantaneous values, totals, max. min, and average values shall be read y HMI (SCADA) and reset on daily basis as described below. Minimum and maximum and average values shall be stored in PLC for current day and previous 6 days.

also I need to calculate equipment runtimes and numbers of starts for all equipment where run signals are monitored (that would be the recirc pumps) and reset on daily basis.


Flow rate is monitored by a flow meter. Right now it is on a data logger i have scaled but I believe the EUs are 0-2.9 (It'll be 4-20 mA).

I am not for sure of the sample rate as it's ask for min, max and average.
I figured I'd have to utilize the RTC but I wasn't for sure without searching. I know a 1400 uses one.


Thx again
 
I have done this like taking samples one per hour to sql database and done the calculation in indusoft SCADA. Can you do it something like this?
 
You want Flow & pH, Need to know the sample rate if once an hour is a lot less complex than every minute.
For your daily record do you want, total Flow (gallons) min pH, max pH, average pH.
again for your average pH do you want average of all samples taken or just average between min & max
 
I have done this like taking samples one per hour to sql database and done the calculation in indusoft SCADA. Can you do it something like this?
The thing is that system will report to a SCADA Ignition system; the design engineers of this project are wanting this info created and kept in the PLC--I know, if it's capable of being done in the Ignition why the PLC?
 
You want Flow & pH, Need to know the sample rate if once an hour is a lot less complex than every minute.
For your daily record do you want, total Flow (gallons) min pH, max pH, average pH.
again for your average pH do you want average of all samples taken or just average between min & max

They don't indicate a flow rate. It's all very ambiguous. I would guess that made the sample rate would be arbitrary since to don't give any rates.

"All digital and analog signals shall be monitored and totalized in the PLC. Flows, temperature and pH. Flows and ph shall have minimum, maximum and average calculated values. Minimum, Maximum and average values shall be read by the HMI software and reset on a daily basis as described below. Minimum, maximum and average values shall be stored in the PLC for the current day and previous 6 days"
 
It is capable of being done in the PLC also. The good thing about doing it in the plc is that if the comms fails or the SCADA plc is offline for some time, then the values will still be being captured/calculated/etc.


People can help you, but most are waiting on one question to be answered.

-What is the required update/sample rate?

Meaning, yes you want to get average values on the day, but the sample rate will determine the number of data values in the sample.
-Example: Sample data every hour on the hour, then there will be a total of 24 values in the average calculation (up to 24, a running average would be calcuting every hour based on current number of samples).

-If you need every half hour, then that changes some of the logic and math.

-If you need every minute then again that is different math and slightly different logic involved.
 
Here is my example: I'm sure there are a lot of ways to do it
I am using
F8:0 as pH SCALED
F8:1 as pH Max
F8:2 as PH Min
F8:3 as pH Average
F19:0-F19:5 as 6 days of pH Max
F20:0-F20:5 as 6 days of pH Min
F21:0-F21:5 as 6 days of pH Average

I didn't run on Emulate yet, Flow & Temp would be the same just address changes
 
I use integers in the SCP so you can adjust your parameters
by addressing them in the HMI (Thats how all mine are)
 
I would go for 15 minutes or 1/2 hour.
the scada system could then do trending and set alarms based on the readings.

you are going to have to find out what the max flow rate is as well as the ph flow in order to get your scaling values in the plc correct. without this information, you could sat the max flow is 1 gallon, or 1 million gallons when the max flow rate it 200,000 gallons. you cannot guess on this, you must know.

when you get the program working, I would also add a date, time, and flow rates data into the program or store the information into the scada system or on the network. if something goes wrong, the powers that be will want this information, not daily averages.

james
 

Similar Topics

I need help achieving the following task: ML1200 sending 4 to 20 mA thru analog output ch0 to a DC speed controller analog input(4 to 20 mA) my...
Replies
3
Views
669
Hello everyone.Am new in allen bradley configuration,i have a mini project to execute, i have wired my Micrologix 1400 for analog input signal of...
Replies
0
Views
1,499
Hello everyone.Am new in allen bradley configuration,i have a mini project to execute, i have wired my Micrologix 1400 for analog input signal of...
Replies
3
Views
2,593
Hi All, I would like to ask you if possible to have some samples code for the realization of a software filter to be used in a PLC Micrologix...
Replies
2
Views
2,072
All, I need some assistance ASAP. I am not sure how to configure IV3+ analog input for 0-10 vdc. Is there a jumper or something that I need to...
Replies
2
Views
1,395
Back
Top Bottom