Rslogix 5000 FAL and Control structure?

wilsonzhu

Member
Join Date
Jan 2008
Location
vancouver
Posts
278
Hi all,

In my Rslogix 5000 project, I use FAL instruction(File Arithmetic and Logic),Dest and expression are INT data type, When use res instrument to reset FAL 's Control tag, There is minor error, the message is "(Type 04) Program Fault
(Code 04) Arithmetic overflow. Result of an arithmetic instruction out of range", How to solve this probleum?
Thanks.
 
what's the different of mode "all" and "inc"?

In tha "All" mode, once the instruction sees a false-to-true rung transition, the whole of the file operation is performed in one go, before the processor moves on to scan the next instruction. Therefore, the file operation is performed in one scan.

In the "Inc" mode, the instruction only processes one element for each false to true rung transition. This mode is mostly used when you have additional logic following the FAL that needs to be executed for each array position. The file operation will require multiple scans to complete.

There is also a third mode, the "numeric" mode, where you can put a number in place of the All or Inc. In this mode the FAL behaves the same as the "All" mode, (i.e. once triggered it will complete), but it only processes the number of elements you specify per processor scan.

It does that same number of elements of the whole operation on successive scans until it has completed the whole file. This mode is used predominantly on large files, to spread the processor load over multiple scans, so that the processor scan-time doesn't take a massive "hit" each time the instruction is executed.

Have you tried reading the Instruction Help on the FAL. All of what I have just explained is detailed in there. Place your cursor highlight on the instruction name and hit F1 - that takes you straight to the help on that instruction.
 
Last edited:
Hi all,

In my Rslogix 5000 project, I use FAL instruction(File Arithmetic and Logic),Dest and expression are INT data type, When use res instrument to reset FAL 's Control tag, There is minor error, the message is "(Type 04) Program Fault
(Code 04) Arithmetic overflow. Result of an arithmetic instruction out of range", How to solve this probleum?
Thanks.

Can you post the relevant code so we can investigate this ?
 
Are you sure the error is occurring when the FAL resets and not as a result of the FAL? The RES itself shouldn't be the problem.

Not sure what exactly you are doing, but it sounds like the result of the math or logic is causing a number greater than 32767 to be sent to (one of) the destination(s).

Since your tags are INT they must fall in the -32768 to 32767 range.

OG
 
Last edited:
Probably, but in the expression, I also use int to do some logic AND/OR/NOT, it shouldn't exceed INT's limit, Actually when I change Dest and Data type in Expression to Dint, no minor error. The reason I want to use int because I need MSG Int array to SLC5/05 and DeltaV VIM card can only read Int array too.
Are you sure the error is occurring when the FAL resets and not as a result of the FAL? The RES itself shouldn't be the problem.

Not sure what exactly you are doing, but it sounds like the result of the math or logic is causing a number greater than 32767 to be sent to (one of) the destination(s).

Since your tags are INT they must fall in the -32768 to 32767 range.

OG
 
The first FAL produces a "Math Overflow", if bit 15 of the last INT in the Expression tag is a 1

I am trying to work out why this happens, because it doesn't seem logical to me...

How to solve the problem? - I don't think you need to worry about it - Minor errors won't stop the processor, it is just warning you that something may have gone wrong with "mathematics", but since you are not doing maths, just logic, it isn't an issue to be concerned with.

Possible Solution :-

If you read the help on the NOT instruction you will see that it only accepts DINT as valid data-types. I suspect that using NOT in the expression uses the internal NOT processing and you are getting a spurious result because it is sent a INT. Personally I would'nt worry about it - the results are correct, and I have tested them.
 
Last edited:
I suspect it is the first FAL. No matter what the value is as an input, if you NOT that value the sign bit will change. I'm not exactly sure what the computer science definition of a math overflow is but this may be enough to trigger it.

Keith
 
But if I change to Dint type in both Dest and Expression, there is no minor error. if NOT the Dint's bit 31, it will also cause the dest dint's sign bit changed. Why these cases is different?

I suspect it is the first FAL. No matter what the value is as an input, if you NOT that value the sign bit will change. I'm not exactly sure what the computer science definition of a math overflow is but this may be enough to trigger it.

Keith
 
Incidentally, if you want to see the arithmetic flags that produce these minor errors, you can put these rungs immediately after an instruction. (see attached pic).

RSLogix5000 does not animate the S:? flags
- it knows they will be going on and off throughout the processor scan.

Cut and Paste these four rungs as required to see what an instruction has done to the arithmetic flags.
 
If you read the help on the NOT instruction you will see that it only accepts DINT as valid data-types. I suspect that using NOT in the expression uses the internal NOT processing and you are getting a spurious result because it is sent a INT.

I thought I'd given a good explanation with the above
 

Similar Topics

I'm trying to copy the contents of an array to another array. I'd like to start at different positions in the array. ex: array1[12] ->...
Replies
4
Views
10,541
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
2
Views
151
I am completely stuck on building a ladder program that requires a start button to be pressed 3 times to turn on motor 1. Then motor 2 starts...
Replies
20
Views
572
First off, I'm a hobbyist-level programmer, and this program isn't controlling anything anything that could even remotely be considered "life...
Replies
18
Views
513
Back
Top Bottom