CobryWZL Posted February 25, 2020 Report Share Posted February 25, 2020 Hi guys, for our application we need to store some decimal numbers like 0.8. Unfortunatly we can only pick Integers ( MI, XI..) and longs (ML, XL..) in every function block we tried. How can we store doubles? Thank you very much! Quote Link to comment Share on other sites More sharing options...
MVP 2022 Flex727 Posted February 25, 2020 MVP 2022 Report Share Posted February 25, 2020 What do you mean by "store"? Where are you trying to store the number? What is the source of the number? What are you trying to do exactly? Floating point number operands are available (MF operands), but they are separate from the normal math and store functions. You can find them under Math / Float. However, depending on what you're trying to do, you should keep the number as an integer while keeping track of the implied decimal location within your logic. For a number like 6.2, just multiply by 10 and store it as 62. You can display it properly on the HMI without any further 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.