Auto: s7-a1 — 64-bit scalar types
Closes the NotSupportedException cliff for S7 Float64/Int64/UInt64. - S7Size enum gains LWord (8 bytes); parser accepts DBLD/DBL on data blocks and LD on M/I/Q (e.g. DB1.DBLD0, DB1.DBL8, MLD0, ILD8, QLD16). - S7Driver.ReadOneAsync / WriteOneAsync issue ReadBytesAsync / WriteBytesAsync for 64-bit types and convert big-endian via System.Buffers.Binary.BinaryPrimitives. S7's wire format is BE. - Internal MapArea(S7Area) helper translates to S7.Net DataType. - MapDataType now surfaces native DriverDataType for Int16/UInt16/ UInt32/Int64/UInt64 instead of collapsing them all to Int32. Tests: parser theories cover DBLD/DBL/MLD/ILD/QLD; discovery test asserts the 64-bit DriverDataType mapping. 64/64 passing. Closes #287
This commit is contained in:
@@ -14,6 +14,8 @@ public sealed class S7AddressParserTests
|
||||
[InlineData("DB1.DBB0", 1, S7Size.Byte, 0, 0)]
|
||||
[InlineData("DB1.DBW0", 1, S7Size.Word, 0, 0)]
|
||||
[InlineData("DB1.DBD4", 1, S7Size.DWord, 4, 0)]
|
||||
[InlineData("DB1.DBLD0", 1, S7Size.LWord, 0, 0)] // 64-bit long DWord
|
||||
[InlineData("DB1.DBL8", 1, S7Size.LWord, 8, 0)] // 64-bit alt suffix (LReal)
|
||||
[InlineData("DB10.DBW100", 10, S7Size.Word, 100, 0)]
|
||||
[InlineData("DB1.DBX15.3", 1, S7Size.Bit, 15, 3)]
|
||||
public void Parse_data_block_addresses(string input, int db, S7Size size, int byteOff, int bitOff)
|
||||
@@ -53,6 +55,9 @@ public sealed class S7AddressParserTests
|
||||
[InlineData("QW0", S7Area.Output, S7Size.Word, 0, 0)]
|
||||
[InlineData("Q0.0", S7Area.Output, S7Size.Bit, 0, 0)]
|
||||
[InlineData("QD4", S7Area.Output, S7Size.DWord, 4, 0)]
|
||||
[InlineData("MLD0", S7Area.Memory, S7Size.LWord, 0, 0)] // 64-bit Merker
|
||||
[InlineData("ILD8", S7Area.Input, S7Size.LWord, 8, 0)]
|
||||
[InlineData("QLD16", S7Area.Output, S7Size.LWord, 16, 0)]
|
||||
public void Parse_MIQ_addresses(string input, S7Area area, S7Size size, int byteOff, int bitOff)
|
||||
{
|
||||
var r = S7AddressParser.Parse(input);
|
||||
|
||||
Reference in New Issue
Block a user