ModbusTCP is a feature on our Color Control GX, and also the [Venus GX](https://www.victronenergy.com/panel-systems-remote-monitoring/venus-gx). ModbusTCP is an industry standard protocol, that can be used to interface PLCs or other equipment with Victron products. For example to enable a heat pump when there is excess solar power, or create a fully integrated glass bridge on a yacht.
Besides reading this FAQ, make sure to also read the ModbusTCP section in our Data communication whitepaper.
The supported function codes are:
Note that there is no difference between function code 3 and 4.
|0x01||IllegalFunction||The requested function is not supported|
|0x02||IllegalDataAddress||The unid it is available, but one or more of the requested register(s) do not exist|
|0x03||IllegalDataValue||The requested quantity of registers is invalid. See the modbus specs, http://www.modbus.org/specs.php, for the limits per function code|
|0x0A||GatewayPathUnavailable||Unit id is defined in the mapping list, but there is no device found on the mapped port. double check the unit id mapping list in the excel sheet, and make sure that the device is properly connected to the CCGX, switched on, and that its data is available on the CCGX display.|
|0x0B||GatewayTargetDeviceFailedToRespond||Requested unit id not found in the mapping list, double check the unit id mapping list in the excel sheet|
The purpose of this example is to show how to interpret the information in the worksheets of the excel sheet containing the modbustcp mapping. This excel sheet is available for download from our website on the Color Control page.
To request the input voltage of a Multi or Quattro, connected to the VE.Bus sockets on the CCGX, use the following settings: unit-id 246, and set the data address of the first request register to 3.
The ModbusTCP reply will contain 2302. Divide it by 10, as specified in cell E3, and then you have the voltage: 230.2 Volts AC.
By default, ModbusTCP is disabled. To enable it, go into the settings menu, scroll down to 'Services', and then enable the ModbusTCP service.
The unit id, sometimes called ‘slave address’, specifies what product connected to the CCGX needs to be addressed. See the tab ‘Unit ID mapping’ tab in the Modbus-TCP excel sheet.
All products that can be connected to the Color Control GX.
Yes, you can! Though make sure not to include non existing registers in your query. Querying register 1 to 100 for example will not work, since registers 1 and 2 do not exist.
Yes, you can! We are, slowly, making the Color Control code open source, and the Modbus-TCP sources are already available on https://github.com/victronenergy.
You cannot interface to them individually if they are configured to be in parallel or as a three phase system. Note that is also not necessary to address the units individually, since ModbusTCP provides system totals as well as per phase information.
Only for vedirect Devices via USB it can change. But even then our experience is that it only changes in the first reboot.
Unit ids of products not connected via USB will not change.
In case all unit-ids and register addresses have been checked and double checked, and still it doesn't work, you could try looking at the modbustcp log file on the Color Control GX.
cat /log/dbus-modbustcp/current | tai64nlocal
In case of any errors, the output will look like this:
2016-01-08 16:34:24.658248500 INFO 2016-01-08T16:34:24.657 [Server] New connecion: "18.104.22.168:41792" 2016-01-08 16:34:24.695846500 ERROR 2016-01-08T16:34:24.689 "Error processing function code 3, unit id 247, start address 258, quantity 42 :" "Unit id is available, but start address does not exist" 2016-01-08 16:34:24.753921500 INFO 2016-01-08T16:34:24.753 [Server] Disconnected: "22.214.171.124:41792"
In most cases there is a problem in either unit ids or the register addresses. Double check the numbers shown in the output with the numbers as used in your modbustcp software or PLC.
Yes. See the Hub-4 advanced control manual for more details.