diff --git a/DocBuilder/Docs/plctypes.md b/DocBuilder/Docs/plctypes.md index 6bd3ce1..560648c 100644 --- a/DocBuilder/Docs/plctypes.md +++ b/DocBuilder/Docs/plctypes.md @@ -17,12 +17,24 @@ All supported PLC types for auto recognition are listed in this table. Other one Tested +πŸ“Ÿ ECOLOGIX + + + ELC500 + 0k +0x0710 +ECOLOGIX_0k__ELC500 +⚠️ + ❌ + ❌ + + πŸ“Ÿ FP0 C10, C14, C16 2.7k -0x40 +0x0040 FP0_2c7k__C10_C14_C16 ⚠️ ❌ @@ -31,7 +43,7 @@ All supported PLC types for auto recognition are listed in this table. Other one C32, SL1 5k -0x41 +0x0041 FP0_5k__C32_SL1 ⚠️ ❌ @@ -40,7 +52,7 @@ All supported PLC types for auto recognition are listed in this table. Other one T32 10k -0x42 +0x0042 FP0_10c0k__T32 ⚠️ ❌ @@ -52,7 +64,7 @@ All supported PLC types for auto recognition are listed in this table. Other one C32T/P 32k -0xB0 +0x00B0 FP0H_32k__C32TsP βœ… ❌ @@ -60,7 +72,7 @@ All supported PLC types for auto recognition are listed in this table. Other one C32ET/EP 32k -0xB1 +0x00B1 FP0H_32k__C32ETsEP βœ… ❌ @@ -71,7 +83,7 @@ All supported PLC types for auto recognition are listed in this table. Other one C10, C14, C16 16k -0x46 +0x0046 FP0R_16k__C10_C14_C16 βœ… ❌ @@ -79,7 +91,7 @@ All supported PLC types for auto recognition are listed in this table. Other one C32 32k -0x47 +0x0047 FP0R_32k__C32 βœ… ❌ @@ -87,7 +99,7 @@ All supported PLC types for auto recognition are listed in this table. Other one T32 32k -0x48 +0x0048 FP0R_32k__T32 βœ… ❌ @@ -95,7 +107,7 @@ All supported PLC types for auto recognition are listed in this table. Other one F32 32k -0x49 +0x0049 FP0R_32k__F32 βœ… ❌ @@ -106,7 +118,7 @@ All supported PLC types for auto recognition are listed in this table. Other one C14, C16 0.9k -0x04 +0x0004 FP1_0c9k__C14_C16_OR_FPdM_0c9k__C16T ⚠️ ❌ @@ -115,7 +127,7 @@ All supported PLC types for auto recognition are listed in this table. Other one C16T 0.9k -0x04 +0x0004 FP1_0c9k__C14_C16_OR_FPdM_0c9k__C16T ⚠️ ❌ @@ -124,7 +136,7 @@ All supported PLC types for auto recognition are listed in this table. Other one C24, C40 2.7k -0x05 +0x0005 FP1_2c7k__C24_C40_OR_FPdM_2c7k__C20R_C20T_C32T ⚠️ ❌ @@ -133,7 +145,7 @@ All supported PLC types for auto recognition are listed in this table. Other one C20R, C20T, C32T 2.7k -0x05 +0x0005 FP1_2c7k__C24_C40_OR_FPdM_2c7k__C20R_C20T_C32T ⚠️ ❌ @@ -142,7 +154,7 @@ All supported PLC types for auto recognition are listed in this table. Other one C56, C72 5k -0x06 +0x0006 FP1_5k__C56_C72_OR_FPdM_5k__C20RC_C20TC_C32TC ⚠️ ❌ @@ -151,7 +163,7 @@ All supported PLC types for auto recognition are listed in this table. Other one C20RC, C20TC, C32TC 5k -0x06 +0x0006 FP1_5k__C56_C72_OR_FPdM_5k__C20RC_C20TC_C32TC ⚠️ ❌ @@ -163,7 +175,7 @@ All supported PLC types for auto recognition are listed in this table. Other one - 30k -0x20 +0x0020 FP10_30k_OR_FP10_60k_OR_FP10S_30k ⚠️ ❌ @@ -172,7 +184,7 @@ All supported PLC types for auto recognition are listed in this table. Other one - 60k -0x20 +0x0020 FP10_30k_OR_FP10_60k_OR_FP10S_30k ⚠️ ❌ @@ -181,7 +193,7 @@ All supported PLC types for auto recognition are listed in this table. Other one - 30k -0x20 +0x0020 FP10_30k_OR_FP10_60k_OR_FP10S_30k ⚠️ ❌ @@ -193,7 +205,7 @@ All supported PLC types for auto recognition are listed in this table. Other one - 30k -0x30 +0x0030 FP10SH_30k_OR_FP10SH_60k_OR_FP10SH_120k ⚠️ ❌ @@ -202,7 +214,7 @@ All supported PLC types for auto recognition are listed in this table. Other one - 60k -0x30 +0x0030 FP10SH_30k_OR_FP10SH_60k_OR_FP10SH_120k ⚠️ ❌ @@ -211,7 +223,7 @@ All supported PLC types for auto recognition are listed in this table. Other one - 120k -0x30 +0x0030 FP10SH_30k_OR_FP10SH_60k_OR_FP10SH_120k ⚠️ ❌ @@ -223,7 +235,7 @@ All supported PLC types for auto recognition are listed in this table. Other one - 16k -0x50 +0x0050 FP2_16k_OR_FP2_32k ⚠️ ❌ @@ -232,7 +244,7 @@ All supported PLC types for auto recognition are listed in this table. Other one - 32k -0x50 +0x0050 FP2_16k_OR_FP2_32k ⚠️ ❌ @@ -244,7 +256,7 @@ All supported PLC types for auto recognition are listed in this table. Other one - 60k -0x60 +0x0060 FP2SH_60k ⚠️ βœ… @@ -253,7 +265,7 @@ All supported PLC types for auto recognition are listed in this table. Other one - 32k -0x62 +0x0062 FP2SH_32k ⚠️ βœ… @@ -262,7 +274,7 @@ All supported PLC types for auto recognition are listed in this table. Other one - 120k -0xE0 +0x00E0 FP2SH_120k ⚠️ βœ… @@ -274,7 +286,7 @@ All supported PLC types for auto recognition are listed in this table. Other one - 10k -0x03 +0x0003 FP3_10k ⚠️ ❌ @@ -286,7 +298,7 @@ All supported PLC types for auto recognition are listed in this table. Other one - 16k -0x13 +0x0013 FP3_16k_OR_FPdC_16k ⚠️ ❌ @@ -295,7 +307,7 @@ All supported PLC types for auto recognition are listed in this table. Other one - 16k -0x13 +0x0013 FP3_16k_OR_FPdC_16k ⚠️ ❌ @@ -307,7 +319,7 @@ All supported PLC types for auto recognition are listed in this table. Other one - 16k -0x02 +0x0002 FP5_16k ⚠️ ❌ @@ -316,19 +328,78 @@ All supported PLC types for auto recognition are listed in this table. Other one - 24k -0x12 +0x0012 FP5_24k ⚠️ ❌ ❌ +πŸ“Ÿ FP7 + + + CPS41E + 196k +0x0703 +FP7_196k__CPS41E + ❌ + ❌ + + + CPS31E + 120k +0x0704 +FP7_120k__CPS31E + ❌ + ❌ + + + CPS31 + 120k +0x0705 +FP7_120k__CPS31 + ❌ + ❌ + + + CPS41ES + 196k +0x0706 +FP7_196k__CPS41ES + ❌ + ❌ + + + CPS31ES + 120k +0x0707 +FP7_120k__CPS31ES + ❌ + ❌ + + + CPS31S + 120k +0x0708 +FP7_120k__CPS31S + ❌ + ❌ + + + CPS21 + 64k +0x0709 +FP7_64k__CPS21 + ❌ + ❌ + + πŸ“Ÿ FP-e - 2.7k -0x45 +0x0045 FPde_2c7k ⚠️ βœ… @@ -340,7 +411,7 @@ All supported PLC types for auto recognition are listed in this table. Other one - 12k -0x43 +0x0043 FPdSIGMA_12k ⚠️ βœ… @@ -349,7 +420,7 @@ All supported PLC types for auto recognition are listed in this table. Other one - 32k -0x44 +0x0044 FPdSIGMA_32k ⚠️ βœ… @@ -358,7 +429,7 @@ All supported PLC types for auto recognition are listed in this table. Other one - 16k -0xE1 +0x00E1 FPdSIGMA_16k_OR_FPdSIGMA_40k ⚠️ βœ… @@ -367,7 +438,7 @@ All supported PLC types for auto recognition are listed in this table. Other one - 40k -0xE1 +0x00E1 FPdSIGMA_16k_OR_FPdSIGMA_40k ⚠️ βœ… @@ -379,7 +450,7 @@ All supported PLC types for auto recognition are listed in this table. Other one C14R 16k -0x70 +0x0070 FPdX_16k__C14R ⚠️ βœ… @@ -388,7 +459,7 @@ All supported PLC types for auto recognition are listed in this table. Other one C30R, C60R 32k -0x71 +0x0071 FPdX_32k__C30R_C60R ⚠️ βœ… @@ -397,7 +468,7 @@ All supported PLC types for auto recognition are listed in this table. Other one L14 16k -0x73 +0x0073 FPdX_16k__L14 ⚠️ βœ… @@ -406,7 +477,7 @@ All supported PLC types for auto recognition are listed in this table. Other one L30, L60 32k -0x74 +0x0074 FPdX_32k__L30_L60 ⚠️ βœ… @@ -415,7 +486,7 @@ All supported PLC types for auto recognition are listed in this table. Other one C14T/P 16k -0x76 +0x0076 FPdX_16k__C14TsP ⚠️ βœ… @@ -424,7 +495,7 @@ All supported PLC types for auto recognition are listed in this table. Other one C30T/P, C60T/P, C38AT, C40T 32k -0x77 +0x0077 FPdX_32k__C30TsP_C60TsP_C38AT_C40T ⚠️ βœ… @@ -433,7 +504,7 @@ All supported PLC types for auto recognition are listed in this table. Other one C40RT0A 2.5k -0x7A +0x007A FPdX_2c5k__C40RT0A ⚠️ βœ… @@ -445,7 +516,7 @@ All supported PLC types for auto recognition are listed in this table. Other one L14, L30 2.5k -0x72 +0x0072 FPdX0_2c5k__L14_L30 ⚠️ βœ… @@ -454,7 +525,7 @@ All supported PLC types for auto recognition are listed in this table. Other one L40, L60 8k -0x75 +0x0075 FPdX0_8k__L40_L60 ⚠️ βœ… @@ -463,7 +534,7 @@ All supported PLC types for auto recognition are listed in this table. Other one L40, L60 16k -0x7F +0x007F FPdX0_16k__L40_L60 ⚠️ βœ… @@ -475,7 +546,7 @@ All supported PLC types for auto recognition are listed in this table. Other one C14R 16k -0xA0 +0x00A0 FPdXH_16k__C14R βœ… βœ… @@ -483,7 +554,7 @@ All supported PLC types for auto recognition are listed in this table. Other one C30R, C40R, C60R 32k -0xA1 +0x00A1 FPdXH_32k__C30R_C40R_C60R βœ… ❌ @@ -491,7 +562,7 @@ All supported PLC types for auto recognition are listed in this table. Other one C14T/P 16k -0xA4 +0x00A4 FPdXH_16k__C14TsP βœ… ❌ @@ -499,7 +570,7 @@ All supported PLC types for auto recognition are listed in this table. Other one C30T/P, C40T, C60T/P 32k -0xA5 +0x00A5 FPdXH_32k__C30TsP_C40T_C60TsP βœ… βœ… @@ -507,7 +578,7 @@ All supported PLC types for auto recognition are listed in this table. Other one C38AT 32k -0xA7 +0x00A7 FPdXH_32k__C38AT βœ… ❌ @@ -515,7 +586,7 @@ All supported PLC types for auto recognition are listed in this table. Other one M4T/L 32k -0xA8 +0x00A8 FPdXH_32k__M4TsL βœ… ❌ @@ -523,7 +594,7 @@ All supported PLC types for auto recognition are listed in this table. Other one M8N16T/P 32k -0xAC +0x00AC FPdXH_32k__M8N16TsP βœ… ❌ @@ -531,7 +602,7 @@ All supported PLC types for auto recognition are listed in this table. Other one M8N30T 32k -0xAD +0x00AD FPdXH_32k__M8N30T βœ… ❌ @@ -539,7 +610,7 @@ All supported PLC types for auto recognition are listed in this table. Other one C40ET, C60ET 32k -0xAE +0x00AE FPdXH_32k__C40ET_C60ET βœ… ❌ @@ -547,7 +618,7 @@ All supported PLC types for auto recognition are listed in this table. Other one C60ETF 32k -0xAF +0x00AF FPdXH_32k__C60ETF βœ… ❌ diff --git a/DocBuilder/Program.cs b/DocBuilder/Program.cs index 20ead02..bbb7263 100644 --- a/DocBuilder/Program.cs +++ b/DocBuilder/Program.cs @@ -63,7 +63,7 @@ void WritePlcTypeTable(IEnumerable vals) { decomposed = enu.ToNameDecompose(); - cpuOrMachCode = ((int)enu).ToString("X2"); + cpuOrMachCode = ((int)enu).ToString("X4"); ArgumentNullException.ThrowIfNull(decomposed); //first iteration @@ -147,5 +147,4 @@ markdownBuilder.AppendLine($"> These are PLCs that utilize the basic `%EE#RT` an WritePlcTypeTable(plcs); - File.WriteAllText(filePath, markdownBuilder.ToString()); \ No newline at end of file diff --git a/MewtocolNet/Helpers/AsyncQueue.cs b/MewtocolNet/Helpers/AsyncQueue.cs index 79ad62d..b2c9d47 100644 --- a/MewtocolNet/Helpers/AsyncQueue.cs +++ b/MewtocolNet/Helpers/AsyncQueue.cs @@ -3,7 +3,7 @@ using System.Collections.Generic; using System.Threading.Tasks; using System.Linq; -namespace MewtocolNet.Queue { +namespace MewtocolNet.Helpers { internal class AsyncQueue { diff --git a/MewtocolNet/Helpers/CodeDescriptions.cs b/MewtocolNet/Helpers/CodeDescriptions.cs index 9407856..6b295cf 100644 --- a/MewtocolNet/Helpers/CodeDescriptions.cs +++ b/MewtocolNet/Helpers/CodeDescriptions.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace MewtocolNet { +namespace MewtocolNet.Helpers { internal class CodeDescriptions { diff --git a/MewtocolNet/Helpers/LinqHelpers.cs b/MewtocolNet/Helpers/LinqHelpers.cs index d0afce3..03d9595 100644 --- a/MewtocolNet/Helpers/LinqHelpers.cs +++ b/MewtocolNet/Helpers/LinqHelpers.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.Text; -namespace MewtocolNet { +namespace MewtocolNet.Helpers { internal static class LinqHelpers { diff --git a/MewtocolNet/Helpers/MewtocolHelpers.cs b/MewtocolNet/Helpers/MewtocolHelpers.cs index 4da942c..91fbcfb 100644 --- a/MewtocolNet/Helpers/MewtocolHelpers.cs +++ b/MewtocolNet/Helpers/MewtocolHelpers.cs @@ -305,7 +305,7 @@ namespace MewtocolNet { /// /// Converts the enum to a plc name string /// - public static string ToName(this PlcType plcT) { + public static string ToName (this PlcType plcT) { if (plcT == 0) return "Unknown"; @@ -316,11 +316,11 @@ namespace MewtocolNet { /// /// Converts the enum to a decomposed struct /// - public static ParsedPlcName[] ToNameDecompose (this PlcType legacyT) { + public static ParsedPlcName[] ToNameDecompose (this PlcType plcT) { - if ((int)legacyT == 0) return Array.Empty(); + if ((int)plcT == 0) return Array.Empty(); - return ParsedPlcName.PlcDeconstruct(legacyT); + return ParsedPlcName.PlcDeconstruct(plcT); } diff --git a/MewtocolNet/MewtocolFrameResponse.cs b/MewtocolNet/MewtocolFrameResponse.cs index 0ff4547..5678466 100644 --- a/MewtocolNet/MewtocolFrameResponse.cs +++ b/MewtocolNet/MewtocolFrameResponse.cs @@ -1,6 +1,7 @@ ο»Ώusing System; using System.Collections.Generic; using System.Text; +using MewtocolNet.Helpers; namespace MewtocolNet { diff --git a/MewtocolNet/MewtocolInterface.cs b/MewtocolNet/MewtocolInterface.cs index 6fff0b2..2c14b27 100644 --- a/MewtocolNet/MewtocolInterface.cs +++ b/MewtocolNet/MewtocolInterface.cs @@ -1,5 +1,5 @@ ο»Ώusing MewtocolNet.Logging; -using MewtocolNet.Queue; +using MewtocolNet.Helpers; using MewtocolNet.Registers; using System; using System.Collections.Generic; diff --git a/MewtocolNet/MewtocolInterfaceTcp.cs b/MewtocolNet/MewtocolInterfaceTcp.cs index af5ffb2..f90181b 100644 --- a/MewtocolNet/MewtocolInterfaceTcp.cs +++ b/MewtocolNet/MewtocolInterfaceTcp.cs @@ -1,22 +1,9 @@ using MewtocolNet.Exceptions; using MewtocolNet.Logging; -using MewtocolNet.Queue; using MewtocolNet.RegisterAttributes; -using MewtocolNet.Registers; using System; -using System.Collections; -using System.Collections.Generic; -using System.ComponentModel; -using System.ComponentModel.Design; -using System.Diagnostics; -using System.IO; -using System.IO.Ports; -using System.Linq; using System.Net; using System.Net.Sockets; -using System.Runtime.CompilerServices; -using System.Text; -using System.Text.RegularExpressions; using System.Threading.Tasks; namespace MewtocolNet { diff --git a/MewtocolNet/PublicEnums/PlcSeriesType.cs b/MewtocolNet/PublicEnums/PlcSeriesType.cs deleted file mode 100644 index fde17cf..0000000 --- a/MewtocolNet/PublicEnums/PlcSeriesType.cs +++ /dev/null @@ -1,43 +0,0 @@ -ο»Ώusing System; -using System.Collections.Generic; -using System.Text; -namespace MewtocolNet { - - public enum PlcSeriesType { - - /// - /// FP7 CPS41E (Series code 7) - /// - FP7_CPS41E = 0x03, - /// - /// FP7 CPS31E (Series code 7) - /// - FP7_CPS31E = 0x04, - /// - /// FP7 CPS31 (Series code 7) - /// - FP7_CPS31 = 0x05, - /// - /// FP7 CPS41ES (Series code 7) - /// - FP7_CPS41ES = 0x06, - /// - /// FP7 CPS31ES (Series code 7) - /// - FP7_CPS31ES = 0x07, - /// - /// FP7 CPS31S (Series code 7) - /// - FP7_CPS31S = 0x08, - /// - /// FP7 CPS21 (Series code 7) - /// - FP7_CPS21 = 0x09, - /// - /// EcoLogiX (Series code 7) - /// - EcoLogiX_ELC500 = 0x10, - - } - -} diff --git a/MewtocolNet/PublicEnums/PlcType.cs b/MewtocolNet/PublicEnums/PlcType.cs index 3ab4d1a..2a3ce36 100644 --- a/MewtocolNet/PublicEnums/PlcType.cs +++ b/MewtocolNet/PublicEnums/PlcType.cs @@ -8,7 +8,8 @@ namespace MewtocolNet { //MISSING! FP7 and EcoLogix /// - /// The type of the PLC, only appliable for non Mewtocol7-Com PLCs + /// The type of the PLC. Plcs that don't use the Mewtocol-7-Com protocol have only 2 hex digits, + /// All newer ones have 4 hex digits where the first byte defines the series type /// public enum PlcType { @@ -317,6 +318,49 @@ namespace MewtocolNet { #endregion + #region FP7 Family + + /// + /// FP7 CPS41E (Series code 7) + /// + FP7_196k__CPS41E = 0x0703, + /// + /// FP7 CPS31E (Series code 7) + /// + FP7_120k__CPS31E = 0x0704, + /// + /// FP7 CPS31 (Series code 7) + /// + FP7_120k__CPS31 = 0x0705, + /// + /// FP7 CPS41ES (Series code 7) + /// + FP7_196k__CPS41ES = 0x0706, + /// + /// FP7 CPS31ES (Series code 7) + /// + FP7_120k__CPS31ES = 0x0707, + /// + /// FP7 CPS31S (Series code 7) + /// + FP7_120k__CPS31S = 0x0708, + /// + /// FP7 CPS21 (Series code 7) + /// + FP7_64k__CPS21 = 0x0709, + + #endregion + + #region EcoLogicX Family + + /// + /// EcoLogiX (Series code 7) + /// + [PlcLegacy] + ECOLOGIX_0k__ELC500 = 0x0710, + + #endregion + } } \ No newline at end of file diff --git a/MewtocolTests/SkippedChecks.cs b/MewtocolTests/SkippedChecks.cs new file mode 100644 index 0000000..20857ff --- /dev/null +++ b/MewtocolTests/SkippedChecks.cs @@ -0,0 +1,36 @@ +ο»Ώusing MewtocolNet; +using MewtocolNet.DocAttributes; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using Xunit; +using Xunit.Abstractions; + +namespace MewtocolTests; + +public class SkippedChecks { + + private readonly ITestOutputHelper output; + + public SkippedChecks(ITestOutputHelper output) { + this.output = output; + } + + [Fact] + public void BuildBCCFrameGeneration() { + + var toSuccess = new List { + + typeof(PlcCodeTestedAttribute), + typeof(PlcEXRTAttribute), + typeof(PlcLegacyAttribute), + + }; + + Assert.NotNull(toSuccess); + + } + +} diff --git a/MewtocolTests/TestLinkedLists.cs b/MewtocolTests/TestLinkedLists.cs index 0f24484..f4c1f75 100644 --- a/MewtocolTests/TestLinkedLists.cs +++ b/MewtocolTests/TestLinkedLists.cs @@ -2,6 +2,8 @@ using MewtocolNet; using Xunit; using Xunit.Abstractions; +using MewtocolNet.Helpers; + namespace MewtocolTests { public class TestLinkedLists {