title: modbus TCP server with data from SQL-query using pymodbus
body: <p>I need to make a SQL_to_Modbus TCP server. I looked at the <a href="https://pymodbus.readthedocs.io/en/latest/source/example/payload_server.html" rel="nofollow noreferrer">https://pymodbus.readthedocs.io/en/latest/source/example/payload_server.html</a> example, but I'm not sure that I understand correctly how to organize the transfer of data from the database to the modbus registers. The data changes dynamically and every master must be able to receive this data. I would be very grateful if you could tell me where in the code I should execute the SQL-query, get the data set and fill the server registers with them. Probably, this code should be executed in parallel with the main one and use synchronization?</p>