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?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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?
why not simply converting data type UINT to INT?
Then avoid negative values with ... := MAX(0 , intTest);
Good luck!