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 [2016-01-08 18:15] – 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 | + | Besides reading this GX Modbus-TCP Manual, make sure to also read the Modbus-TCP section in our [[https:// |
+ | |||
+ | By default, Modbus-TCP is disabled. To enable it, go into the settings menu, scroll down to ' | ||
+ | |||
+ | ==== 2. Addressing, Unit-ID 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. | ||
+ | |||
+ | * 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 Modbus-TCP 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:// | ||
+ | |||
+ | 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 | ||
+ | | com.victronenergy.vebus | ||
+ | | com.victronenergy.solarcharger | Solar chargers (both VE.Can and VE.Direct connected) | ||
+ | | com.victronenergy.pvinverter | ||
+ | | com.victronenergy.battery | BMVs, CAN-Bus BMS connected batteries \\ Extra parameter set for Lynx Ion and Lynx BMS product family | 259 to 319 \\ 1282 to 1301 | | ||
+ | | com.victronenergy.charger | ||
+ | | com.victronenergy.inverter | ||
+ | | com.victronenergy.tank | ||
+ | | com.victronenergy.grid | Energy meters configured to measure the grid | 2600 to 2609 | | ||
+ | | com.victronenergy.gps | GPS | 2800 to 2807 | | ||
+ | | com.victronenergy.tank | Tank sensors | 3000 to 3007 | | ||
+ | | com.victronenergy.genset | Generators | ||
+ | | com.victronenergy.temperature | Temperature sensors < | ||
+ | | com.victronenery.meteo | IMT solar irradiation sensors | 3600 to 3603 | | ||
+ | |||
+ | (1): These are the auxiliary temperature sensors built-in to our GX devices, such as the Venus GX. For details, see [[venus-os: | ||
+ | |||
+ | ==== 3. Supported | ||
The supported function codes are: | The supported function codes are: | ||
Line 16: | Line 67: | ||
Note that there is no difference between function code 3 and 4. | Note that there is no difference between function code 3 and 4. | ||
- | ==== Error codes ==== | + | ==== 5. Mapping example ==== |
- | ^Code^Name^Description^ | + | |
- | |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:// | + | |
- | |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| | + | |
- | + | ||
- | ==== 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 ' | + | |
- | ==== Which products can be interfaced via Modbus TCP? ==== | + | === 6.1 The common cause: Unit-ID / Register combination |
- | Check the latest [[https:// | + | |
- | ==== Which parameters can I control via Modbus TCP? ==== | + | In case a certain read or write is not successful, most likely there is an issue in the unitid/ |
- | | com.victronenergy.vebus | + | 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. |
- | | com.victronenergy.vebus | + | |
- | | com.victronenergy.solarcharger | /Mode | 0=Off; | + | |
- | | com.victronenergy.bms | / | + | |
- | | com.victronenergy.charger | + | |
- | | com.victronenergy.charger | + | |
+ | === 6.2 Looking up the last Modbus-TCP Error on the GX Device=== | ||
- | ==== Can I change | + | 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. |
- | No not yet. | + | |
- | ==== 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. | + | |
- | ==== Can I implement more features myself? | + | === 6.3 Error codes === |
- | 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? ==== | + | These error codes are returned by our software to the PLC; and most PLC software tools allow seeing them. |
- | You cannot interface to them individually if they are configured to be in parallel | + | ^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 | ||
+ | |0x0B|GatewayTargetDeviceFailedToRespond|Requested Unit-ID not found in the mapping list. Double check the Unit-ID mapping list in the excel sheet.| | ||
- | ==== I have two or more different VE.Bus systems connected, how can I address each of them? ==== | ||
- | If you have, for example, two Multis in parallel, and also a separate Quattro, you have two VE.Bus systems: | ||
- | - System 1: two Multis configured as a parallel system | ||
- | - System 2: the Quattro | ||
- | Each of them will have a different unit id. The unit id of the system connected to the VE.Bus port on the back of the CCGX will have unit id 246. The unit id of the other one, connected to the VE.Can ports via a //VE.Bus to VE.Can interface//, | + | ==== 7. Support ==== |
- | To connect multiple VE.Bus systems connected via VE.Can, you need to have multiple VE.Bus to VE.Can interfaces. To make them addressable, | + | The recommended method for support on Modbus-TCP questions is to use the [[https:// |
- | ==== Will unit ids change after a reboot or loss of power? ==== | + | |
- | Only for vedirect Devices via USB it can change. But even then our experience | + | Direct company support |
- | Unit ids of products not connected via USB will not change. | + | ==== 8. FAQ ==== |
- | ==== Advanced debugging ==== | + | === Q1: Which products can be interfaced via Modbus-TCP? |
+ | All products that can be connected to the [[https:// | ||
- | In case all unit-ids and register addresses have been checked and double checked, and still it doesn' | ||
- | Steps: | + | === Q2: Can I change a configuration setting in a Multi - for example: the absorption voltage? === |
- | - Enable SSH | + | No. |
- | - Login, use for example Putty in windows, | + | |
+ | === 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. | ||
+ | |||
+ | === 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:// | ||
+ | |||
+ | === 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; | ||
+ | |||
+ | === Q6: Will unit-id' | ||
+ | |||
+ | No. | ||
+ | |||
+ | === Q7: Advanced debugging === | ||
+ | |||
+ | |||
+ | If all unit-id' | ||
+ | |||
+ | Follow these steps: | ||
+ | - [[ccgx: | ||
+ | - 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 92: | 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 |
- | + | ||
- | ==== After upgrading the CCGX to v1.16 or later, ModbusTCP no longer works? ==== | + | |
- | After learning from our first ModbusTCP experiences with v1.14, we have changed a few things in v1.16: | + | |
- | - Instead of having to login to SSH to start/stop modbustcp, you can enable/ | + | |
- | - Some PLCs do not accept a unit id above 247. Therefore we changed a few unitids: | + | |
- | * VE-Bus port was 254, is now 246 | + | |
- | * VE.Direct port 1 was 255, is now 247 | + | |
- | * VE.Direct port 2 was 253, is now 245 | + | |
- | + | ||
- | Best is to change your PLC program to the new unit ids. If you can’t do that, change unitid2di.csv in / | + | |
- | + | ||
- | There are two ways of enabling ModbusTCP: | + | |
- | - use the menu and the buttons to find the services menu (last one in the list), and then enable ModbusTCP. | + | |
- | - login via ssh (only available if remote support is enabled), and then execute the following command: | + | |
- | + | ||
- | dbus -y com.victronenergy.settings / | + | |
- | + | ||
- | Our apologies for this change, we know how much hassle this can cause. | + | |
- | ==== Does Modbus TCP support | + | === Q8: Does Modbus-TCP support |
- | Yes. These registers were created to take control of Hub-4 behavior: | + | |
- | * //Hub4 grid target//. Used by hub4 control loop (register 2700, unit-id 239 (first USB device) to 233 (last USB device), unit Watts). | + | |
- | * Positive: take power from grid. | + | |
- | * Negative: send power to grid. | + | |
- | * Default: 0W. | + | |
- | * //Max charge percentage// | + | |
- | * Min value 0% | + | |
- | * Max value 100% | + | |
- | * If 0% is set, charging will be disabled, otherwise the AC-In target will be adjusted whenever necessary. | + | |
- | * //Max discharge percentage// | + | |
- | See modbustcp excel sheet for scaling and datatypes, available [[https:// | + | |
- | Notes: | + | Yes. See the [[https://www.victronenergy.com/ |
- | * Three/split-phase is not possible yet. | + | |
- | * The update mechanism is slow, which to our opinion is not perfect, but also no problem. | + | |
- | ==== Disqus ==== | ||
- | ~~DISQUS~~ |
ccgx/modbustcp_faq.1452273356.txt.gz · Last modified: 2016-01-08 18:15 by mvader