Vinicius Posted June 3, 2020 Report 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
MVP 2023 Joe Tauser Posted June 3, 2020 MVP 2023 Report 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.
MVP 2023 Flex727 Posted June 3, 2020 MVP 2023 Report 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.
Vinicius Posted June 3, 2020 Author Report Posted June 3, 2020 Thank you guys, I made manually, and works fine.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now