math errors

drewcrew6

Member
Join Date
Apr 2002
Location
allentown, Pa
Posts
418
Some time ago there was a post about math errors in a plc and in a pc. I was talking to a co-worker and he was saying about how he has seen -0 and 0 on whole math calculations and was curious about that. I told him about math errors and that I would try to find info about it but I can't dig up the posts or links.

Thanks
Drewcrew6
 
drewcrew6 said:
Some time ago there was a post about math errors in a plc and in a pc. I was talking to a co-worker and he was saying about how he has seen -0 and 0 on whole math calculations and was curious about that. I told him about math errors and that I would try to find info about it but I can't dig up the posts or links.

Thanks
Drewcrew6

What do you mean by math errors?
Are you talking about processor errors, such as divide by zero or overflow?
Or are you talking about cases where the PLC computes the wrong value.

There is a convention for computer floating-point math that most PLCs follow. It is IEEE 754. There are a lot of rules and conventions for that standard and for the standard integer math (called two's complement) that are not intuitive to a human doing the same calculations.

Actual math errors by computer processors are few and far between (the pentium fdiv bug for example) and could be caused by faulty hardware.


There are cases where -0 and 0 are valid answers BTW(Think about a value that maintains its sign but is small enough that it is rounded down (or up) to zero.
 

Similar Topics

Hi guys We have an issue on our site with an Allen Bradley panel view c600 HMI, linked to a micrologix 1400. The PLC is controlling 2 motors on a...
Replies
16
Views
4,969
Hi guys, I am trying to create a very basic totalizer in Logix; I need to keep track of runtime for pumps, their number of starts too; I need...
Replies
7
Views
4,316
I was called into a plant recently to diagnose errors with their natural gas totalization. Long story short: They had installed orifice plate...
Replies
12
Views
5,194
Was wondering if anybody might be having the same issues. Have a palletizing and wrapping system. works fine but ocasionally the program will...
Replies
6
Views
3,286
I have an expression in a structured text routine of a Logix controller that looks more or less like the following: ResultInteger := Integer1 *...
Replies
13
Views
386
Back
Top Bottom