Bruce Booska Posted February 10, 2022 Report Share Posted February 10, 2022 In Unilogic when you divide a real number, say 7.0/3.0 it puts out 2.33333333. I understand using 7/3 = 2 and modulo function 7/3 will give you that 1 remainder, but there's no choice for easily getting the real decimal output, the whole number output and the remainder. This also doesn't work well when the remainder is greater than .5 and rounds up. In RSLOGIX500 when you divide a real number, say 11000.0/375.0 it saves 29.3333333 to one register, 29 to S:14 and 125 = (11000 - (29x375)) to S:13. Are there math registers in Unilogic like this or do I have to build a formula? Quote Link to comment Share on other sites More sharing options...
MVP 2022 kratmel Posted February 10, 2022 MVP 2022 Report Share Posted February 10, 2022 Maybe it is helpful https://www.unitronicsplc.com/Download/SoftwareHelp/UniLogic_Knowledgebase/ Home > Ladder > Ladder Functions (LF) > LF: Math Functions > LF: INT to Real, Real to INT Or if you need - write C code for solve your math. 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.