From c41b0cef16eb289ecefc330b01d3a3e156bf7c0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Wei=C3=9F?= <72068105+Sandoun@users.noreply.github.com> Date: Mon, 7 Aug 2023 18:05:02 +0200 Subject: [PATCH] Fix queue and dc issues --- Examples.BasicEthernet/Program.cs | 1 - Examples.WPF/MainWindow.xaml | 11 +- Examples.WPF/Views/ConnectView.xaml.cs | 36 ++- Examples.WPF/Views/PlcDataView.xaml | 4 + Examples.WPF/Views/PlcDataView.xaml.cs | 19 ++ MewtocolNet/Helpers/MewtocolHelpers.cs | 1 + MewtocolNet/Helpers/PlcBitConverter.cs | 28 ++ MewtocolNet/IPlc.cs | 19 +- MewtocolNet/Mewtocol.cs | 61 +++- MewtocolNet/MewtocolInterface.cs | 278 ++++++++++-------- .../MewtocolInterfaceRegisterHandling.cs | 44 ++- MewtocolNet/MewtocolInterfaceRequests.cs | 118 ++++++-- MewtocolNet/MewtocolInterfaceSerial.cs | 4 +- MewtocolNet/MewtocolInterfaceTcp.cs | 57 ++-- MewtocolNet/PLCInfo.cs | 12 + MewtocolNet/PlcMetadata.cs | 56 ++++ MewtocolNet/Registers/Base/Register.cs | 2 + .../Registers/Classes/StringRegister.cs | 4 +- MewtocolNet/SetupClasses/InterfaceSettings.cs | 10 + MewtocolNet/UnderlyingRegisters/DTArea.cs | 8 +- .../UnderlyingRegisters/MemoryAreaManager.cs | 4 +- 21 files changed, 564 insertions(+), 213 deletions(-) create mode 100644 MewtocolNet/Helpers/PlcBitConverter.cs create mode 100644 MewtocolNet/PlcMetadata.cs diff --git a/Examples.BasicEthernet/Program.cs b/Examples.BasicEthernet/Program.cs index 7ec537c..810981b 100644 --- a/Examples.BasicEthernet/Program.cs +++ b/Examples.BasicEthernet/Program.cs @@ -26,7 +26,6 @@ internal class Program { //connect async to the plc await plc.ConnectAsync(); - await plc.SendCommandAsync($"%EE#RP0000000004"); //check if the connection was established if (!plc.IsConnected) { diff --git a/Examples.WPF/MainWindow.xaml b/Examples.WPF/MainWindow.xaml index 895407b..57867ca 100644 --- a/Examples.WPF/MainWindow.xaml +++ b/Examples.WPF/MainWindow.xaml @@ -8,7 +8,7 @@ mc:Ignorable="d" MinWidth="500" MinHeight="400" - Height="600" + Height="850" Width="800" Title="MewtocolNet WPF Demo"> @@ -100,7 +100,14 @@ - + + + + +