Sign in to follow this  
Followers 0
gertsc

DIV with Micrologix 1200/1500 wihout rounding up

5 posts in this topic

I am trying to make a division preferly with a Micrologix 1200 or 1500, without rounding up. When I do the following calculation I get the result "40" in N7:0. F8:0 (228.25) DIV F8:1 (5.75) = F8:2 (39.69565) MOV N7:0 (40) Are there any way to get the result "39" in N7:0 ??? The F8:0 values are between 36.25 and 249.75. F8:0 is always 5.75

Share this post


Link to post
Share on other sites
Do this: F8:2 (36.69565) - .5 = destination N7:0 (39)

Share this post


Link to post
Share on other sites
Your welcome Alaric posted the same solution here, see link. Great minds think alike. http://www.plctalk.net/qanda/showpost.php?...amp;postcount=4 Edited by Mickey

Share this post


Link to post
Share on other sites
Ingenius of Alaric and Mickey's part. I bet I could have won the award for the most complicated code to do the task

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