From ac0b04a33792b308feba1b2414a5d40796441acd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BD=99=E8=B6=85?= Date: Wed, 14 Aug 2024 12:15:15 +0800 Subject: [PATCH] Update Struct.cs Int32 and Uint32 have the same byte order --- S7.Net/Types/Struct.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/S7.Net/Types/Struct.cs b/S7.Net/Types/Struct.cs index 136638ac..1b11087a 100644 --- a/S7.Net/Types/Struct.cs +++ b/S7.Net/Types/Struct.cs @@ -163,10 +163,10 @@ public static int GetStructSize(Type structType) if ((numBytes / 2 - Math.Floor(numBytes / 2.0)) > 0) numBytes++; // get the value - info.SetValue(structValue, DWord.FromBytes(bytes[(int)numBytes], - bytes[(int)numBytes + 1], + info.SetValue(structValue, DWord.FromBytes(bytes[(int)numBytes + 3], bytes[(int)numBytes + 2], - bytes[(int)numBytes + 3])); + bytes[(int)numBytes + 1], + bytes[(int)numBytes + 0])); numBytes += 4; break; case "Single":