Write Float Values on Modbus Holding Register Address #1458
-
I know that modbus does not support floating, DINT and 32bits. I know that you can send a float and that it is possible, but that it is a bit tricky (I can see it myself), but in my project I have to send a float and read a float. I looked at the documentation and all kinds of videos and asked chatGPT, but now I'm slowly getting lost and writing nonsense. I just want to write 7.7 to PLC memory %MW1 (Real) and read from another register 3.3. I would be very grateful if you could give me a concrete answer, and not just 'read the documentation'. Please #Proba
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
The payload builder can do exactly what you need, however if you look at dev (as in not yet released) I have added convert_to_register and convert_from_register functions, that makes life very easy for you. |
Beta Was this translation helpful? Give feedback.
If you want to convert a float then use the appropriate datatype not INT16. set the number of registers in the call, and also set slave=.