Modbus Communication with Inch products
For some of our customers there is a need for manual manipulating charging settings via modbus. Bellow you can find attached python script, that should be a good start what can you do with modbus on our Inch products. Script is written, with both Duo and Inch, in mind.
List of supported registers can be found here - Modbus TCP Registers
Â
Prerequsites:
PC with Windows/Linux, MacOS or other device capable running Python
Python 3.(x) and above installed - Python 3.9
Modbus module - GitHub - pymodbus-dev/pymodbus: A full modbus protocol written in python
Python editor - we suggest https://code.visualstudio.com/
Â
Installation:
First you need to install Python and add it to you path. On Windows, path is found in Enviroment variables settings.
Then, using pip, you must install pymodbus library. Once your python was added to path you can use command
pip install -U pymodbus
In script there is a line that sets charger IP address. (Line 27), and it looks like following
clientIP="192.168.1.250" #Charger's IP address
Change IP address accordingly to your charger.
Â
Running script:
Script can be easily run using python executable from command prompt.
For reading Modbus registers use
python INCH_modbus_read.py
And for writing Modbus registers use
python INCH_modbus_write.py
When writing modbus, scripts asks for which connector on Inch Duo
Â
Limitations:
During first 45 seconds is impossible to set current point, due to station figuring out minimal and maximum target current.
Â
Running example:
Reading on modbus:
********************************************************************************
Reading data from INCH or DUO, IP address and port: 172.25.2.250:502
--------------------------------------------------------------------------------
>>> REAL-TIME VALUES <<<
********************************************************************************
CONNECTOR 1 (22 registers)
--------------------------------------------------------------------------------
[0]Connector 1 status: Charging
[1]Connector 1 measured vehicle number of phases: Single phase (L1)
[2]Connector 1 EV max phase current: 8.44A
[4]Connector 1 Target current from power mgm or modbus: 9.00A
[6]Connector 1 Frequency: 50.01Hz
[8]Connector 1 L-N voltage (L1): 230.60V
[10]Connector 1 L-N voltage (L2): 230.50V
[12]Connector 1 L-N voltage (L3): 230.60V
[14]Connector 1 Current (L1): 8.32A
[16]Connector 1 Current (L2): 0.02A
[18]Connector 1 Current (L3): 0.00A
[20]Connector 1 Active power (L1): 1.92kW
[22]Connector 1 Active power (L2): 0.00kW
[24]Connector 1 Active power (L3): 0.00kW
[26]Connector 1 Active power (Total): 1.92kW
[28]Connector 1 Power factor: 0.998
[30]Connector 1 Total imported active energy in running session: 0.10kWh
[32]Connector 1 Running session duration (h:mm:ss): 0:02:50
[36]Connector 1 Running session departure time: 19-03-2021 11:30
[40]Connector 1 Running session ID: 17
[44]Connector 1 EV max power: 1.946
[46]Connector 1 EV required energy: 60.000
--------------------------------------------------------------------------------
CONNECTOR 2 (22 registers)
--------------------------------------------------------------------------------
[100]Connector 2 status: Unknown status!
[101]Connector 2 measured vehicle number of phases: Unknown number of phases
[102]Connector 2 EV max phase current: 0.00A
[104]Connector 2 Target current from power mgm or modbus: 0.00A
[106]Connector 2 Connector 1 Frequency: 0.00Hz
[108]Connector 2 L-N voltage (L1): 0.00V
[110]Connector 2 L-N voltage (L2): 0.00V
[112]Connector 2 L-N voltage (L3): 0.00V
[114]Connector 2 Current (L1): 0.00A
[116]Connector 2 Current (L2): 0.00A
[118]Connector 2 Current (L3): 0.00A
[120]Connector 2 Active power (L1): 0.00kW
[122]Connector 2 Active power (L2): 0.00kW
[124]Connector 2 Active power (L3): 0.00kW
[126]Connector 2 Active power (Total): 0.00kW
[128]Connector 2 Power factor: 0.000
[130]Connector 2 Total imported active energy in running session: 0.00kWh
[132]Connector 2 Running session duration (h:mm:ss): 0:00:00
[136]Connector 2 Running session departure time: 01-01-1970 01:00
[140]Connector 2 Running session ID: 0
[144]Connector 2 EV max power: 0.000
[146]Connector 2 EV required energy: 0.000
********************************************************************************
>>> CHARGER SETTINGS (5 registers) <<<
********************************************************************************
[990]Serial number: 15122020
[1000]Model: G-PC1VDBY20
[1010]HW version: 1.2
[1015]SW version: 3.0.901-6-
[1020]Number of connectors: 1
--------------------------------------------------------------------------------
CONNECTOR 1 (6 registers)
--------------------------------------------------------------------------------
[1022]Connector 1 Connector type: SocketType2
[1023]Connector 1 Number of phases: 3
[1024]Connector 1 L1 connected to phase: 1
[1025]Connector 1 L2 connected to phase: 2
[1026]Connector 1 L3 connected to phase: 3
[1028]Connector 1 Custom max current: 32A
--------------------------------------------------------------------------------
CONNECTOR 2 (6 registers)
--------------------------------------------------------------------------------
[1122]Connector 2 Connector type: Unknown connector type!
[1123]Connector 2 Number of phases: 0
[1124]Connector 2 L1 connected to phase: 0
[1125]Connector 2 L2 connected to phase: 0
[1126]Connector 2 L3 connected to phase: 0
[1128]Connector 2 Custom max current: 0A
********************************************************************************
Reading cluster data from INCH or DUO, IP address and port: 172.25.2.250:503
--------------------------------------------------------------------------------
>>> CLUSTER DATA (20 registers) <<<
********************************************************************************
[2000]LoadGuard status: Not connected
[2002]Load Guard frequency: 0.00Hz
[2004]Load Guard L-N voltage (L1): 0.00V
[2006]Load Guard L-N voltage (L2): 0.00V
[2008]Load Guard L-N voltage (L3): 0.00V
[2010]Load Guard current (L1): 0.00A
[2012]Load Guard current (L2): 0.00A
[2014]Load Guard current (L3): 0.00A
[2016]Load Guard active power (L1): 0.00kW
[2018]Load Guard active power (L2): 0.00kW
[2020]Load Guard active power (L3): 0.00kW
[2022]Load Guard active power (Total): 0.00kW
[2024]Load Guard Power factor: 0.000
[2100]Power cluster current (L1): 8.32A
[2102]Power cluster current (L2): 0.02A
[2104]Power cluster current (L3): 0.00A
[2106]Power cluster active power (L1): 1.92kW
[2108]Power cluster active power (L2): 0.00kW
[2110]Power cluster active power (L3): 0.00kW
[2112]Power cluster active power (Total): 1.92kW
********************************************************************************
>>> CLUSTER SETTINGS (1 register) <<<
********************************************************************************
[3000]LoadGuard installation status: Not installed
Â
Writing on modbus, set current point was changed:
-----------------------------------------------------------------
Please enter connector number 1 or 2 for 172.25.2.250 (e to exit): 1
-----------------------------------------------------------------
AVAILABLE WRITING OPTIONS for 172.25.2.250
-----------------------------------------------------------------
>>> CONNECTOR 1 COMMANDS <<<
1. Stop charging
2. Pause charging
3. Set departure time
4. Set current setpoint
5. Cancel current setpoint
6. Set power setpoint
7. Cancel power setpoint
>>> CHARGER COMMANDS <<<
8. Set time
9. Restart charger
>>> CLUSTER COMMANDS <<<
10. Cluster - set limit L1
11. Cluster - set limit L2
12. Cluster - set limit L3
-----------------------------------------------------------------
Please enter option number (1 to 12 or e to exit): 4
-----------------------------------------------------------------
Connection: ModbusTcpClient(172.25.2.250:502)
-----------------------------------------------------------------
>>> CONNECTOR COMMANDS <<<
-----------------------------------------------------------------
Please enter current setpoint in A (e.g. 6.6): 8
[8]Set current setpoint to: 8A
-----------------------------------------------------------------
AVAILABLE WRITING OPTIONS for 172.25.2.250
-----------------------------------------------------------------
>>> CONNECTOR 1 COMMANDS <<<
1. Stop charging
2. Pause charging
3. Set departure time
4. Set current setpoint
5. Cancel current setpoint
6. Set power setpoint
7. Cancel power setpoint
>>> CHARGER COMMANDS <<<
8. Set time
9. Restart charger
>>> CLUSTER COMMANDS <<<
10. Cluster - set limit L1
11. Cluster - set limit L2
12. Cluster - set limit L3
-----------------------------------------------------------------
Please enter option number (1 to 12 or e to exit):
Â
Python scripts
Â
Â
List of registers
Â
Â
Article on how to enable Modbus and its fallback functionalities: https://etrelchargingsolutions.atlassian.net/wiki/spaces/EH/pages/3224338453
Warning! Before installing, wiring, handling or accessing the charging station in any way, make sure to read, understand and follow the Safety Guidelines.
Any graphic material provided in this documentation library is subject to variation and may not reflect the most recent updates or changes due to ongoing development and the implementation of new features.
Owing to periodic improvements of our products, the supplied products can differ in some details from the information stated in this documentation library. The information is subject to alteration without notice.
The English version of this documentation is the official and authoritative source of information. We make every effort to ensure that translations are accurate and clear; however, we do not accept responsibility for any errors, omissions, or misinterpretations in translated versions. In case of discrepancies, the English version will take precedence.