This code uses pyModbusTCP library to communicate with a Modbus device, read input registers and then perform bit manipulation and conversion of the read values into floating-point numbers.
Regarding the experiments conducted with Modbus, an article has been published in the Sensors journal, evaluating the performance and usability complexity of various industrial protocols from a software perspective.
If you are planning to use this code, please cite us as: "Tapia, E., Sastoque-Pinilla, L., Lopez-Novoa, U., Bediaga, I., & López de Lacalle, N. (2023). Assessing industrial communication protocols to bridge the gap between machine tools and software monitoring. Sensors, 23(12), 5694."