HCBBS Forum (English)
Submit Chemical Projects / Find Solutions
Amplify Your Requirements on a Broader Chemical Platform *Engineering · Technology · Equipment · Solutions*
Submit Request

Questions about Modbus communication

2024-09-19View Original

Thread Content

01 is the slave station address; 03 is the Modbus function code ; 04 is the length of the data bytes to be read ; 010F represents temperature data; after converting it to decimal form, it is divided by 10 to obtain the actual temperature value ; 0216 represents the humidity data; after converting it to decimal form, it is divided by 10 to obtain the actual humidity value. My question is: why do we divide the actual value by 10? ? ? Could any expert please give me some guidance? Thank you very much
Reply #22024-09-19
In Modbus communication, temperature and humidity data are usually transmitted as integers; therefore, a way is needed to represent decimal numbers. Here, the actual measured values are multiplied by 10 before transmission; upon receipt, the receiving end divides the data by 10 to restore them to their original form with decimal points. This is done to maintain data accuracy while avoiding the use of floating-point numbers, as processing integers is more efficient in some systems than processing floating-point numbers. Therefore, the division by 10 here is meant to restore the data that has been adjusted due to transmission format limitations back to their original measured values. .
Reply #32024-09-20
You need to ask what format the sender uses for output; as for how to find this information on forums, it’s usually to achieve a precision of one decimal place.
Reply #42024-09-20
The sender has been expanded by 10 times; data conversion is performed for transmission
Reply #52024-09-22
The PLC won’t work; it’s rather outdated
Reply #62024-09-25
In many industrial devices and sensors, the transmitted values are often amplified or scaled to facilitate digital signal processing. For example, the actual values of temperature and humidity might be decimal numbers; however, to simplify processing, they are multiplied by 10 or 100, etc., during transmission. This approach ensures that the data transmitted are all integers, thereby improving the stability and accuracy of data transmission. In your example, the temperature and humidity data are scaled before transmission; upon receiving these values, the receiver performs the corresponding division operation to obtain the actual physical quantities. For example, the temperature data 010F (in hexadecimal) converts to 271 in decimal; dividing this by 10 gives 27.1°C. The humidity data 0216 (in hexadecimal) converts to 534 in decimal; dividing this by 10 yields 53.4%. This design is generally intended to ensure the accuracy and integrity of data, while also reducing errors during transmission.
Reply #72024-09-28
This division by 10 has nothing to do with your slave station. The root cause lies in your upper-level host station; after the register addresses in the host station collect the readings from the sensors, it fails to perform any computational processing, or the data type transmitted to you is problematic.
Reply #82024-09-30
When converting decimal and binary decimals to each other, infinite repeating decimals may occur, leading to rounding errors during transmission. This problem can be avoided by multiplying by 10 before sending the value if only one decimal place is required, and then dividing by 10 after it is received.
Reply #92024-10-03
You can also use floating-point numbers to represent temperature and humidity; in that case, 4 additional bytes are needed. Alternatively, you can use values ranging from 0 to 27648, as done by Siemens. This doesn’t change the number of bytes transmitted, but it makes processing more complicated. The sender must calculate a value within the range of 0 to 27648 based on the upper and lower limits of the actual temperature and humidity values, which introduces a slight error. The receiver then has to perform inverse calculations to obtain the actual values. Since temperature and humidity only need to be precise to one decimal place, multiplying by 10 yields an integer; a two-byte signed integer can represent integers ranging from -32768 to 32767, providing a wide range of values. If precision up to two decimal places is required, it can also represent values between -327 and 327. The experienced microcontroller technician at our factory built his own analog input modules and 485 serial port modules to transmit data to Zhejiang University’s DCS system. Represented as an unsigned integer, the temperature data to be transmitted is increased by 100 and then multiplied by 100; this allows temperatures ranging from -100 degrees to -500 degrees to be transmitted. For PT100, the maximum temperature is around three or four hundred degrees. At least -100 degrees is sufficient. Other engineering values can also be represented by numbers ranging from 0 to 10,000, which makes them easier to handle. Do it in the most convenient way possible. The Siemens temperature input module transmits a value to the CPU that is 10 times the engineering value

Submit a Project

**Looking for Chemical Technology, Equipment & Solutions?** No Registration Required Broader Platform Exposure | Global Chemical Service Provider Connections

Submit Request — Free Consultation

Disclaimer

This is an automated machine translation of the original thread. Some technical terms may have inaccuracies; the original text shall prevail. Click "View Original" at the top right to access the source page, which supports IP-based automatic real-time language translation. Please watch out for contact details and sales inducements to prevent fraud. All content and translations are for reference only, representing solely the poster's personal views. For enquiries, email service@hcbbs.com.