Announcement

Collapse
No announcement yet.

Decimal Places in Data View

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Decimal Places in Data View

    Hello,

    I have a floating point tag that increments periodically by a rate of 0.01 on a P1-540.

    When I bring this tag up in data view to monitor it for testing, it shows the rounded tag value, without the decimal place. I know it is still keeping track of the decimal in the background because it outputs to modbus correctly, but there doesn't appear to be a way to monitor the tag value to a precision of 0.01 within the productivity suite.

    Am I missing something obvious, or is live monitoring not possible at 0.01 precision?

    Thanks
    FF

  • #2
    Hmm.

    It seems like the P1-540 has a problem with floating point math altogether. The Inc/Dec block doesn't appear to support increments of 0.01, and the math block doesn't appear to support addition of 0.01. Is there something else I should be using for this?

    I've band-aided it to work by incriminating an integer by a whole number, then dividing by 100, but I was hoping for something more elegant than that.

    Comment


    • #3
      0.01 isn't an available Floating point number. 0.00999999977648258209228515625 is the closest equivalent number that follows the IEEE-754 standard.

      There are 32 bits to represent an infinite series of numbers. Something has to give. To see how it works take a look at this calculator: https://www.h-schmidt.net/FloatConverter/IEEE754.html
      If you have an urgent issue, please contact AutomationDirect's Technical Support team.

      AutomationDirect.com Technical Support: 1(800) 633-0405 or (770) 844-4200 Email Tech Support

      Comment


      • #4
        I have no problem making a P1k program right now and setting up a math block to add 0.01 to a FP32 tag each time it is enabled, and then seeing the changes as it adds 0.01 to the tag each cycle. It displays everything and does the addition just fine

        If I had to guess, I would bet you are using a tag that is INT32 rather than FP32. Even tags with 0 or just created tags always show 0.0 in data view if they are floating point tags.
        Attached Files
        Last edited by MikeN; 07-17-2019, 08:19 AM.

        Comment

        Working...
        X