Solax Direct Modbus Connect write

Hi guys,

I´m trying to connect Solax Hybrid inverter locally via Modbus on Port 502. I´m able to read values in RealtimeData with no problem.

Problem is, that I´m unable to write data for example from item solax_WorkingMODE

I don´t know, if the problem is in connection or in transformation. If you gave me some example, I would finish it and give tutorial for others.

Thanks in advance

It gives me error:

2022-07-06 12:44:36.558 [DEBUG] [ernal.handler.ModbusDataThingHandler] - Thing modbus:data:localhostTCP:holdingRegisters:WorkingMode 'Modbus Data' had ModbusSlaveIOExceptionImpl error on write: ModbusSlaveIOException(cause=ModbusIOException, EOF=false, message='I/O exception: EOFException null', cause2=null)
2022-07-06 12:44:36.562 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'modbus:data:localhostTCP:holdingRegisters:WorkingMode' changed from OFFLINE (COMMUNICATION_ERROR): Error (ModbusSlaveIOExceptionImpl) with write. Request: ModbusWriteRegisterRequestBlueprint [slaveId=2, reference=31, registers=ModbusRegisterArray(0001), maxTries=3, getFunctionCode()=WRITE_SINGLE_REGISTER]. Description: ModbusSlaveIOException(cause=ModbusIOException, EOF=false, message='I/O exception: EOFException null', cause2=null). Message: Modbus IO Error with cause=ModbusIOException, EOF=false, message='I/O exception: EOFException null', cause2=null to OFFLINE (COMMUNICATION_ERROR): Error (ModbusSlaveIOExceptionImpl) with write. Request: ModbusWriteRegisterRequestBlueprint [slaveId=2, reference=31, registers=ModbusRegisterArray(0003), maxTries=3, getFunctionCode()=WRITE_SINGLE_REGISTER]. Description: ModbusSlaveIOException(cause=ModbusIOException, EOF=false, message='I/O exception: EOFException null', cause2=null). Message: Modbus IO Error with cause=ModbusIOException, EOF=false, message='I/O exception: EOFException null', cause2=null

I have found mapping in Solax Modbus Documentation here: Solax Modbus RTU documentation

This is my Test Thing with working reading data from input registers

Bridge modbus:tcp:localhostTCP [ host="192.168.0.7", port=502, id=2 ] {

  
 
    Bridge poller inputRegisters [ start=0, length=99, refresh=10000, type="input" ] {
	
        Thing data NetworkVoltage [ readStart="0" , readValueType="int16", readTransform="JS(divide_by_10.js)"]
		 Thing data OutputCurrent [ readStart="1", readValueType="int16", readTransform="JS(divide_by_10.js)" ]
		  Thing data ACPower [ readStart="2", readValueType="int16" ]  
		  
		  Thing data PV1Voltage [ readStart="3", readValueType="int16", readTransform="JS(divide_by_10.js)"  ]
		    Thing data PV2Voltage [ readStart="4", readValueType="int16", readTransform="JS(divide_by_10.js)"  ]
		   Thing data PV1Current [ readStart="5", readValueType="int16", readTransform="JS(divide_by_10.js)"  ]
		    Thing data PV2Current [ readStart="6", readValueType="int16", readTransform="JS(divide_by_10.js)"  ]
			
			
	 		
Thing data DailyYield [ readStart="80", readValueType="int16", readTransform="JS(divide_by_10.js)"]	 	 
	
		Thing data BatteryTemp [ readStart="27", readValueType="int16" ]
		 Thing data BatterySOC [ readStart="28", readValueType="int16" ]
		 
        

      
    }
	
	 Bridge poller holdingRegisters [ start=100, length=99, refresh=10000, type="holding" ] {
	
	Thing data WorkingMode [ readStart="139", readValueType="uint16", writeStart="31", writeValueType="uint16", writeType="holding", writeTransform="default"]
	
	}
}
   

Here is my items file

Number ACPower            "Výkon dodávaný do sítě [%.2f W]"    { channel="modbus:data:localhostTCP:inputRegisters:ACPower:number" }
Number NetworkVoltage     "Napětí v síti [%.2f V]"    { channel="modbus:data:localhostTCP:inputRegisters:NetworkVoltage:number" }
Number OutputCurrent     "Výstupní proud měniče [%.2f A]"    { channel="modbus:data:localhostTCP:inputRegisters:OutputCurrent:number" }
Number PV1Voltage     "Napětí panelů PV1 [%.2f V]"    { channel="modbus:data:localhostTCP:inputRegisters:PV1Voltage:number" }
Number PV2Voltage     "Napětí panelů PV2 [%.2f V]"    { channel="modbus:data:localhostTCP:inputRegisters:PV2Voltage:number" }
Number PV1Current     "Proud panelů PV1 [%.2f A]"    { channel="modbus:data:localhostTCP:inputRegisters:PV1Current:number" }
Number PV2Current     "Proud panelů PV2 [%.2f A]"    { channel="modbus:data:localhostTCP:inputRegisters:PV2Current:number" }


Number Solax_DailyYield           "Výroba dnes [%.2f kWh]"    { channel="modbus:data:localhostTCP:inputRegisters:DailyYield:number" }
Number solax_WorkingMODE            "Working Mode"    { channel="modbus:data:localhostTCP:holdingRegisters:WorkingMode:number" }


Number Solax_BatteryTemp            "Teplota baterie [%.0f °C]"    { channel="modbus:data:localhostTCP:inputRegisters:BatteryTemp:number" }
Number Solax_BatterySOC            "Nabití baterie [%.0f%%]"    { channel="modbus:data:localhostTCP:inputRegisters:BatterySOC:number" }
Number Input1503Float32            "Input registers 1500-1501 as float32 [%.0f]"    { channel="modbus:data:localhostTCP:inputRegisters:input1503:number" }

You’ve not said exactly how or what you are trying to write. It should be as simple as commanding some openHAB Item, once configured.

It’s attempted to write, but ignored by the far end device.

Many Modbus devices will only respond to “write multiple” function codes, even when you are trying to write just one register. This is configurable in your Data Thing.
Check the device docs.

Thank you for your respnose. I have written to Manufacturer, because It looks like it is blocked to write the device.

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.