drr Posted December 11, 2017 Report Share Posted December 11, 2017 Hi. I have a doubt about the number of decimals with Numeric Controls. I need to be able to change the number of decimals in this controls, because sometimes a control must allow only one decimal, two decimals or no decimal in the same control, is this possible? how can I achieve this behaviour? Quote Link to comment Share on other sites More sharing options...
MVP 2022 Flex727 Posted December 11, 2017 MVP 2022 Report Share Posted December 11, 2017 Can you clarify exactly what you're trying to do? Quote Link to comment Share on other sites More sharing options...
drr Posted December 12, 2017 Author Report Share Posted December 12, 2017 Sorry for my English My device is a SAMBA SM43-J-RA22. I'm making a recipe application. In this application the user can enter the weight for an ingredient in a Numerical Control. I want the user to be able to enter a limited number of digits in the decimal part of the Numerical Control. This limitation of the number of digits will be configured in another part of the application. For example: 12 <- numerical control set without decimals 12.2 <- numerical control set with 1 decimal 12.15 <- numerical control set with 2 decimals How I can achieve this? Quote Link to comment Share on other sites More sharing options...
MVP 2022 Flex727 Posted December 12, 2017 MVP 2022 Report Share Posted December 12, 2017 You can't change the number of implied decimals on a numeric input at run time. Just set the numeric input for the maximum number of decimals and the user can input only the needed decimals. If the input is set for 2 implied decimals and the user only inputs 12.2, the correct value will go into the PLC (in this case 1220). As always, you need to do the math to handle the implied decimals. 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.