Jump to content

Mismatched Register Types: Num To Ascii


Recommended Posts

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

  • MVP 2023

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:

image.png.20ba5d7a171cb3562a1e981567cb98c4.png

 

Try different things on your end and let us know what you find.

 

Joe T.

Link to comment
Share on other sites

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

  • 5 years later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

This site uses cookies. By clicking I accept, you agree to their use.