diff --git a/S7.Net.UnitTest/S7NetTestsAsync.cs b/S7.Net.UnitTest/S7NetTestsAsync.cs index cb63660..fc44522 100644 --- a/S7.Net.UnitTest/S7NetTestsAsync.cs +++ b/S7.Net.UnitTest/S7NetTestsAsync.cs @@ -949,6 +949,33 @@ namespace S7.Net.UnitTest // Depending on how tests run, this can also just succeed without getting cancelled at all. Do nothing in this case. Console.WriteLine("Task was not cancelled as expected."); } + + /// + /// Write a large amount of data and test cancellation + /// + [TestMethod] + public async Task Test_Async_ParseDataIntoDataItemsAlignment() + { + Assert.IsTrue(plc.IsConnected, "Before executing this test, the plc must be connected. Check constructor."); + + var dataItems = new List + { + new DataItem + { + DataType = DataType.DataBlock, + DB = 2, + VarType = VarType.S7String, + Count = 5 + }, + new DataItem + { + DataType = DataType.DataBlock, + DB = 2, + VarType = VarType.Word, + } + }; + await plc.ReadMultipleVarsAsync(dataItems, CancellationToken.None); + } #endregion } }