Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and beauty - Why do some data processing in PLC programming need to be converted into floating-point numbers? What do floating-point numbers do? What does it have to do with integers?
Why do some data processing in PLC programming need to be converted into floating-point numbers? What do floating-point numbers do? What does it have to do with integers?
Don't read those jokes copied from the internet ~

In PLC and DCS, the conversion of floating point number is actually used for upper display, and an analog displayed on the upper screen must be floating point number, so that the operator can identify the size of the quantity.

Principle: Most on-site display instruments transmit 4-20am0-5F0- 10V. . . . And other signals, which are essentially an interval integer (int) and a number of 16 bits. The most significant bit of this number represents a symbol with 16 bits, and the other 15 bits represent integer display between 0 and 32768. According to the range comparison, reflect the actual value-for example, the set range of the liquid level meter is 6 meters. In fact, the 20Am received by PLC after A/D conversion is not 20Am, but 32768, which is an int number. If this int value is directly connected to the upper screen, the operator can't know how many meters of liquid level this number represents, and it needs to be converted into a number that the operator can recognize, so the range conversion occurs, and this int( 16 bits) is converted into a real number, that is, a floating point number (the above example can represent 32 bits, and the range from 4-20Am to PLC is 0-32768, and after conversion, it is 0-6 M).

Many PLC manufacturers do not necessarily use short segments between 0-32768, such as 0-27648 and so on.

If you don't understand the above, then you just need to remember that PLC processes data into floating-point numbers and displays them to operators. A floating-point number is a 32-bit number that can be expressed to decimal places, such as a liquid level of 5.3555 meters. As the name implies, integers can only be expressed as integer digits, but not as decimals (which is also an important reason for data processing).