jydepower

Error code: 4140

3 posts in this topic

Hallo.

Recently ive got an error i haven't seen before.

Error 4140

im using GX IEC developer 

CPU is Q06UDEH

I cannot figure out why the error happens. 

When show the location to the step where the error occurs it makes no sense. The specific area has only got simple bool operations.

When trying to recompile the entire project. The error "moved" to another location in the program.

At this step there was a lot of float operations. When monitoring one of the variable value was NAN. I could not find anything about NAN in the manuals. But google stated it could mean not a number, which makes sense when reading the error description.

I know it impossible to help me with my specific problem, when i cant really tell where or why the problem happens.

But im pretty sure it has to do with me using float operations wrong.

Ive tried to do a simple test program just to see if i could provoke the error, but no luck.

How can i make a number go out of range, make it unnormal, nonnumeric or even infinite?

Maybe someone could give me a simple example how to provoke this error, which might help me on my search in my own program.

Thanks.

Below is a screen-dump from the manual on this error.

E4041.PNG.df9339e388eb89f4766069a415ddd4

Share this post


Link to post
Share on other sites

My first guess is that you have a denormalized float number. The Mitusbishi PLC's 32bit REAL's doesn't support denormals. A denormal is simply a number that is so close to "0" that none of the exponent bits are high. A normal have at least one of the exponent bits high. A denormal is so close to "0" that in our world (and most worlds) it makes no sense to use it for anything other than "0", hence you can simply reset the value to "0" if a denormal occurs.

To provoke it you will need to use a BMOV instruction in order to move a denormal into the REAL number you are using. However since a REAL number is set together by several pieces hence you cannot BMOV a random number. I would google for a "float calculator/converter" or similar so that you can see the actual bitpattern of a denormal and BMOV that bitpattern.

But in any way you'll need to check the values before you use them in the PLC code. My guess is that this value is coming from some external device... Example:

 

denormals.png

Share this post


Link to post
Share on other sites

Hallo Kaare and thanks for you reply.

You were right. The problem was external (HMI).

I haven't found the problem in my own project yet.

But the pictures below shows dumps from a test plc, where there same error heppened yesterday (the reason for my post).

It turns out that the test plc in our office was talking to a test hmi, where a colleague of mine have put in some program.

See the D800 overlap. This error is of course obvious. But im glad to see it made the NAN value, which i've never been able to provoke before.

Now i just have to find the most likely same error in my own project.

 

float_problem1.PNG.f379acff0a295037398fbfloat_problem2.PNG.f7c48f173bcc2b5414a91

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now