RSLogix Correct Length for AVE

logix_mind

Member
Join Date
Feb 2022
Location
KY
Posts
5
I have a furnace and I'm wanting to calculate the average metal temp at which the furnace is tapped each day. There's no set number on the amount of taps that I will see each day. It could vary between 8, to 24, to 13, to whatever.

Every time that the furnace is tapped I'm shooting the temp into a FFL. At 11:58PM I'm wanting to calculate the average metal temp at tap for that day and at 11:59 I am clearing out my array.

My issue is in my AVE instruction...how can I set the correct length (i.e. taps per day)? It won't let me enter in a tag in the length block. Is there any way to have a length in this instruction that will be dynamic like what I have?

Capture.PNG
 
As you now see, the value for length and position come from the control tag, that is why you can't put a tag in its place. An instruction like COP, which has a length property, doesn't have a control tag, that is why you can use a tag or a constant.
 
As you now see, the value for length and position come from the control tag, that is why you can't put a tag in its place. An instruction like COP, which has a length property, doesn't have a control tag, that is why you can use a tag or a constant.

I was unaware that the control tag had properties like that which I could use so that will be very helpful in the future.

Whenever I go to unload the array, is there a way for me to unload the entire array at one time or does it have to be toggled one by one until empty?
 
Well a RES addressed to the control tag will reset the FFL/FFU position to 0, probably clears any bits that might be on. The data will still be in the array, so you would have to clear the data out of your FIFO array. You can use a FLL for that. Source 0, destination FIFO tag, length=size of array.
 
Well a RES addressed to the control tag will reset the FFL/FFU position to 0, probably clears any bits that might be on. The data will still be in the array, so you would have to clear the data out of your FIFO array. You can use a FLL for that. Source 0, destination FIFO tag, length=size of array.

So if I do that, I won't have anything toggling the FFU, right? It will just all be done through the FLL and RES?

Capture.PNG
 
Correct. the FLL will populate the array of data with zeros, the RES will reset your FFL/FFU to the state that it is in the screenshot (position and EM).
 
The FLL is unnecessary. The reset of the .LEN parameter to 0 essentially makes all values in the array invisible, and each value is overwritten at the next tap when .POS equal that value's offset (index) in the array.

Also, the code should not RESet the FIFO control structure until and unless that control structure's .EN bit is 0, otherwise there will be a spurious entry into the FIFO.


Finally, I think the MOV instruction should use the FIFO .POS parameter as its source; that is the number of elements in the FIFO array to be averaged.


[Edit: MOV fifoctl.POS avectl.LEN i.e. use FIFO .POS, not .LEN, as MOV source]
 
Last edited:
...

Also, the code should not RESet the FIFO control structure until and unless that control structure's .EN bit is 0, otherwise there will be a spurious entry into the FIFO.


...


By the way, this also applies to CTU/CTD instructions. If the rung EN is true when the RES is called, the instruction will execute again. For that reason, I've seen an ONS/OSR placed before the CTU/CTD instruction. An alternative here is to write a 0 to the ACC register.
 

Similar Topics

Hi PLC experts :) I’m working on a project in studio 5000 Logix designer with several servo motors, I'm trying to set the properties for them...
Replies
1
Views
819
Has anyone experienced the following issue on RSLogix5000 (currently on V16) I have a PLC program that has been running on a site for a number...
Replies
5
Views
1,595
Can Anyone tell me if this is correct in RsLogix 5000 for averaging the last 30 seconds of data? I’m missing anything else?
Replies
13
Views
7,342
Hi folks, in the alarm manager of Rslogix 5000, the tag-based alarm has been created. But when I tried to change the condition, it was found the...
Replies
0
Views
21
I have a little bit of experience with Allen-Bradley. I have a Micrologix 1500 (RSLogix 500) and a PanelView Plus 7 (FactoryTalk View Studio ME)...
Replies
3
Views
111
Back
Top Bottom