Results 1 to 5 of 5

Thread: Issues Displaying REAL variables

  1. #1
    Join Date
    May 2009
    Posts
    87

    Default Issues Displaying REAL variables

    I'm running into a problem displaying REAL variables on a Cr1083. I'm trying to display supply voltage (using system variable SUPPLY_VOLTAGE) to one decimal place (xx.x). Using the same software, the value is displayed correctly on some Cr1083s, but not on others (I’ve had the same issue with Cr9042s also). The value always reads correctly when viewing it in the CoDeSys software while online. On units where it doesn't display correctly, it displays the value to about 5 or 6 decimal places.

    I’ve tried using the SET_PRECISION & SET_TRUNC functions posted on the forum with no success. Re-loading firmware seems to be the only way to correct this issue, which is a hassle & not something I want our customer having to do on a regular basis.

    Any advice or suggestions on how to rectify this issue would be greatly appreciated. Thanks.

  2. #2
    Join Date
    Sep 2010
    Location
    Burnsville, Minnesota
    Posts
    41

    Default

    Are you using %2.1f instead of %s to display the variable?
    David Grambsch
    Automation Controls Engineer

    FORCE America Inc.
    www.forceamerica.com

  3. #3
    Join Date
    May 2009
    Posts
    87

    Default

    I'm using %s in a REGULAR ELEMENT. It shows up fine on probably 75% of the displays I load the software into, which leads me to believe that it's not a software problem.

  4. #4
    Join Date
    May 2009
    Location
    Minneapolis, MN
    Posts
    299

    Default

    Chris you will need to have the element displayed as %2.1f like David said.

  5. #5
    Join Date
    May 2009
    Posts
    87

    Default

    Gentlemen,
    Thanks for the feedback. Using %2.1f seems to have solved the problem. Any thoughts on why the issue wasn't being consistently seen? Thanks again.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •