Getting data from inverters via an RS485 connection

I have not been paying close attention to this topic, so I’m not sure what hardware you have. I think you have an inverter, and a datalogger that obtains data from your inverter and sends it somewhere. I think you want to also connect your Pi to the inverter to obtain the same or different data.

RS485 and Modbus are two completely different things that can be used together. Modbus is a communications protocol that works by having a Master that controls the bus (in this case the bus wiring and signal levels are RS485) and slave devices that respond when told to do something.

If the inverter and data logger can work together, one of them is a Master. If the Pi and the inverter can work together, one of those two is a master. Because you give the Pi a list of devices, the Pi must be the master in that case. The question is, which of the two, inverter or datalogger, is the master in that setup? I think it must be the datalogger, because from everything I’ve seen, it’s not the inverter (and it doesn’t make sense for it to be the inverter, whereas having the datalogger as the master makes a lot of sense to me - it can log any number of inverters on the same bus).

So, if I’m correct, I think you could solve the problem in one of two ways: Either, because you know how often the datalogger requests data, your Pi could wait and listen on the bus for the logger’s request and the inverter’s answer, then it could send its own request to the inverter. That isn’t how the bus is supposed to work, but I think that is almost what you are doing now - except your Pi isn’t waiting for the other transaction to happen. The other way would be if the datalogger could be turned into a slave device and logged data when told to. In that case, you’d need your Pi to be the bus master, it would get all the data from the inverter, then send whatever you wanted logging to the data logger with the instruction to log it. Whether either of these are possible with the software you have, I don’t know. It might need completely new software, even if the hardware (the datalogger and the Pi) can operate in the way you need them to.