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? Quote Link to comment Share on other sites More sharing options...
MVP 2022 Joe Tauser Posted May 18, 2018 MVP 2022 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. Quote 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. Quote Link to comment Share on other sites More sharing options...
MVP 2022 Joe Tauser Posted May 21, 2018 MVP 2022 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. Quote 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 Quote 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! 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.