ccgx:modbustcp_faq
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
ccgx:modbustcp_faq [2018-03-21 09:20] – mvader | ccgx:modbustcp_faq [2023-10-31 10:32] (current) – jpasop | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== |
- | ==== Introduction ==== | + | ==== 1. Introduction ==== |
- | ModbusTCP | + | Modbus-TCP |
- | Besides reading this FAQ, make sure to also read the ModbusTCP section in our [[https:// | + | Modbus-TCP is an industry standard protocol, that can be used to interface PLCs or other third party equipment with Victron products. Through the Modbus-TCP interface you can read and write data to the chargers, battery monitors, inverter/chargers and other products connected to the GX device. |
- | ==== Supported ModbusTCP function codes ==== | + | Besides reading this GX Modbus-TCP Manual, make sure to also read the Modbus-TCP section in our [[https:// |
- | The supported function codes are: | + | By default, Modbus-TCP is disabled. To enable it, go into the settings menu, scroll down to ' |
- | * ReadHoldingRegisters = 3 | + | |
- | * ReadInputRegisters = 4 | + | |
- | * WriteSingleRegister = 6 | + | |
- | * WriteMultipleRegisters = 16 | + | |
- | Note that there is no difference between function code 3 and 4. | + | ==== 2. Addressing, Unit-ID and Registers ==== |
- | ==== Product categories and registers ==== | + | === 2.1 Definitions |
+ | The Modbus-TCP protocol has two fields for addressing. There is the Unit-id, also referred to as Address, Station address or Slave-address in some PLC software. And the other field is the Register address. | ||
- | In the ModbusTCP Registerlist xlsx file, there is a column called 'dbus-service-name' | + | * The **Unit-ID** is the device-selector: |
+ | * The **Register Address** then determines the parameter | ||
- | Note that, besides device specific | + | === 2.2 Unit-IDs === |
+ | |||
+ | To see a list of available devices, and their Address, go to Settings -> Services -> Modbus/TCP -> Available services: | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | Additionally this information is also documented on the ‘Unit ID mapping’ tab in the Modbus-TCP excel sheet. | ||
+ | |||
+ | For the overall system data, look for com.victronenergy.system in the excel sheet, and use Unit-ID 100. | ||
+ | |||
+ | Note that both Unit-ID 0 and Unit-ID 100 map to the same internal address. We recommend to use ID 100, since many Modbus-TCP clients and PLCs do not work with ID 0. | ||
+ | |||
+ | === 2.3 Register addresses === | ||
+ | |||
+ | The list of available | ||
+ | |||
+ | Besides registers for connected Chargers, Inverters, and other products, there is also a set of registers that represent the entire system: com.victronenergy.system. This service is also where the //System Overview// pages in the GUI, and the VRM Dashboard get their data. | ||
+ | |||
+ | Note that not all list registers are available for each device. For example a BMV Battery Monitor has lots of readings: historical data such as maximum/ | ||
+ | |||
+ | Use this table to map the definition in the ' | ||
^ Device class ^ Product types ^ Registers | ^ Device class ^ Product types ^ Registers | ||
Line 32: | Line 50: | ||
| com.victronenergy.grid | Energy meters configured to measure the grid | 2600 to 2609 | | | com.victronenergy.grid | Energy meters configured to measure the grid | 2600 to 2609 | | ||
| com.victronenergy.gps | GPS | 2800 to 2807 | | | com.victronenergy.gps | GPS | 2800 to 2807 | | ||
+ | | com.victronenergy.tank | Tank sensors | 3000 to 3007 | | ||
| com.victronenergy.genset | Generators | | com.victronenergy.genset | Generators | ||
- | | com.victronenergy.temperature | Temperature sensors (1) | 3300 to 3305 | | + | | com.victronenergy.temperature | Temperature sensors |
+ | | com.victronenery.meteo | IMT solar irradiation sensors | 3600 to 3603 | | ||
- | (1): There are only the temperature | + | (1): These are the auxiliary |
- | General note: not all list registers are available for each device. For example a BMV Battery Monitor has lots of readings, including the history such as max battery voltage, min battery voltage and-so-forth. A canbus connected lithium battery might not have those parameters available. | + | ==== 3. Supported Modbus-TCP function |
- | ==== Error codes ==== | + | |
- | ^Code^Name^Description^ | + | The supported |
- | |0x01|IllegalFunction|The requested | + | * ReadHoldingRegisters = 3 |
- | |0x02|IllegalDataAddress|The unid it is available, but one or more of the requested register(s) do not exist| | + | * ReadInputRegisters = 4 |
- | |0x03|IllegalDataValue|The requested quantity of registers is invalid. See the modbus specs, http:// | + | * WriteSingleRegister = 6 |
- | |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, | + | * WriteMultipleRegisters = 16 |
- | |0x0B|GatewayTargetDeviceFailedToRespond|Requested unit id not found in the mapping list, double check the unit id mapping list in the excel sheet| | + | |
+ | Note that there is no difference between function code 3 and 4. | ||
- | ==== Mapping example ==== | + | ==== 5. Mapping example ==== |
The purpose of this example is to show how to interpret the information in the worksheets of the | The purpose of this example is to show how to interpret the information in the worksheets of the | ||
- | excel sheet containing the modbustcp | + | excel sheet containing the Modbus-TCP |
- | To request the input voltage of a Multi or Quattro, connected to the VE.Bus sockets on the CCGX, use the following settings: | + | To request the input voltage of a Multi or Quattro, connected to the VE.Bus sockets on the GX device, use the following settings: |
- | The ModbusTCP | + | The Modbus-TCP |
- | ==== Enabling ModbusTCP on the CCGX ==== | + | ==== 6. Error codes and trouble shooting |
- | By default, ModbusTCP is disabled. To enable it, go into the settings menu, scroll down to ' | + | |
- | ==== What is a unit id and what do I need to set it to? ==== | + | === 6.1 The common cause: Unit-ID / Register combination |
- | 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. | + | |
- | ==== Which products can be interfaced via Modbus TCP? ==== | + | In case a certain read or write is not successful, most likely there is an issue in the unitid/ |
+ | |||
+ | Besides double checking the mapping, there are two ways to see where the error lies. One is to check the last error as shown in the GX Device menus. And secondly you can look at the error code as is visible on (most but not all) PLCs. See the two sections below for details. | ||
+ | |||
+ | === 6.2 Looking up the last Modbus-TCP Error on the GX Device=== | ||
+ | |||
+ | To see why a certain register is not available, use the Settings -> Services -> Modbus-TCP menu. It shows the last error, and reason for that error. | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | === 6.3 Error codes === | ||
+ | |||
+ | These error codes are returned by our software to the PLC; and most PLC software tools allow seeing them. | ||
+ | |||
+ | ^Code^Name^Description^ | ||
+ | |0x01|IllegalFunction|The requested function is not supported.| | ||
+ | |0x02|IllegalDataAddress|The requested Unit-ID is available, but one or more of the requested register(s) does not exist.| | ||
+ | |0x03|IllegalDataValue|The requested quantity of registers is invalid. See the modbus specs, http:// | ||
+ | |0x0A|GatewayPathUnavailable|The requested 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 GX device, switched on, and that its data is available on the GX device display.| | ||
+ | |0x0B|GatewayTargetDeviceFailedToRespond|Requested Unit-ID not found in the mapping list. Double check the Unit-ID mapping list in the excel sheet.| | ||
+ | |||
+ | |||
+ | ==== 7. Support ==== | ||
+ | |||
+ | The recommended method for support on Modbus-TCP questions is to use the [[https:// | ||
+ | |||
+ | Direct company support is only offered on a limited basis. For such support, contact our Victron representative. | ||
+ | |||
+ | ==== 8. FAQ ==== | ||
+ | |||
+ | === Q1: Which products can be interfaced via Modbus-TCP? === | ||
All products that can be connected to the [[https:// | All products that can be connected to the [[https:// | ||
- | ==== Can I change a configuration setting in a Multi, for example the absorption voltage? | + | === Q2: Can I change a configuration setting in a Multi - for example: the absorption voltage? === |
No. | No. | ||
- | ==== Can I request multiple registers at the same time? ==== | + | === Q3: Can I request multiple registers at the same time? === |
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! 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. | ||
- | ==== Can I implement more features myself? | + | === Q4: Can I implement more features myself? === |
Yes, you can! We are, slowly, making the Color Control code open source, and the Modbus-TCP sources are already available on https:// | Yes, you can! We are, slowly, making the Color Control code open source, and the Modbus-TCP sources are already available on https:// | ||
- | ==== In a parallel or three phase system, how can I address a single unit? ==== | + | === Q5: In a parallel or three-phase system, how can I address a single unit? === |
- | You cannot interface | + | You cannot interface |
+ | === Q6: Will unit-id' | ||
- | ==== Will unit ids change after a reboot or loss of power? ==== | + | No. |
- | + | ||
- | 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. | + | === Q7: Advanced debugging === |
- | ==== Advanced debugging ==== | ||
- | In case all unit-ids and register addresses have been checked and double | + | If all unit-id' |
- | Steps: | + | Follow these steps: |
- | - Enable SSH | + | - [[ccgx: |
- | - Login, use for example Putty in windows, | + | - Login with SSH (use for example Putty in Windows - or simply type //ssh root@[ip address here]// |
- List the latest log file:< | - List the latest log file:< | ||
- | cat / | + | cat /var/ |
</ | </ | ||
Line 101: | Line 148: | ||
2016-01-08 16: | 2016-01-08 16: | ||
- | 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 | + | In most cases the problem |
+ | |||
+ | === Q8: Does Modbus-TCP support ESS? === | ||
+ | |||
+ | Yes. See the [[https:// | ||
- | ==== Does Modbus TCP support Hub-4? ==== | ||
- | Yes. See the [[https:// | ||
- | ==== Disqus ==== | ||
- | ~~DISQUS~~ |
ccgx/modbustcp_faq.1521620410.txt.gz · Last modified: 2018-03-21 09:20 by mvader