EscanabaYooper Posted May 18, 2018 Report Share Posted May 18, 2018 I admit to being a VisiLogic noobie, but have run into an Error 39 (Mismatched Register Types: Num To Ascii) when compiling. It points to this element as being the problem. What is the problem? Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted May 18, 2018 MVP 2023 Report Share Posted May 18, 2018 This block requires an ML or MI as the source register (A). An MF uses a different data format. What exactly are you trying to do? Joe T. Link to comment Share on other sites More sharing options...
EscanabaYooper Posted May 21, 2018 Author Report Share Posted May 21, 2018 Thanks, but the drop down list for A allows a float to be selected along with any of 10 other types. With my limited experience in VisiLogic, I have noticed non-acceptable data types do not appear in the drop down lists. Is this a bug? I have a function which results in a float, MF0. I am simply trying to convert it to a string to be displayed on the HMI. Link to comment Share on other sites More sharing options...
MVP 2023 Joe Tauser Posted May 21, 2018 MVP 2023 Report Share Posted May 21, 2018 You can display a float directly on the HMI, but when you do this you can't control the decimal point. Many people don't like this, but that's how it works right now. I must admit I've never tried converting a float to ASCII. I tried dropping a block into a program to reproduce the compile error. I tried playing with different values in the block, which is what I would encourage you to do. The Help is pretty light on this block. I have not tried downloading it yet, but this did not result in a compile error: Try different things on your end and let us know what you find. Joe T. Link to comment Share on other sites More sharing options...
sgull Posted May 21, 2018 Report Share Posted May 21, 2018 Hi I have used this many times with an MF as the input. Try changing C to Float. You should also be triggering an MB after the conversion is done (just attach it to the right hand side of the function block) You will need this MB when displaying on the screen. The values I have used with success are as follows. A=MF, B= Constant 6, C= float, D= constant 0, E= Constant 2, F=MI Regards Denis Link to comment Share on other sites More sharing options...
EscanabaYooper Posted May 23, 2018 Author Report Share Posted May 23, 2018 Thank you very much sgull. Changing C to float took care of the error! Link to comment Share on other sites More sharing options...
MPetrov Posted December 13, 2023 Report Share Posted December 13, 2023 I found way to do it. Using INV(A+B/n), MUL, DEV and A+B/n blocks. You can see the picture from the following link: https://ibb.co/Dfvh0j7 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