Closed giovanni-systematik closed 1 year ago
Hi, thank you for the input! It should be resolved by 19db0a9daad50eea7287bd0aa0782738264502b2
Logger.LogLevel = LogLevel.Critical;
Logger.OnNewLogMessage((t, l, m) => { Console.WriteLine(m); });
using (var plc = Mewtocol.Ethernet("192.168.115.210").Build())
{
await plc.ConnectAsync();
await Task.Delay(1000);
Word[] value = new Word[15];
for (int i = 0; i < value.Length; i++)
{
value[i] = new Word(8224);
}
await plc.Register.Struct<Word>("DT30390").AsArray(15).WriteAsync(value);
var read = await plc.Register.Struct<Word>("DT30390").AsArray(15).ReadAsync();
Console.WriteLine($"Read: {string.Join(", ", read.Select(x => x.ToString()))}");
}
I forgot to mark the registers that are built by the array pattern as anonymous
Now it works correctly! Thank you!
Hi! I have a problem with the library! After inserting a Word array with the WriteAsync function, an error occurs.
Message
object reference not set to an instance of an object
Stack Trace
MewtocolNet.Registers.ArrayRegister 1.<WriteAsync>d__30.MoveNext
Code