Jump to content

help converting to unitronics v280 (flowmeter)

Recommended Posts

Gee, I hate to sound smug, but this seems like some situations I've dealt with back when I was still working...
I'd spend days trying to show someone how to deal with something, but in the end, the problem was;

they were not sharp enough to realize that they didn't understand what they did not know, so therefore they couldn't know what they didn't understand and could not realize where the problem really lay....

Pedro, please do your homework first, then come asking questions...😳

Link to comment
Share on other sites

  • MVP 2023

This discussion is actually kind of funny.

@Pedro Borges - you're trying to get someone to say "Yes and here's how" to an impossible question.   You really, really want to do something that can't be done.

By definition, an integer such as a DW, ML, or MI  CAN NOT CONTAIN AN ACTUAL DECIMAL POINT.  The value in the integer can be 10, 100, or 1000 times bigger than the same number you might see on your calculator, but as Fernando pointed out those are Floating Point numbers, which are very different as far as a computer is concerned.

You'll sleep easier if you just accept you're going to have to divide by 10 in the SCADA system and write the result to a REAL data type.

Joe T.

Link to comment
Share on other sites

On 4/16/2022 at 2:36 PM, Pedro Borges said:

thanks,  but this variable also goes to the Scada 

SCADAS aslo doenst like floats 😂 usually an integer Is sent and the decimal place is shifted, just because flat types uses more memory, for example  in binary form:

 0.1 = 0.000110011001100110011001101 this one needs 32 bits to be stored

    1 =  1  this one needs1 bit to be stored



Inside the computer, most numbers with a decimal point can only be approximated; another number, just a tiny bit away from the one you want, must stand in for it. For example, in single-precision floating-point, 0.1 becomes 0.100000001490116119384765625. If your program is printing 0.1, it is lying to you; if it is printing 0.100000001, it’s still lying, but at least it’s telling you you really don’t have 0.1.

Decimal to Floating-Point Converter - Exploring Binary

In your application I feel like you don't need to use floats, but you do you

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.

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