Sign in to follow this  
Followers 0
WKla

Float data error

10 posts in this topic

Hello, I have the following error with the following float value. First I was not using the limiting condition and this error show up when "E/" instruction was executing. But I wanted to eliminate this exception and introduced the limiting condition GT and LT. Still the same error. In the manual specifies that no error can not occur in GT, LT instructions. Do you have any idea how to manage this exception? The error make PLC stop so is pretty serious.

Share this post


Link to post
Share on other sites
Split up the two operations, comparing and dividing, so that the comparing is executed in the network before the dividing. Move the GT/LT instructions into a new network rung before the E/ instruction (use a new coil on the output of the "AND" and use it as an input on the "E/"). This ensures that you are certain that the comparing instructions are executed before the E/ instruction.

Share this post


Link to post
Share on other sites
The same error occurs. I could verify the mantissa or the exponent but it a little more complicated because I don't know what are the conditions of error.

Share this post


Link to post
Share on other sites
With GXWorks2 simulation: I can't enter a value of -2.359566e-41 but I can enter -2.359566e-38 as single precision. I can enter them as double precision but the E/ doesn't like double precision. What is the datatype of the flow rate? What code generates this value?

Share this post


Link to post
Share on other sites
The PLC reads the value of the flow rate through modbus protocol from another device. This is not the real value of the flow rate because I receive an inverted float (the two int16 registers are inverted). But this error made me think what if an erroneous reading is happening.

Share this post


Link to post
Share on other sites
I agree. I don't have a CPU available right now but I will check it as soon as I have one in hand and get back to you.

Share this post


Link to post
Share on other sites
I have just tested with your data without problems. Could you post your program (or the POU with problems)? Which version of GW2 are you using? EDIT: What datatype are you using for "FC7_Flow_Rate"?? Edited by kaare_t

Share this post


Link to post
Share on other sites
As a side note to all: It is often desirable that the PLC does NOT go into error state when operation error occurs. I always disable the PLC-STOP if such error occurs. That way, the err led will light up, but the PLC will continue to run. See attached picture.

Share this post


Link to post
Share on other sites
I use GW2 version 1.91V. I have just created a new program with only one task, POU. Because the PLC is not available I used the simulation instead and the problem persists. FC7_Flow_Rate is a single precision float. I have observed that the lower limit of the float (single precision) type is given by the exponent. So the exponent should be greater then 0. The method for situation like this would be: -verify the Exponent (bit30 to bit 23) is greater the zero, if not, make the float zero -verify the float value is between minimum and maximum in such way that the result should be a normalized float that is recognized by the PLC. If the result is not normalized fatal Error occurs and PLC goes in STOP. Other possibility would be to change the mode that the error is managed: Parameter Setting/PLC RAS/ Operating Mode When There is an Error/ Computation Error : Stop->Continue. But I don't know what other consequences would have on the normal functioning.

Share this post


Link to post
Share on other sites
You should change the datatype to double precision since the data is not single precision compatible.

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
Sign in to follow this  
Followers 0