1 Minute Rolling Comparison

dvkdan25

Member
Join Date
Dec 2016
Location
California
Posts
5
I am attempting to have a permissive to start a sequence that requires a temperature PV stay within 10 Deg C of itself for the last minute.

Is there a way to constantly write a value 60 seconds in the past to an intermediate tag which can then be used to compare the present value? I'm thinking this would require moving 60 seconds worth of values into something like a FIFO register?

Any help from someone who has done this before would be greatly appreciated.
 
So you want to wait to start a process until you can verify that a temperature has not changed more than 10 degrees C in the past 60 seconds?
 
Hi and Welcome to the Forum,
When you say "10 Deg C of itself" are you just looking for the temp to be stable? Or are you looking for the temp to stay withing a 10 Deg range of a value?
 
Correct. I would like to grab the min and max values for the last 60 values (one per second) and compare it to the PV +/- 10 Deg C.
 
There are a several different ways you can do this.
One way:
Create a timed task with a period of 1s or 1000ms.
Everytime the code scans you take the value of the temperature tag and add it to a Real tag to create a total tag. Then add 1 to a INT or DINT tag to create a # of samples tag.
Then if you divide the total tag by the # of samples tag you have a average.
If you need to start a new Average then at the start of the code you will look at the value of the # of samples and if it is 60 then you can move the average into another register, clear out the total tag and the # of samples tag so you start over at 0.

Another way is to use a TON and use the done bit to trigger the same sequence.

Hope this helps
 
why not a timer based on the condition that the temperature remains stable within 1 minute instead and use the Timer.DN flag to start the sequence?

Edit:

You're not trying to calculate anything based on the past, merely being sure that the temperature for the last minute is within a range. In AB world, a rung with one of two comparators, plus a TON timer would do this.
I have it done this way in many points in my plant.
 

Similar Topics

Hello all, I need a little help. I have a process that automatically changes a tag value if conditions are met. I have been tasked with keeping...
Replies
14
Views
3,109
I have a machine that pulls vines into it and they hit a limit switch to count them. I also would like to figure out how many vines per hour are...
Replies
15
Views
5,493
Hello, I am going to use an HMI for a 4 digit military rime entry. I want to compare this value against the curr_hour and curr_minute in the...
Replies
7
Views
1,929
Hey Guys I have several scripts to write in Wonderware & I was concerned about the limit of lines in a script. I have been placing them under in...
Replies
3
Views
1,588
Good Afternoon , I'm upgrading a machine , and all the conveyor speeds are in Foot Per Minute. That is what the operator will select on...
Replies
8
Views
2,190
Back
Top Bottom