Sign in to follow this  
Followers 0
Kenwei8011

Floating point Add Function +F(454) Error

5 posts in this topic

Hi All, I am using a CJ1M PLC for my project. I would like to have a totalizer where adding a floating point reading in every second. I used the function +F(454) and write it in the way "H122 = H122 + CIO1056 (Real_Type)" and use a "P_1s" internal pulse to trigger for the function. When I use the CX-Programmer to simulate the logic, and I found that the reading in the address H122 (view in floating-point format) is not adding correctly. Let say H122 initially is 0, and CIO1056 is 1.0 constantly, the adding function is not count up by 1 every second. In facts, it shows something like previous reading 557.0 then next reading 705.0, previous reading 1007.0 then next reading 1145.0 I'm not familiar with Omron PLC, can anyone tell me what have I missed out? Is it because of the function is executing more than 1 times during the 1second pulse? If this is the case, what should I do? Thank you very much. Best regards, KW8011 Edited by Kenwei8011

Share this post


Link to post
Share on other sites
Hi You have correctly identified the problem. Just 'differentiate up' the 1s pulse. Right-click the contact and select from the context menu. Pp

Share this post


Link to post
Share on other sites
Thank you very much. It is working perfectly now. Besides, can I verified something with you, what is the maximum value for a floating point? Is this <3.402e+38> is the maximum value for a floating point? Thanks.

Share this post


Link to post
Share on other sites
Yes. The plc also supports 64 bit floats, too. I think precision near the 'limits' of a floating point number decreases so adding 1 may not give expected results. However, if you're just adding 1 every second, we'll probably be dead by the time it's a problem. Have a nice day! Pp

Share this post


Link to post
Share on other sites
Understood. Thanks again. Actually I am doing a flow totalizer for my customer. Base on a formula, I've done the calculation to get the Flow rate in Nm3/Hr. The operation flow rate is about 1200Nm3/Hr. So after I added the flow rate every second, I will have to divide them by 3600 to get the consumption. Thank you for your help. Have a pleasant day too! :)

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