Fix queue and dc issues

This commit is contained in:
Felix Weiß
2023-08-07 18:05:02 +02:00
parent 82d9aa8b16
commit c41b0cef16
21 changed files with 564 additions and 213 deletions

View File

@@ -1,4 +1,5 @@
using Examples.WPF.ViewModels;
using MewtocolNet.Registers;
using System;
using System.Collections.Generic;
using System.Linq;
@@ -41,4 +42,22 @@ public partial class PlcDataView : UserControl {
}
private async void ClickedSetRandom(object sender, RoutedEventArgs e) {
var reg = (IRegister<ushort>?)viewModel.Plc.GetAllRegisters()?.FirstOrDefault(x => x.PLCAddressName == "DT1001");
if(reg != null) {
await reg.WriteAsync((ushort)new Random().Next(ushort.MinValue, ushort.MaxValue));
}
}
private async void ClickedToggleRunMode(object sender, RoutedEventArgs e) {
await viewModel.Plc.ToggleOperationModeAsync();
}
}