Mare Posted May 26, 2012 Report Share Posted May 26, 2012 I need to cut some numbers after decimal point. example: MF1 = 34,4567890 I need to get MF1=34,45 How to do that Thanks Link to comment Share on other sites More sharing options...
Emil Posted May 27, 2012 Report Share Posted May 27, 2012 If you want it for HMI, you can use the function NUM to ASCII (Strings menu). There you can define the number of signs aftger DP. 1 Link to comment Share on other sites More sharing options...
Mare Posted May 28, 2012 Author Report Share Posted May 28, 2012 No Emil, not for HMI. I need this for siimple math function. I need just two numbers after decimal point . Link to comment Share on other sites More sharing options...
Emil Posted May 28, 2012 Report Share Posted May 28, 2012 Hi Mare, You "disapeared" for quite a long time! Nice to hear from you again! Frankly speaking, I don't understand what is the problem to have more digits during calculations. In my point of view - it just will give you more precision. Anyway... You can use the funciton INV (A + B/n) - VisiLogic > Math menu > Float > Convert. This will give the decimal part of the MF in ML register. Then you can divide this number by, I think 10,000. This will leave you only the first two digits (this divide is Integer). Then, you can use back the function A + B/n to return the converted value to MF register. Please tell me if this tip is helpful. 1 Link to comment Share on other sites More sharing options...
Mare Posted May 28, 2012 Author Report Share Posted May 28, 2012 Hello Emil, I'm hoping for an more easyest way,but now I see you suggest me the same process I allready done. The problem is in too few MF-s. I have just 24 Mf-s. I need more Mf-s with the same OPLC (V130). Nice to here you again too. I hope you come to Slovenija soon. .Say hello to Offir Levi from me. Link to comment Share on other sites More sharing options...
Emil Posted May 28, 2012 Report Share Posted May 28, 2012 Hi Marco, Small tip - you can keep MF in DT. Also you can copy bitmap of MF to DW, ML or even two MI. You canuse the function "Copy Memory (VisiLogic > Vector menu > Use offset). The value in integer register will be not readable, very different from the original one. but the bitmap will remain unchanged and in any moment you can use again Copy memory" to return it in opereative MF. 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