ccgx:modbustcp_faq
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
ccgx:modbustcp_faq [2019-03-03 08:10] – [Introduction] mvader | ccgx:modbustcp_faq [2019-12-23 11:41] – [7. Trouble shooting] mvader | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== ModbusTCP | + | ====== |
- | ==== Introduction ==== | + | ==== 1. Introduction ==== |
- | ModbusTCP is a feature on our [[venus-os: | + | ModbusTCP is a feature on our [[venus-os: |
- | Through the ModbusTCP interface you can read and write date to the chargers, battery monitors, inverter/ | + | ModbusTCP is an industry standard protocol, that can be used to interface PLCs or other third party equipment with Victron products. |
- | Besides reading this FAQ, make sure to also read the ModbusTCP section in our [[https:// | + | Besides reading this GX ModbusTCP Manual, make sure to also read the ModbusTCP section in our [[https:// |
- | ==== Supported | + | By default, |
- | The supported function codes are: | + | ==== 2. Addressing, Unit-ID and Registers ==== |
- | * ReadHoldingRegisters | + | |
- | * ReadInputRegisters | + | |
- | * WriteSingleRegister | + | |
- | * WriteMultipleRegisters | + | |
- | Note that there is no difference between function code 3 and 4. | + | === 2.1 Definitions === |
+ | The ModbusTCP 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. | ||
+ | |||
+ | * The **Unit-ID** is the device-selector: | ||
+ | * The **Register Address** then determines the parameter to read or write: ie. voltage, or current, and so forth. | ||
+ | |||
+ | === 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 ModbusTCP clients and PLCs do not work with ID 0. | ||
+ | |||
+ | === 2.3 Register addresses === | ||
+ | |||
+ | The list of available registers is in an Excel sheet, available for download on the [[https:// | ||
- | ==== Product categories | + | Besides registers for connected Chargers, Inverters, |
- | In the ModbusTCP Registerlist xlsx file, there is a column called ' | + | Note that not all list registers are available for each device. For example |
- | Note that besides device-specific registers, there is also a set of registers that represent | + | Use this table to map the definition in the ' |
^ Device class ^ Product types ^ Registers | ^ Device class ^ Product types ^ Registers | ||
Line 34: | 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 < | | com.victronenergy.temperature | Temperature sensors < | ||
+ | | com.victronenery.meteo | IMT solar irradiation sensors | 3600 to 3603 | | ||
- | (1): Only the Venus GX is provided with temperature sensor inputs. The battery temperature | + | (1): These are the auxiliary temperature sensors built-in to our GX devices, such as the Venus GX. For details, see [[venus-os: |
- | General note: not all list registers are available for each device. For example a BMV Battery Monitor has lots of readings: historical data such as maximum/ | + | ==== 3. Supported ModbusTCP function codes ==== |
- | ==== Error codes ==== | + | |
+ | The supported function codes are: | ||
+ | * ReadHoldingRegisters = 3 | ||
+ | * ReadInputRegisters = 4 | ||
+ | * WriteSingleRegister = 6 | ||
+ | * WriteMultipleRegisters = 16 | ||
+ | |||
+ | Note that there is no difference between function code 3 and 4. | ||
+ | |||
+ | |||
+ | ==== 5. Error codes ==== | ||
^Code^Name^Description^ | ^Code^Name^Description^ | ||
|0x01|IllegalFunction|The requested function is not supported.| | |0x01|IllegalFunction|The requested function is not supported.| | ||
- | |0x02|IllegalDataAddress|The | + | |0x02|IllegalDataAddress|The |
|0x03|IllegalDataValue|The requested quantity of registers is invalid. See the modbus specs, http:// | |0x03|IllegalDataValue|The requested quantity of registers is invalid. See the modbus specs, http:// | ||
- | |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.| | + | |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 | + | |0x0B|GatewayTargetDeviceFailedToRespond|Requested |
- | ==== Mapping example ==== | + | ==== 6. 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 mapping. This excel sheet is available for download from our website on the [[https:// | excel sheet containing the modbustcp mapping. This excel sheet is available for download from our website on the [[https:// | ||
- | 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 CCGX, use the following settings: |
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. | 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. | ||
- | ==== Enabling ModbusTCP on the CCGX ==== | + | ==== 7. 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? ==== | + | To see why a certain register is not available, use the Settings -> Services -> ModbusTCP menu. It shows the last error, and reason for that error. |
- | The unit-id, sometimes called ‘slave address’, specifies how a product connected to the CCGX needs to be addressed. See the tab ‘Unit ID mapping’ tab in the Modbus-TCP excel sheet. | + | ==== 8. Support |
- | For the overal system data, look for com.victronenergy.system in the excelsheet, | + | The recommended method |
- | Note that both unit-id 0 and unit-id 100 map to the same internal address. We recommend to use id 100, since many ModbusTCP clients and PLCs do not work with id 0. | + | Direct company support is only offered on a limited basis. For such support, contact our Victron representative. |
- | ==== Which products can be interfaced via Modbus TCP? ==== | + | ==== 9. 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 with them individually if they are configured for parallel-working; | You cannot interface with them individually if they are configured for parallel-working; | ||
+ | === Q6: Will unit-id' | ||
- | ==== Will unit-id' | + | No. |
- | It may change in the case of VEdirect Devices connected via USB - but even then our experience is that it will only change in the first reboot. | + | === Q7: Advanced debugging === |
- | Unit-id' | ||
- | ==== Advanced debugging ==== | ||
- | If all unit-id' | + | If all unit-id' |
Follow these steps: | Follow these steps: | ||
Line 108: | Line 136: | ||
In most cases the problem will be found in either the unit's id address; or the register addresses. Double check the numbers shown in the output with the numbers as used in your modbustcp software or PLC. | In most cases the problem will be found in either the unit's id address; or the register addresses. Double check the numbers shown in the output with the numbers as used in your modbustcp software or PLC. | ||
- | ==== Does Modbus TCP support | + | === Q8: Does Modbus TCP support |
- | Yes. See the [[https:// | + | |
+ | Yes. See the [[https:// | ||
- | ===== DISQUS ===== | ||
- | ~~DISQUS~~ | ||
ccgx/modbustcp_faq.txt · Last modified: 2023-10-31 10:32 by jpasop