Posted 2 Dec 2016 Hello, Could somebody give for me advice how need seperate real number to integer? for example I have in D10 real number 10,9 for me need to do integer number 10 and 9. The real number seperate to integer I am using this LADDER line, attached picture. In D90 I got 10, But how to isolate the number of decimal places,I can not think of. Please help for me Share this post Link to post Share on other sites
Posted 3 Dec 2016 Subtract them... you get 0.9 Guess what the next step is... Share this post Link to post Share on other sites
Posted 3 Dec 2016 (edited) 8 hours ago, panic mode said: Subtract them... you get 0.9 Guess what the next step is... How subtract them? Have you in mind this below example Edited 3 Dec 2016 by saruans Share this post Link to post Share on other sites
Posted 3 Dec 2016 note: INT and REAL have different instructions and binary representation. you don't mention CPU type and i have not seen Mitsubishi in years but it should be something like: 1. convert REAL to INT (D10 to D90) 2. convert INT to REAL (D90 to D98) 3. subtract REAL from REAL (D98 from D10, result to D96) 4. multiply D96 by 10.0 (result to D94) 5. convert REAL to INT (D94 to D92). your result is in D90 and D92 Share this post Link to post Share on other sites
Posted 23 Aug 2019 How i can do this on mitsubishi fx-1n CPU which do not support INT instruction ?? Share this post Link to post Share on other sites
Posted 23 Aug 2019 well... read manual and use instructions that your plc does have. for example check chapter 4.15.3 in FX programming manual: http://dl.mitsubishielectric.com/dl/fa/document/manual/plc_fx/jy992d48301/jy992d48301j.pdf Share this post Link to post Share on other sites