How to read data from Solar Inverter or Meter on a Windows PC
In this blog, we are going to describe how to poll data from any Modbus device (slave) on the pc/laptop (master).
Modbus Slave= Device from which data is to be requested
Modbus Master= Device on which data is to be seen (Windows PC)
Step-1 Gather supplies
Things required to communicate with Inverter or any other modbus based device are as following:
- Cable for connecting to the device. Modbus RTU (RS485)-USB to RS485 connector with 2 core wire. Link
- Driver of the above cable which is generally supplied with wire in CD or can be searched online.
- PC based Modbus Simulator Software. You can try Modscan at this link
Using this tool, you can query the value of a register from your Modbus Slave. - Modbus register mapping (communication protocol) of the slave device.
Step-2 Connect the laptop to Slave
Connect the USB to Modbus cable with the Slave. (Example – Connect A pin to RS485A port on slave and B Pin to RS485B port on slave)
Step-3 Completing Setting in Slave
Set following communication settings in slave
Modbus ID/Address – 1
Baud Rate-9600
Protocol- Modbus RTU/RS485
Detailed screen by screen settings manual is available at this link
Step-4 Installing Drivers
Install driver of the cable used for connecting PC/Laptop to Slave
(Driver CD is generally provided sold with the connector or available online)
If you have purchased the USB to RS485 cable from above link then use this driver. Link
Once driver is installed correctly identify the COM port on which the USB is connected.
Step-5 Polling data from Slave
1) Open modbus simulator downloaded above to query the inverter
2) Click on Connect as shown in figure:
3) Select the COM port as identified in step-4
4) Leave the default settings unchanged. These are the same settings which we completed in inverter in step-3
5) Enter the modbus register and total no. of parameter you wish to read.
For example for Sungrow 50kW Inverter,Address 5036 with input register 04 corresponds to Grid Frequency with factor 0.1 Hz