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...

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.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...