Vinicius Posted June 3, 2020 Report Share Posted June 3, 2020 Hi everyone, I'm trying to make formula block works, the formula is ( 685 - ( ( 777 / 10000 ) * A ) ) = MI 12, where A is MI. This keeps me giving me 675 as result. Doesn't matter the A value. I tried also to work with "0.0777" and "0,0777", and changed the MI's to ML's but I didn't get the right result. Thanks Quote Link to comment Share on other sites More sharing options...
MVP 2022 Joe Tauser Posted June 3, 2020 MVP 2022 Report Share Posted June 3, 2020 PLCs don't do floating point very well if integer data types (MIs) are part of the considered equation. Your 777/10000 term and your decimals are less than 1 and getting thrown out when the formula block executes. If you want decimal points do everything in MF data types and build your formula out manually. Joe T. Quote Link to comment Share on other sites More sharing options...
MVP 2022 Flex727 Posted June 3, 2020 MVP 2022 Report Share Posted June 3, 2020 19 minutes ago, Joe Tauser said: If you want decimal points do everything in MF data types and build your formula out manually. Or do some math ahead of the formula block to ensure any division results with integers are greater than 1 and big enough to provide the needed precision. Then you can sort out the decimal location afterward. Quote Link to comment Share on other sites More sharing options...
Vinicius Posted June 3, 2020 Author Report Share Posted June 3, 2020 Thank you guys, I made manually, and works fine. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.