[gelöst] ModbusAttr: Fehler beim Schreiben. function code 0x10 als Ursache?

Begonnen von FhemPiUser, 19 Oktober 2023, 10:24:58

Vorheriges Thema - Nächstes Thema

FhemPiUser

Hallo Zusammen,

ich bin dabei meine Lambda-Wärmepumpe per Modbus an fhem anzubinden. Lesen der Holdingregister funktioniert bereits, aber beim Schreiben mit dem u.g. Code für h0102 bekomme ich immer ein Fehler "ungültiger Wert" von der Wärmepumpe.

defmod Lambda_EU13L ModbusAttr 1 55 192.168.x.x:502 TCP
attr Lambda_EU13L closeAfterResponse 0
attr Lambda_EU13L dev-i-combine 16
attr Lambda_EU13L dev-type-S16-len 1
attr Lambda_EU13L dev-type-S16-unpack s>
attr Lambda_EU13L dev-type-S32-len 2
attr Lambda_EU13L dev-type-S32-revRegs 0
attr Lambda_EU13L dev-type-S32-unpack l>
attr Lambda_EU13L dev-type-SL_R2-len 2
attr Lambda_EU13L dev-type-SL_R2-unpack l
attr Lambda_EU13L dev-type-U16-len 1
attr Lambda_EU13L dev-type-U16-revRegs 0
attr Lambda_EU13L dev-type-U16-unpack S>
attr Lambda_EU13L dev-type-U32-len 2
attr Lambda_EU13L dev-type-U32-revRegs 0
attr Lambda_EU13L dev-type-U32-unpack N
attr Lambda_EU13L dev-type-UL_R2-len 2
attr Lambda_EU13L dev-type-UL_R2-revRegs 1
attr Lambda_EU13L dev-type-UL_R2-unpack N
attr Lambda_EU13L event-on-change-reading .*
...
attr Lambda_EU13L obj-h0102-poll 1
attr Lambda_EU13L obj-h0102-reading General_E-Manager_Actual_power
attr Lambda_EU13L obj-h0102-set 1
attr Lambda_EU13L obj-h0102-type S16
...

Laut Lambda Modbusprotokollbeschreibung muss beim Schreiben "function code 0x10 (write multiple holding registers)" verwendet werden. Ist dies bei ModbusAttr mit dem o.g. Code der Fall oder muss ich noch irgendetws einstellen?

FhemPiUser

Log mit verbose 5 ist anbei

2023.10.19 11:13:03.036 4: Lambda_EU13L: set called with General_E-Manager_Actual_power (h0102) setVal = 500
2023.10.19 11:13:03.038 5: Lambda_EU13L: GetSetChecks with force
2023.10.19 11:13:03.039 5: Lambda_EU13L: GetSetChecks returns success
2023.10.19 11:13:03.041 5: Lambda_EU13L: set packed hex 353030 with S> to hex 01f4
2023.10.19 11:13:03.044 4: Lambda_EU13L: DoRequest called from SetLDFn created new request, read buffer empty,
request: id 1, write fc 6 h0102, len 1, value 01f4, tid 182, master device Lambda_EU13L, reading General_E-Manager_Actual_power (set General_E-Manager_Actual_power)
2023.10.19 11:13:03.044 5: Lambda_EU13L: QueueRequest called from DoRequest with h0102, qlen 0 from master Lambda_EU13L through io device Lambda_EU13L
2023.10.19 11:13:03.045 5: Lambda_EU13L: ProcessRequestQueue called from QueueRequest as direct:Lambda_EU13L, qlen 1, force, request: request: id 1, write fc 6 h0102, len 1, value 01f4, tid 182, master device Lambda_EU13L, reading General_E-Manager_Actual_power (set General_E-Manager_Actual_power), queued 0.00 secs ago
2023.10.19 11:13:03.046 5: Lambda_EU13L: checkDelays busDelayRead is not required
2023.10.19 11:13:03.046 5: Lambda_EU13L: checkDelays clientSwitchDelay is not relevant
2023.10.19 11:13:03.047 5: Lambda_EU13L: checkDelays sendDelay, last send to same device was 32.118 secs ago, required delay is 0.1
2023.10.19 11:13:03.047 5: Lambda_EU13L: checkDelays commDelay, last communication with same device was 32.104 secs ago, required delay is 0.1
2023.10.19 11:13:03.050 4: Lambda_EU13L: ProcessRequestQueue (V4.5.5 - 9.5.2023) qlen 1, sending 00b6000000060106006601f4 via 192.168.x.x:502, read buffer empty,
request: id 1, write fc 6 h0102, len 1, value 01f4, tid 182, master device Lambda_EU13L, reading General_E-Manager_Actual_power (set General_E-Manager_Actual_power), queued 0.00 secs ago
2023.10.19 11:13:03.050 5: Lambda_EU13L: Send called from ProcessRequestQueue
2023.10.19 11:13:03.051 5: DevIo_SimpleWrite Lambda_EU13L: 00b6000000060106006601f4
2023.10.19 11:13:03.054 5: Lambda_EU13L: ReadAnswer called from SetLDFn
2023.10.19 11:13:03.056 5: Lambda_EU13L: ReadAnswer remaining timeout is 1.98857092857361
2023.10.19 11:13:03.082 5: Lambda_EU13L: ReadAnswer got: 00b600000003018601
2023.10.19 11:13:03.083 5: Lambda_EU13L: ParseFrameStart called from ReadAnswer protocol TCP expecting id 1
2023.10.19 11:13:03.083 4: Lambda_EU13L: ParseFrameStart (TCP, master) extracted id 1, fCode 134, tid 182, dlen 3 and potential data 01
2023.10.19 11:13:03.084 5: Lambda_EU13L: HandleResponse called from ReadAnswer
2023.10.19 11:13:03.084 5: Lambda_EU13L: HandleResponse is now creating response hash, masterHash is HASH(0x85e6ed0)
2023.10.19 11:13:03.085 5: Lambda_EU13L: HandleResponse is now calling ParseResponse, masterHash is HASH(0x85e6ed0)
2023.10.19 11:13:03.085 5: Lambda_EU13L: createDevInfoCache fc 134 called
2023.10.19 11:13:03.086 5: Lambda_EU13L: ParseResponse called from HandleResponse, fc 134
2023.10.19 11:13:03.086 4: Lambda_EU13L: HandleResponse got response with error code 86 / 01, illegal function
2023.10.19 11:13:03.087 4: Lambda_EU13L: HandleResponse done, current frame / read buffer: 00b600000003018601, id 1, fCode 134, tid 182,
request: id 1, write fc 6 h0102, len 1, value 01f4, tid 182, master device Lambda_EU13L, reading General_E-Manager_Actual_power (set General_E-Manager_Actual_power), queued 0.04 secs ago, sent 0.04 secs ago,
response: id 1, fc 134, error code 01, h0102, len 1
2023.10.19 11:13:03.088 5: Lambda_EU13L: ResetExpect for HandleResponse from response to idle
2023.10.19 11:13:03.091 5: Lambda_EU13L: DropFrame called from ReadAnswer - drop 00b600000003018601
2023.10.19 11:13:18.301 4: Lambda_EU13L: GetUpdate (V4.5.5 - 9.5.2023) called from Fhem internal timer
2023.10.19 11:13:18.302 4: Lambda_EU13L: UpdateTimer called from GetUpdate with cmd next sets timer to call update function in 55.0 sec at 11:14:13.301, interval 55
2023.10.19 11:13:18.307 5: Lambda_EU13L: CreateUpdateHash full object list: h0000 h0001 h0002 h0003 h0004 h0101 h0102 h0103 h0104 h1000 h1001 h1002 h1003 h1004 h1005 h1006 h1007 h1008 h1009 h1010 h1011 h1012 h1013 h1014 h1015 h1016 h1017 h1018 h1019 h1020 h1022 h2000 h2001 h2002 h2003 h2004 h3000 h3001 h3002 h3003 h3004 h5000 h5001 h5002 h5003 h5004 h5005 h5006 h5050 h5051 h5052
2023.10.19 11:13:18.309 5: Lambda_EU13L: CreateUpdateHash will request h0000 len 1 General_Ambient_Error_number
2023.10.19 11:13:18.310 5: Lambda_EU13L: CreateUpdateHash will request h0001 len 1 General_Ambient_Operating_state
...

FhemPiUser

Ahh, habe gerade in der Referenz die Option gefunden

dev-h-write 16
funktioniert es!