Jump to content

V700, MF, numeric indicator


Recommended Posts

Unitronics Vision ver. 9.8.65 build 0

Hi, everyone.

Faced the problem of floating point numbers. I tried to find a solution on my own - it didn’t work out. When outputting a floating point number to the HMI using the numeric indicator, at certain times the number goes beyond the indicator boundaries and is layered over the image, although this shouldn ’t happen. Image attached.

In the attached file, there are subroutines for processing the numeric indicator  variable 1 - MF24 (Flow_meter) and the variable 2 - 56 (Convert_ML_to_MF). At the same time, for the program " Convert_ML_to_MF " the signal comes from the weight module "IO_LC1" starting with ten thousand, comparable to grams, therefore the corresponding division. For the subroutine  " Flow_meter "   the impulse weight from the panel is set, for example  the process in the picture is set to 0.1, which is always multiplied by an integer. Аccordingly, there should never be more than one number after a point, the less it is.
Also, i have a video changing MF in motion, if someone want to see - i can send)

ec098b3e-af1b-4863-bebe-9b79fef0bdbb.jpg

Example.vlp

Link to comment
Share on other sites

  • MVP 2023

I don't see a good reason for using floating point in your application. Just use integer with implied decimal. You can display an integer on screen with the correct number of decimal places. Just do integer math, keep track of where the decimal goes, multiply or divide by 10 (or 100, etc) as needed, and display it accordingly.

Link to comment
Share on other sites

Operator should be able to change the number of decimal places from HMI, and in the case of an integer type  with implied decimal, as I understand it, there will always be zero instead of empty space. Or i'm wrong? 
It's a good way to avoid the problem, but i have 19 similar programs in which the algorithms change a little and everywhere I used MF.  If no one has faced such a problem when using MF, then maybe I have an error somewhere. But if there is such a mistake and it isn't solved, then it should be announced about it.

Link to comment
Share on other sites

  • MVP 2023
On 10/10/2018 at 7:20 AM, Bohdan said:

If no one has faced such a problem when using MF,

Unitronics is well aware of this "mistake". 

Everyone who has put MF values on a display has faced this problem in UntronicsLand.  I've run into the problem with competitor's HMI products as well.  The nature of a IEEE floating point value is you can't easily extract the location decimal point  and the number of significant for display.

image.png.58e928bb19ff4809acc80a9fdfae279a.png

True, you could theoretically  create an object that could extrapolate the decimal via code.  But then what would you do if the float became large or small enough that an exponent was required?  What if the exponent needed to be negative?  

Anyway, the Vision series has never promoted itself as a floating point powerhouse - you can tell because there are only 64 of this memory type.  Unitronics will not be improving this product line's functionality significantly - the focus is on UniStream now.

 

On 10/10/2018 at 7:20 AM, Bohdan said:

but i have 19 similar programs in which the algorithms change a little and everywhere I used MF. 

I feel your pain on this and have banged my head against that wall.  But the problem is still there.  I would advise you to go back and revisit the algorithms using MI's or ML's, especially if displaying the output value is required.

 

Joe T.

  • Like 1
Link to comment
Share on other sites

On 10/14/2018 at 10:20 PM, sgull said:

It may help you achieve what you want.

yeah, it helped. This is the best way to solve this problem. Only in this case, if I need precision in integers (without characters after the decimal point and itself decimal point), it will still display "0" after the  decimal point . But i think customer will accept it)
Thanks for the advice!

Link to comment
Share on other sites

On 10/13/2018 at 11:03 PM, Joe Tauser said:

Anyway, the Vision series has never promoted itself as a floating point powerhouse - you can tell because there are only 64 of this memory type.  Unitronics will not be improving this product line's functionality significantly - the focus is on UniStream now.

Thanks for the detailed explanation! Maybe i will discover UniStream for myself soon, and i hope it has more functionality.

Link to comment
Share on other sites

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