From 0203c887beae4c1e2202b813e35059c3062d4b02 Mon Sep 17 00:00:00 2001 From: zhping8080 <2946062178@qq.com> Date: Tue, 15 Jul 2025 15:05:01 +0800 Subject: [PATCH] fix: Solve a problem when server receives a request with REAL type. It contains an error about calculating data offset --- src/core/s7_server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/s7_server.cpp b/src/core/s7_server.cpp index e66aa80..f125d3e 100644 --- a/src/core/s7_server.cpp +++ b/src/core/s7_server.cpp @@ -863,7 +863,7 @@ bool TS7Worker::PerformFunctionWrite() { ReqData[c]=PReqFunWriteDataItem(pbyte(PDUH_in)+StartData); - if ((ReqParams->Items[c].TransportSize == S7WLTimer) || (ReqParams->Items[c].TransportSize == S7WLCounter) || (ReqParams->Items[c].TransportSize == S7WLBit)) + if ((ReqParams->Items[c].TransportSize == S7WLTimer) || (ReqParams->Items[c].TransportSize == S7WLCounter) || (ReqParams->Items[c].TransportSize == S7WLBit) || (ReqParams->Items[c].TransportSize == S7WLReal)) L = SwapWord(ReqData[c]->DataLength); else L = (SwapWord(ReqData[c]->DataLength) / 8);