Ayoub Posted March 20, 2018 Report Share Posted March 20, 2018 Hello, it's my first time working with Visilogic and I do not know how to display a float number with a precision of 2 digits after the decimal point. I have already found that this question has been asked by someone else who has been advised to use ASCII to Num, I tried to do it but I did not get there. can you help me, please ? and thank you in advance Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted March 20, 2018 MVP 2023 Report Share Posted March 20, 2018 You actually do Num->ASCII first. Post the PLC program containing what you've tried so we can get an idea of where you're starting and the magnitude of the floating point numbers. Joe T. 1 Link to comment Share on other sites More sharing options...
Ayoub Posted March 21, 2018 Author Report Share Posted March 21, 2018 Hi, my program is used to convert bits to decimal based on the linear curve (0 - 1023) bits and display it in a numeric variable. Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted March 21, 2018 MVP 2023 Report Share Posted March 21, 2018 You're certainly going about this the hard way. Use a linearization function block to linearize MI 11 to 0-100, placing the result in another MI. You can then show the voltage to one decimal place using an HMI numeric display. If you want two decimal places, linearize from 0-1000 instead of 0-100. There is no need to use an MF here. 1 Link to comment Share on other sites More sharing options...
Ayoub Posted March 21, 2018 Author Report Share Posted March 21, 2018 Thank you very much, Sir, you have helped me a lot, just one thing I want to understand the logic of the positioning of the point, for example, if I want to display X, XX or XX, X how this logic works Link to comment Share on other sites More sharing options...
MVP 2023 Flex727 Posted March 21, 2018 MVP 2023 Report Share Posted March 21, 2018 Displaying an integer on screen uses "implied decimals". Near the middle of the Numeric Variable above you'll see a setting for the number of decimal places. In the picture above you'll see 2.1 (look just to the right of "Base Format:"). If you want to display a 3 digit number with 2 decimal places, you would use 3.2. The number 26451 would be displayed as 264.51. By doing your linearization from 0-100 for the 0-10 volt analog input, you don't have to multiply by 10 to get one decimal place of precision. Feel free to ask more questions, if needed. 1 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now