Skip to content

Commit 8b28323

Browse files
committed
Transaction_id for serial == 0. (#2208)
1 parent 0129993 commit 8b28323

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pymodbus/framer/rtu_framer.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def check_frame(self):
160160
if (result := self.decoder.decode(data)) is None:
161161
raise ModbusIOException("Unable to decode request")
162162
result.slave_id = self._header["uid"]
163-
result.transaction_id = self._header["tid"]
163+
result.transaction_id = 0
164164
self._buffer = self._buffer[self._header["len"] :]
165165
Log.debug("Frame advanced, resetting header!!")
166166
callback(result) # defer or push to a thread?
@@ -174,8 +174,7 @@ def buildPacket(self, message):
174174
packet = self.message_handler.encode(data, message.slave_id, message.transaction_id)
175175

176176
# Ensure that transaction is actually the slave id for serial comms
177-
if message.slave_id:
178-
message.transaction_id = message.slave_id
177+
message.transaction_id = 0
179178
return packet
180179

181180
def sendPacket(self, message):

0 commit comments

Comments
 (0)