Reading a negative number

jvfred
2025-05-22
2025-05-28
  • jvfred - 2025-05-22

    I have a Codesys-based Eurotherm E+PLC400 connected to Codesys HMI SL for visualization. I am also bringing in several Pressure Indicators via the Ethernet. Everything works; however, the Pressure indicators sometimes read a negative value. When they do, the displayed value on the screen reads "65532." While I know what it represents, the customer freaks out and wants it to read "0" or a negative number. The value comes in as an integer, just in case that matters. Does anyone have any ideas?

     
  • dkugler - 2025-05-28

    why not simply converting data type UINT to INT?
    Then avoid negative values with ... := MAX(0 , intTest);

    Good luck!

     

Log in to post a comment.