Average Instruction Error

MikeGuerard

Member
Join Date
Jun 2016
Location
Ottawa
Posts
21
Howdy folks...

Quick and easy question here:

RSLogix 5000...

Trying to average a bunch of arrays and got stuck with one issue.
A typo threw my average instruction into an error state...

Are we able to clear this error without going out or run mode?
I know the prescan will set the ER bit to zero...

Is there another way to do this easily?

Thanks!

Mike
 
When you say "Error" do you mean the PLC went into a Fault? If so what kind of fault? Can you give us the fault code?
If it is a minor fault then yes you can fix it while in the run mode. If it is a Major Fault the PLC is already stopped scanning the program and is essentially "Shut Down". You will have to reset the fault in the software.
 
Hi Bullzi - thanks for getting back so quickly...

No fault seen on the PLC... just no data noticed being passed to the destination tag in the average file.

Checked and the instruction's DN / ER bit are high.

I'll check within the controller properties and see if there's any more info...
 
Looks like an overflow - stopped on position #4 and the number is huge...
Typo caused the data to be transferred from the wrong elements....
 
Can you post your code? Zip it first (forum rules)

What instruction(s) are you using for the average?
 
See pdf

You could unlatch the .ER bit after the instruction executes. But it would be nice to determine why its overflowing.

Edit: looks like you solved your problem while I was posting.
 
Last edited:
I should have read the forum's posting instructions more carefully!

I'm trying to attach a screenshot of the rung that's causing me issues...

Having some troubles attaching an image.

I've got three of these average instructions that were in error - now only 2. Not sure what caused the first to "clear". Machine is running - no issues with processing, just no data through this instruction.

Thanks again for the help guys!

I'm going to work on getting that image up....
 
Okay! All good now....

This issues comes from approaching the average instruction with some ignorance for how it's managed....

I wasn't clear on how the "control" structure worked.
I was manipulating the control.LEN but all I needed to do was manually set the EN, ER and POS back to 0's and then I'm good.

sweet sweet data now being generated just as the boss wants!

Thanks to all for the help! Appreciate it!
 
Yes, you can modify the instruction online while in Remote Run by performing a normal online edit. You can modify the Length, Position, and Error tag while in Run mode without performing an edit. Since they are just data, they can be modified any time.

Simply click on the Length or Position value and type a new value and press ENTER.

To reset the ER bool tag right-click on the Control Tag and select Monitor "Tagname". In the tag window click on the "+" next to the tag name to expand the tag and expose the ER bit. Right click on the ER tag and select Toggle bit to toggle bit status. Or type a "0" into the Value column.

OG

** apparently I typed too slowly ** :)
 

Similar Topics

Does this instruction calculate values during a single scan, or does it require number of scans based on element count in the array? For Example...
Replies
3
Views
109
Hi all, I'm trying to set up a moving average in PME 8.6 and apparently there is such an instruction (MAVG) but when I try to insert it into an...
Replies
6
Views
2,208
I am working on a program in Cscape to take a pulse input from a flow meter and output an average of the last 5 minutes of flow and total flow to...
Replies
1
Views
570
I am storing values into an array. I am wanting to find an average of the highs and an average of the lows. Something like this... After 50...
Replies
36
Views
8,821
I need to keep a running pass/fail yield of the previous 5,000 parts produced. I have used this formula before to calculate average: AvgValue =...
Replies
6
Views
2,140
Back
Top Bottom