mirror of
https://github.com/OpenLogics/MewtocolNet.git
synced 2025-12-06 11:11:23 +00:00
Fix queue and dc issues
This commit is contained in:
@@ -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();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user