mirror of
https://github.com/OpenLogics/MewtocolNet.git
synced 2025-12-06 03:01:24 +00:00
Fix typecodes
This commit is contained in:
4
.github/workflows/test-pipeline.yml
vendored
4
.github/workflows/test-pipeline.yml
vendored
@@ -41,7 +41,7 @@ jobs:
|
|||||||
|
|
||||||
- name: 'Run docbuilder'
|
- name: 'Run docbuilder'
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
run: dotnet run --project "./DocBuilder/DocBuilder.csproj" "./DocBuilder/Docs/plctypes.md"
|
run: dotnet run --project "./AutoTools.DocBuilder/DocBuilder.csproj" "./AutoTools.DocBuilder/Docs/plctypes.md"
|
||||||
|
|
||||||
- name: 'Commit generated docs to branch'
|
- name: 'Commit generated docs to branch'
|
||||||
continue-on-error: true
|
continue-on-error: true
|
||||||
@@ -50,7 +50,7 @@ jobs:
|
|||||||
git checkout ${{ steps.extract_branch.outputs.branch }}
|
git checkout ${{ steps.extract_branch.outputs.branch }}
|
||||||
git config --local user.email "action@github.com"
|
git config --local user.email "action@github.com"
|
||||||
git config --local user.name "GitHub Action"
|
git config --local user.name "GitHub Action"
|
||||||
git add "./DocBuilder/Docs/plctypes.md" -f
|
git add "./AutoTools.DocBuilder/Docs/plctypes.md" -f
|
||||||
git commit -m "(AUTO_DOC) add documentation for branch ${{ steps.extract_branch.outputs.branch }}"
|
git commit -m "(AUTO_DOC) add documentation for branch ${{ steps.extract_branch.outputs.branch }}"
|
||||||
|
|
||||||
- name: 'Push docs commit'
|
- name: 'Push docs commit'
|
||||||
|
|||||||
17
AutoTools.ChmDataExtract/AutoTools.ChmDataExtract.csproj
Normal file
17
AutoTools.ChmDataExtract/AutoTools.ChmDataExtract.csproj
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<IsPublishable>false</IsPublishable>
|
||||||
|
<IsPackable>false</IsPackable>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\MewtocolNet\MewtocolNet.csproj"/>
|
||||||
|
<PackageReference Include="HtmlAgilityPack" Version="1.11.50" />
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
241
AutoTools.ChmDataExtract/Program.cs
Normal file
241
AutoTools.ChmDataExtract/Program.cs
Normal file
@@ -0,0 +1,241 @@
|
|||||||
|
using System.Collections.Specialized;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Text.RegularExpressions;
|
||||||
|
using HtmlAgilityPack;
|
||||||
|
using MewtocolNet;
|
||||||
|
|
||||||
|
namespace AutoTools.ChmDataExtract;
|
||||||
|
|
||||||
|
internal class Program {
|
||||||
|
|
||||||
|
const string sysVarsLoc = @"Panasonic-ID SUNX Control\Control FPWIN Pro 7\Mak\Res_Eng\SysVars.chm";
|
||||||
|
|
||||||
|
const string sysVarsTempPath = @"Decomp";
|
||||||
|
|
||||||
|
static Dictionary<string, List<PlcType>> plcGroups = new() {
|
||||||
|
{ "FP7 CPS41/31 E/ES", new List<PlcType> {
|
||||||
|
PlcType.FP7_120k__CPS31E,
|
||||||
|
PlcType.FP7_196k__CPS41E,
|
||||||
|
PlcType.FP7_120k__CPS31ES,
|
||||||
|
PlcType.FP7_196k__CPS41ES,
|
||||||
|
}},
|
||||||
|
{ "FP7 CPS31/31S", new List<PlcType> {
|
||||||
|
PlcType.FP7_120k__CPS31,
|
||||||
|
PlcType.FP7_120k__CPS31S,
|
||||||
|
}},
|
||||||
|
{ "FP7 CPS21", new List<PlcType> {
|
||||||
|
PlcType.FP7_64k__CPS21,
|
||||||
|
}},
|
||||||
|
{ "ELC500", new List<PlcType> {
|
||||||
|
PlcType.ECOLOGIX_0k__ELC500,
|
||||||
|
}},
|
||||||
|
{ "FP-SIGMA 12k", new List<PlcType> {
|
||||||
|
PlcType.FPdSIGMA_12k,
|
||||||
|
PlcType.FPdSIGMA_16k,
|
||||||
|
}},
|
||||||
|
{ "FP-SIGMA 32k", new List<PlcType> {
|
||||||
|
PlcType.FPdSIGMA_32k,
|
||||||
|
PlcType.FPdSIGMA_40k,
|
||||||
|
}},
|
||||||
|
{ "FP0R 16k/32k C types", new List<PlcType> {
|
||||||
|
PlcType.FP0R_16k__C10_C14_C16,
|
||||||
|
PlcType.FP0R_32k__C32,
|
||||||
|
}},
|
||||||
|
{ "FP0R 32k T32", new List<PlcType> {
|
||||||
|
PlcType.FP0R_32k__T32,
|
||||||
|
PlcType.FP0R_32k__F32,
|
||||||
|
}},
|
||||||
|
{ "FP2 16k", new List<PlcType> {
|
||||||
|
PlcType.FP2_16k,
|
||||||
|
}},
|
||||||
|
{ "FP2 32k", new List<PlcType> {
|
||||||
|
PlcType.FP2_32k,
|
||||||
|
}},
|
||||||
|
{ "FP2SH 32k/60k/120k", new List<PlcType> {
|
||||||
|
PlcType.FP2SH_60k,
|
||||||
|
PlcType.FP2SH_60k,
|
||||||
|
PlcType.FP2SH_120k,
|
||||||
|
}},
|
||||||
|
{ "FP-X 16k/32k R-types", new List<PlcType> {
|
||||||
|
PlcType.FPdX_16k__C14R,
|
||||||
|
PlcType.FPdX_32k__C30R_C60R,
|
||||||
|
}},
|
||||||
|
{ "FP-X 16k/32k T-types", new List<PlcType> {
|
||||||
|
PlcType.FPdX_16k__C14TsP,
|
||||||
|
PlcType.FPdX_32k__C30TsP_C60TsP_C38AT_C40T,
|
||||||
|
}},
|
||||||
|
{"FP0H C32T/P ET/EP", new List<PlcType> {
|
||||||
|
PlcType.FP0H_32k__C32TsP,
|
||||||
|
PlcType.FP0H_32k__C32ETsEP,
|
||||||
|
}},
|
||||||
|
{ "FP-X 16k/32k L-types", new List<PlcType> {
|
||||||
|
PlcType.FPdX_16k__L14,
|
||||||
|
PlcType.FPdX_32k__L30_L60,
|
||||||
|
}},
|
||||||
|
{ "FP-X 2.5k C40RT0A", new List<PlcType> {
|
||||||
|
PlcType.FPdX_2c5k__C40RT0A,
|
||||||
|
}},
|
||||||
|
{ "FP-X0 2.5k L14,L30", new List<PlcType> {
|
||||||
|
PlcType.FPdX0_2c5k__L14_L30,
|
||||||
|
}},
|
||||||
|
{ "FP-X0 8k L40,L60", new List<PlcType> {
|
||||||
|
PlcType.FPdX0_8k__L40_L60,
|
||||||
|
}},
|
||||||
|
{ "FP-e 2.7k", new List<PlcType> {
|
||||||
|
PlcType.FPde_2c7k,
|
||||||
|
}},
|
||||||
|
{ "FP-XH 16k/32k R-types", new List<PlcType> {
|
||||||
|
PlcType.FPdXH_16k__C14R,
|
||||||
|
PlcType.FPdXH_32k__C30R_C40R_C60R,
|
||||||
|
}},
|
||||||
|
{ "FP-XH 16k/32k T-types", new List<PlcType> {
|
||||||
|
PlcType.FPdXH_16k__C14TsP,
|
||||||
|
PlcType.FPdXH_32k__C30TsP_C40T_C60TsP,
|
||||||
|
PlcType.FPdXH_32k__C30TsP_C40T_C60TsP,
|
||||||
|
PlcType.FPdXH_32k__C38AT,
|
||||||
|
PlcType.FPdXH_32k__C40ET_C60ET,
|
||||||
|
PlcType.FPdXH_32k__C60ETF,
|
||||||
|
}},
|
||||||
|
{ "FP-XH M4/M8 types", new List<PlcType> {
|
||||||
|
PlcType.FPdXH_32k__M4TsL,
|
||||||
|
PlcType.FPdXH_32k__M8N16TsP,
|
||||||
|
PlcType.FPdXH_32k__M8N30T,
|
||||||
|
}},
|
||||||
|
};
|
||||||
|
|
||||||
|
class AddressException {
|
||||||
|
|
||||||
|
public string ExceptionTitle;
|
||||||
|
|
||||||
|
public string ForSysRegister;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static void Main(string[] args) => Task.Run(AsyncMain).Wait();
|
||||||
|
|
||||||
|
static async Task AsyncMain () {
|
||||||
|
|
||||||
|
CheckGroupCoverage();
|
||||||
|
|
||||||
|
await GetSystemRegisters();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static void CheckGroupCoverage () {
|
||||||
|
|
||||||
|
//foreach (var key in Enum.GetNames(PlcType)) {
|
||||||
|
|
||||||
|
//}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
static async Task GetSystemRegisters () {
|
||||||
|
|
||||||
|
var addressExceptions = new List<AddressException>();
|
||||||
|
|
||||||
|
var progLoc = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!;
|
||||||
|
var progFilesPath = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86);
|
||||||
|
var sysVarsPath = Path.Combine(progFilesPath, sysVarsLoc);
|
||||||
|
|
||||||
|
Directory.SetCurrentDirectory(progLoc);
|
||||||
|
File.Copy(sysVarsPath, "./SysVars.chm", true);
|
||||||
|
|
||||||
|
var startInfo = new ProcessStartInfo {
|
||||||
|
WorkingDirectory = progLoc,
|
||||||
|
FileName = "hh.exe",
|
||||||
|
Arguments = $"-decompile ./Decomp ./SysVars.chm",
|
||||||
|
};
|
||||||
|
|
||||||
|
//call the hh.exe decompiler for chm
|
||||||
|
if (!File.Exists("./Decomp/topics/availability.html")) {
|
||||||
|
var proc = Process.Start(startInfo)!;
|
||||||
|
proc.WaitForExit();
|
||||||
|
}
|
||||||
|
|
||||||
|
var doc = new HtmlDocument();
|
||||||
|
doc.Load("./Decomp/topics/availability.html");
|
||||||
|
|
||||||
|
//[contains(@class, 'table mainbody')]
|
||||||
|
foreach (HtmlNode table in doc.DocumentNode.SelectNodes("//table[1]")) {
|
||||||
|
|
||||||
|
var rows = table?.SelectSingleNode("tbody")?.SelectNodes("tr");
|
||||||
|
if (rows == null) continue;
|
||||||
|
|
||||||
|
string lastRegisterName = "Name";
|
||||||
|
|
||||||
|
int iSystemRegister = 0;
|
||||||
|
|
||||||
|
foreach (var row in rows) {
|
||||||
|
|
||||||
|
var columns = row.SelectNodes("td");
|
||||||
|
if (columns == null) continue;
|
||||||
|
|
||||||
|
//get var name
|
||||||
|
var varNameNode = columns?.FirstOrDefault()?.SelectSingleNode("p/a[contains(@class,'xref')]");
|
||||||
|
|
||||||
|
string registerAddress;
|
||||||
|
int iterateStart;
|
||||||
|
|
||||||
|
if (varNameNode != null) {
|
||||||
|
|
||||||
|
lastRegisterName = varNameNode.InnerText;
|
||||||
|
|
||||||
|
//get second col
|
||||||
|
var regAddressNode = columns?.ElementAtOrDefault(1)?.SelectSingleNode("p");
|
||||||
|
registerAddress = regAddressNode?.InnerText ?? "Null";
|
||||||
|
iterateStart = 2;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
//get first col
|
||||||
|
var regAddressNode = columns?.ElementAtOrDefault(0)?.SelectSingleNode("p");
|
||||||
|
registerAddress = regAddressNode?.InnerText ?? "Null";
|
||||||
|
iterateStart = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
//filter the address for annotations
|
||||||
|
var regexAnnotation = new Regex(@"\(.*\)");
|
||||||
|
var matchAnnotation = regexAnnotation.Match(registerAddress);
|
||||||
|
if (matchAnnotation.Success) {
|
||||||
|
|
||||||
|
registerAddress = regexAnnotation.Replace(registerAddress, "");
|
||||||
|
|
||||||
|
addressExceptions.Add(new AddressException {
|
||||||
|
ForSysRegister = lastRegisterName,
|
||||||
|
ExceptionTitle = matchAnnotation.Value,
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Console.Write($"Var: {lastRegisterName} | {registerAddress} ".PadRight(100, ' '));
|
||||||
|
|
||||||
|
for (int i = iterateStart, j = 0; i < columns?.Count + 1; i++) {
|
||||||
|
|
||||||
|
if (j >= plcGroups.Count - 1) continue;
|
||||||
|
|
||||||
|
var group = plcGroups.Keys.ToList()[j];
|
||||||
|
|
||||||
|
bool isChecked = columns?.ElementAtOrDefault(i)?.SelectSingleNode("p")?.InnerHtml != "";
|
||||||
|
|
||||||
|
Console.Write($"{(isChecked ? "1" : "0")}, ");
|
||||||
|
|
||||||
|
j++;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
Console.WriteLine();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (var item in addressExceptions.DistinctBy(x => x.ExceptionTitle)) {
|
||||||
|
|
||||||
|
Console.WriteLine($"{item.ForSysRegister} - {item.ExceptionTitle}");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
16
AutoTools.DocBuilder/AutoTools.DocBuilder.csproj
Normal file
16
AutoTools.DocBuilder/AutoTools.DocBuilder.csproj
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<Project Sdk="Microsoft.NET.Sdk">
|
||||||
|
|
||||||
|
<PropertyGroup>
|
||||||
|
<IsPublishable>false</IsPublishable>
|
||||||
|
<IsPackable>false</IsPackable>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<TargetFramework>net6.0</TargetFramework>
|
||||||
|
<ImplicitUsings>enable</ImplicitUsings>
|
||||||
|
<Nullable>enable</Nullable>
|
||||||
|
</PropertyGroup>
|
||||||
|
|
||||||
|
<ItemGroup>
|
||||||
|
<ProjectReference Include="..\MewtocolNet\MewtocolNet.csproj"/>
|
||||||
|
</ItemGroup>
|
||||||
|
|
||||||
|
</Project>
|
||||||
@@ -1,5 +1,16 @@
|
|||||||
# PLC Type Table
|
# PLC Type Table
|
||||||
All supported PLC types for auto recognition are listed in this table. Other ones might also be supported but are shown as unknown in the library
|
Auto Generated @ **2023-07-21 15:07:27Z**
|
||||||
|
|
||||||
|
All supported PLC types for auto recognition are listed in this table. Other ones might also be supported but are shown as unknown in the library. Some models are never uniquely identifiable by their typecode and need extra hints like Prog Capacity in EXRT or RT.
|
||||||
|
|
||||||
|
Typecode explained:
|
||||||
|
```
|
||||||
|
From left to right
|
||||||
|
0x
|
||||||
|
07 <= extended code (00 non mewtocol 7 devices)
|
||||||
|
20 <= Is hex for 32 (Prog capacity)
|
||||||
|
A5 <= Is the actual typecode, can overlap with others
|
||||||
|
```
|
||||||
> <b>Discontinued PLCs</b><br>
|
> <b>Discontinued PLCs</b><br>
|
||||||
> These are PLCs that are no longer sold by Panasonic. Marked with ⚠️
|
> These are PLCs that are no longer sold by Panasonic. Marked with ⚠️
|
||||||
|
|
||||||
@@ -22,7 +33,7 @@ All supported PLC types for auto recognition are listed in this table. Other one
|
|||||||
<tr>
|
<tr>
|
||||||
<td> ELC500 </td>
|
<td> ELC500 </td>
|
||||||
<td> 0k </td>
|
<td> 0k </td>
|
||||||
<td><code>0x0710</code></td>
|
<td><code>0x070010</code></td>
|
||||||
<td><i>ECOLOGIX_0k__ELC500</i></td>
|
<td><i>ECOLOGIX_0k__ELC500</i></td>
|
||||||
<td align=center>⚠️</td>
|
<td align=center>⚠️</td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
@@ -34,7 +45,7 @@ All supported PLC types for auto recognition are listed in this table. Other one
|
|||||||
<tr>
|
<tr>
|
||||||
<td> C10, C14, C16 </td>
|
<td> C10, C14, C16 </td>
|
||||||
<td> 2.7k </td>
|
<td> 2.7k </td>
|
||||||
<td><code>0x0040</code></td>
|
<td><code>0x000040</code></td>
|
||||||
<td><i>FP0_2c7k__C10_C14_C16</i></td>
|
<td><i>FP0_2c7k__C10_C14_C16</i></td>
|
||||||
<td align=center>⚠️</td>
|
<td align=center>⚠️</td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
@@ -43,7 +54,7 @@ All supported PLC types for auto recognition are listed in this table. Other one
|
|||||||
<tr>
|
<tr>
|
||||||
<td> C32, SL1 </td>
|
<td> C32, SL1 </td>
|
||||||
<td> 5k </td>
|
<td> 5k </td>
|
||||||
<td><code>0x0041</code></td>
|
<td><code>0x000041</code></td>
|
||||||
<td><i>FP0_5k__C32_SL1</i></td>
|
<td><i>FP0_5k__C32_SL1</i></td>
|
||||||
<td align=center>⚠️</td>
|
<td align=center>⚠️</td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
@@ -52,7 +63,7 @@ All supported PLC types for auto recognition are listed in this table. Other one
|
|||||||
<tr>
|
<tr>
|
||||||
<td> T32 </td>
|
<td> T32 </td>
|
||||||
<td> 10k </td>
|
<td> 10k </td>
|
||||||
<td><code>0x0042</code></td>
|
<td><code>0x000A42</code></td>
|
||||||
<td><i>FP0_10c0k__T32</i></td>
|
<td><i>FP0_10c0k__T32</i></td>
|
||||||
<td align=center>⚠️</td>
|
<td align=center>⚠️</td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
@@ -62,18 +73,18 @@ All supported PLC types for auto recognition are listed in this table. Other one
|
|||||||
<td colspan="7" height=50>📟 <b>FP0H</b> </td>
|
<td colspan="7" height=50>📟 <b>FP0H</b> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td> C32T/P </td>
|
<td> C32ET/EP </td>
|
||||||
<td> 32k </td>
|
<td> 32k </td>
|
||||||
<td><code>0x00B0</code></td>
|
<td><code>0x0020B1</code></td>
|
||||||
<td colspan="2"><i>FP0H_32k__C32TsP</i></td>
|
<td colspan="2"><i>FP0H_32k__C32ETsEP</i></td>
|
||||||
<td align=center> ✅ </td>
|
<td align=center> ✅ </td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td> C32ET/EP </td>
|
<td> C32T/P </td>
|
||||||
<td> 32k </td>
|
<td> 32k </td>
|
||||||
<td><code>0x00B1</code></td>
|
<td><code>0x0020B0</code></td>
|
||||||
<td colspan="2"><i>FP0H_32k__C32ETsEP</i></td>
|
<td colspan="2"><i>FP0H_32k__C32TsP</i></td>
|
||||||
<td align=center> ✅ </td>
|
<td align=center> ✅ </td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -83,7 +94,7 @@ All supported PLC types for auto recognition are listed in this table. Other one
|
|||||||
<tr>
|
<tr>
|
||||||
<td> C10, C14, C16 </td>
|
<td> C10, C14, C16 </td>
|
||||||
<td> 16k </td>
|
<td> 16k </td>
|
||||||
<td><code>0x0046</code></td>
|
<td><code>0x000046</code></td>
|
||||||
<td colspan="2"><i>FP0R_16k__C10_C14_C16</i></td>
|
<td colspan="2"><i>FP0R_16k__C10_C14_C16</i></td>
|
||||||
<td align=center> ✅ </td>
|
<td align=center> ✅ </td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
@@ -91,44 +102,35 @@ All supported PLC types for auto recognition are listed in this table. Other one
|
|||||||
<tr>
|
<tr>
|
||||||
<td> C32 </td>
|
<td> C32 </td>
|
||||||
<td> 32k </td>
|
<td> 32k </td>
|
||||||
<td><code>0x0047</code></td>
|
<td><code>0x002047</code></td>
|
||||||
<td colspan="2"><i>FP0R_32k__C32</i></td>
|
<td colspan="2"><i>FP0R_32k__C32</i></td>
|
||||||
<td align=center> ✅ </td>
|
<td align=center> ✅ </td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td> T32 </td>
|
|
||||||
<td> 32k </td>
|
|
||||||
<td><code>0x0048</code></td>
|
|
||||||
<td colspan="2"><i>FP0R_32k__T32</i></td>
|
|
||||||
<td align=center> ✅ </td>
|
|
||||||
<td align=center> ❌ </td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td> F32 </td>
|
<td> F32 </td>
|
||||||
<td> 32k </td>
|
<td> 32k </td>
|
||||||
<td><code>0x0049</code></td>
|
<td><code>0x002049</code></td>
|
||||||
<td colspan="2"><i>FP0R_32k__F32</i></td>
|
<td colspan="2"><i>FP0R_32k__F32</i></td>
|
||||||
<td align=center> ✅ </td>
|
<td align=center> ✅ </td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="7" height=50>📟 <b>FP1, FP-M</b> </td>
|
<td> T32 </td>
|
||||||
|
<td> 32k </td>
|
||||||
|
<td><code>0x002048</code></td>
|
||||||
|
<td colspan="2"><i>FP0R_32k__T32</i></td>
|
||||||
|
<td align=center> ✅ </td>
|
||||||
|
<td align=center> ❌ </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="7" height=50>📟 <b>FP1</b> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td> C14, C16 </td>
|
<td> C14, C16 </td>
|
||||||
<td> 0.9k </td>
|
<td> 0.9k </td>
|
||||||
<td><code>0x0004</code></td>
|
<td><code>0x000004</code></td>
|
||||||
<td><i>FP1_0c9k__C14_C16_OR_FPdM_0c9k__C16T</i></td>
|
<td><i>FP1_0c9k__C14_C16</i></td>
|
||||||
<td align=center>⚠️</td>
|
|
||||||
<td align=center> ❌ </td>
|
|
||||||
<td align=center> ❌ </td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td> C16T </td>
|
|
||||||
<td> 0.9k </td>
|
|
||||||
<td><code>0x0004</code></td>
|
|
||||||
<td><i>FP1_0c9k__C14_C16_OR_FPdM_0c9k__C16T</i></td>
|
|
||||||
<td align=center>⚠️</td>
|
<td align=center>⚠️</td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
@@ -136,17 +138,8 @@ All supported PLC types for auto recognition are listed in this table. Other one
|
|||||||
<tr>
|
<tr>
|
||||||
<td> C24, C40 </td>
|
<td> C24, C40 </td>
|
||||||
<td> 2.7k </td>
|
<td> 2.7k </td>
|
||||||
<td><code>0x0005</code></td>
|
<td><code>0x000005</code></td>
|
||||||
<td><i>FP1_2c7k__C24_C40_OR_FPdM_2c7k__C20R_C20T_C32T</i></td>
|
<td><i>FP1_2c7k__C24_C40</i></td>
|
||||||
<td align=center>⚠️</td>
|
|
||||||
<td align=center> ❌ </td>
|
|
||||||
<td align=center> ❌ </td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td> C20R, C20T, C32T </td>
|
|
||||||
<td> 2.7k </td>
|
|
||||||
<td><code>0x0005</code></td>
|
|
||||||
<td><i>FP1_2c7k__C24_C40_OR_FPdM_2c7k__C20R_C20T_C32T</i></td>
|
|
||||||
<td align=center>⚠️</td>
|
<td align=center>⚠️</td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
@@ -154,29 +147,20 @@ All supported PLC types for auto recognition are listed in this table. Other one
|
|||||||
<tr>
|
<tr>
|
||||||
<td> C56, C72 </td>
|
<td> C56, C72 </td>
|
||||||
<td> 5k </td>
|
<td> 5k </td>
|
||||||
<td><code>0x0006</code></td>
|
<td><code>0x000006</code></td>
|
||||||
<td><i>FP1_5k__C56_C72_OR_FPdM_5k__C20RC_C20TC_C32TC</i></td>
|
<td><i>FP1_5k__C56_C72</i></td>
|
||||||
<td align=center>⚠️</td>
|
<td align=center>⚠️</td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td> C20RC, C20TC, C32TC </td>
|
<td colspan="7" height=50>📟 <b>FP10</b> </td>
|
||||||
<td> 5k </td>
|
|
||||||
<td><code>0x0006</code></td>
|
|
||||||
<td><i>FP1_5k__C56_C72_OR_FPdM_5k__C20RC_C20TC_C32TC</i></td>
|
|
||||||
<td align=center>⚠️</td>
|
|
||||||
<td align=center> ❌ </td>
|
|
||||||
<td align=center> ❌ </td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan="7" height=50>📟 <b>FP10, FP10S</b> </td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td> - </td>
|
<td> - </td>
|
||||||
<td> 30k </td>
|
<td> 30k </td>
|
||||||
<td><code>0x0020</code></td>
|
<td><code>0x001E20</code></td>
|
||||||
<td><i>FP10_30k_OR_FP10_60k_OR_FP10S_30k</i></td>
|
<td><i>FP10_30k</i></td>
|
||||||
<td align=center>⚠️</td>
|
<td align=center>⚠️</td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
@@ -184,17 +168,20 @@ All supported PLC types for auto recognition are listed in this table. Other one
|
|||||||
<tr>
|
<tr>
|
||||||
<td> - </td>
|
<td> - </td>
|
||||||
<td> 60k </td>
|
<td> 60k </td>
|
||||||
<td><code>0x0020</code></td>
|
<td><code>0x003C20</code></td>
|
||||||
<td><i>FP10_30k_OR_FP10_60k_OR_FP10S_30k</i></td>
|
<td><i>FP10_60k</i></td>
|
||||||
<td align=center>⚠️</td>
|
<td align=center>⚠️</td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td colspan="7" height=50>📟 <b>FP10S</b> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
<td> - </td>
|
<td> - </td>
|
||||||
<td> 30k </td>
|
<td> 30k </td>
|
||||||
<td><code>0x0020</code></td>
|
<td><code>0x001E20</code></td>
|
||||||
<td><i>FP10_30k_OR_FP10_60k_OR_FP10S_30k</i></td>
|
<td><i>FP10S_30k</i></td>
|
||||||
<td align=center>⚠️</td>
|
<td align=center>⚠️</td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
@@ -205,8 +192,8 @@ All supported PLC types for auto recognition are listed in this table. Other one
|
|||||||
<tr>
|
<tr>
|
||||||
<td> - </td>
|
<td> - </td>
|
||||||
<td> 30k </td>
|
<td> 30k </td>
|
||||||
<td><code>0x0030</code></td>
|
<td><code>0x001E30</code></td>
|
||||||
<td><i>FP10SH_30k_OR_FP10SH_60k_OR_FP10SH_120k</i></td>
|
<td><i>FP10SH_30k</i></td>
|
||||||
<td align=center>⚠️</td>
|
<td align=center>⚠️</td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
@@ -214,8 +201,8 @@ All supported PLC types for auto recognition are listed in this table. Other one
|
|||||||
<tr>
|
<tr>
|
||||||
<td> - </td>
|
<td> - </td>
|
||||||
<td> 60k </td>
|
<td> 60k </td>
|
||||||
<td><code>0x0030</code></td>
|
<td><code>0x003C30</code></td>
|
||||||
<td><i>FP10SH_30k_OR_FP10SH_60k_OR_FP10SH_120k</i></td>
|
<td><i>FP10SH_60k</i></td>
|
||||||
<td align=center>⚠️</td>
|
<td align=center>⚠️</td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
@@ -223,8 +210,8 @@ All supported PLC types for auto recognition are listed in this table. Other one
|
|||||||
<tr>
|
<tr>
|
||||||
<td> - </td>
|
<td> - </td>
|
||||||
<td> 120k </td>
|
<td> 120k </td>
|
||||||
<td><code>0x0030</code></td>
|
<td><code>0x007830</code></td>
|
||||||
<td><i>FP10SH_30k_OR_FP10SH_60k_OR_FP10SH_120k</i></td>
|
<td><i>FP10SH_120k</i></td>
|
||||||
<td align=center>⚠️</td>
|
<td align=center>⚠️</td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
@@ -235,8 +222,8 @@ All supported PLC types for auto recognition are listed in this table. Other one
|
|||||||
<tr>
|
<tr>
|
||||||
<td> - </td>
|
<td> - </td>
|
||||||
<td> 16k </td>
|
<td> 16k </td>
|
||||||
<td><code>0x0050</code></td>
|
<td><code>0x001050</code></td>
|
||||||
<td><i>FP2_16k_OR_FP2_32k</i></td>
|
<td><i>FP2_16k</i></td>
|
||||||
<td align=center>⚠️</td>
|
<td align=center>⚠️</td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
@@ -244,8 +231,8 @@ All supported PLC types for auto recognition are listed in this table. Other one
|
|||||||
<tr>
|
<tr>
|
||||||
<td> - </td>
|
<td> - </td>
|
||||||
<td> 32k </td>
|
<td> 32k </td>
|
||||||
<td><code>0x0050</code></td>
|
<td><code>0x002050</code></td>
|
||||||
<td><i>FP2_16k_OR_FP2_32k</i></td>
|
<td><i>FP2_32k</i></td>
|
||||||
<td align=center>⚠️</td>
|
<td align=center>⚠️</td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
@@ -255,17 +242,8 @@ All supported PLC types for auto recognition are listed in this table. Other one
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td> - </td>
|
<td> - </td>
|
||||||
<td> 60k </td>
|
|
||||||
<td><code>0x0060</code></td>
|
|
||||||
<td><i>FP2SH_60k</i></td>
|
|
||||||
<td align=center>⚠️</td>
|
|
||||||
<td align=center> ✅ </td>
|
|
||||||
<td align=center> ❌ </td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td> - </td>
|
|
||||||
<td> 32k </td>
|
<td> 32k </td>
|
||||||
<td><code>0x0062</code></td>
|
<td><code>0x002062</code></td>
|
||||||
<td><i>FP2SH_32k</i></td>
|
<td><i>FP2SH_32k</i></td>
|
||||||
<td align=center>⚠️</td>
|
<td align=center>⚠️</td>
|
||||||
<td align=center> ✅ </td>
|
<td align=center> ✅ </td>
|
||||||
@@ -273,8 +251,17 @@ All supported PLC types for auto recognition are listed in this table. Other one
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td> - </td>
|
<td> - </td>
|
||||||
|
<td> 60k </td>
|
||||||
|
<td><code>0x003C60</code></td>
|
||||||
|
<td><i>FP2SH_60k</i></td>
|
||||||
|
<td align=center>⚠️</td>
|
||||||
|
<td align=center> ✅ </td>
|
||||||
|
<td align=center> ❌ </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td> - </td>
|
||||||
<td> 120k </td>
|
<td> 120k </td>
|
||||||
<td><code>0x00E0</code></td>
|
<td><code>0x0078E0</code></td>
|
||||||
<td><i>FP2SH_120k</i></td>
|
<td><i>FP2SH_120k</i></td>
|
||||||
<td align=center>⚠️</td>
|
<td align=center>⚠️</td>
|
||||||
<td align=center> ✅ </td>
|
<td align=center> ✅ </td>
|
||||||
@@ -286,29 +273,17 @@ All supported PLC types for auto recognition are listed in this table. Other one
|
|||||||
<tr>
|
<tr>
|
||||||
<td> - </td>
|
<td> - </td>
|
||||||
<td> 10k </td>
|
<td> 10k </td>
|
||||||
<td><code>0x0003</code></td>
|
<td><code>0x000A03</code></td>
|
||||||
<td><i>FP3_10k</i></td>
|
<td><i>FP3_10k</i></td>
|
||||||
<td align=center>⚠️</td>
|
<td align=center>⚠️</td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="7" height=50>📟 <b>FP3, FP-C</b> </td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td> - </td>
|
<td> - </td>
|
||||||
<td> 16k </td>
|
<td> 16k </td>
|
||||||
<td><code>0x0013</code></td>
|
<td><code>0x001013</code></td>
|
||||||
<td><i>FP3_16k_OR_FPdC_16k</i></td>
|
<td><i>FP3_16k</i></td>
|
||||||
<td align=center>⚠️</td>
|
|
||||||
<td align=center> ❌ </td>
|
|
||||||
<td align=center> ❌ </td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td> - </td>
|
|
||||||
<td> 16k </td>
|
|
||||||
<td><code>0x0013</code></td>
|
|
||||||
<td><i>FP3_16k_OR_FPdC_16k</i></td>
|
|
||||||
<td align=center>⚠️</td>
|
<td align=center>⚠️</td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
@@ -319,7 +294,7 @@ All supported PLC types for auto recognition are listed in this table. Other one
|
|||||||
<tr>
|
<tr>
|
||||||
<td> - </td>
|
<td> - </td>
|
||||||
<td> 16k </td>
|
<td> 16k </td>
|
||||||
<td><code>0x0002</code></td>
|
<td><code>0x001002</code></td>
|
||||||
<td><i>FP5_16k</i></td>
|
<td><i>FP5_16k</i></td>
|
||||||
<td align=center>⚠️</td>
|
<td align=center>⚠️</td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
@@ -328,7 +303,7 @@ All supported PLC types for auto recognition are listed in this table. Other one
|
|||||||
<tr>
|
<tr>
|
||||||
<td> - </td>
|
<td> - </td>
|
||||||
<td> 24k </td>
|
<td> 24k </td>
|
||||||
<td><code>0x0012</code></td>
|
<td><code>0x001812</code></td>
|
||||||
<td><i>FP5_24k</i></td>
|
<td><i>FP5_24k</i></td>
|
||||||
<td align=center>⚠️</td>
|
<td align=center>⚠️</td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
@@ -338,41 +313,33 @@ All supported PLC types for auto recognition are listed in this table. Other one
|
|||||||
<td colspan="7" height=50>📟 <b>FP7</b> </td>
|
<td colspan="7" height=50>📟 <b>FP7</b> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td> CPS41E </td>
|
<td> CPS21 </td>
|
||||||
<td> 196k </td>
|
<td> 64k </td>
|
||||||
<td><code>0x0703</code></td>
|
<td><code>0x074009</code></td>
|
||||||
<td colspan="2"><i>FP7_196k__CPS41E</i></td>
|
<td colspan="2"><i>FP7_64k__CPS21</i></td>
|
||||||
<td align=center> ❌ </td>
|
|
||||||
<td align=center> ❌ </td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td> CPS31E </td>
|
|
||||||
<td> 120k </td>
|
|
||||||
<td><code>0x0704</code></td>
|
|
||||||
<td colspan="2"><i>FP7_120k__CPS31E</i></td>
|
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td> CPS31 </td>
|
<td> CPS31 </td>
|
||||||
<td> 120k </td>
|
<td> 120k </td>
|
||||||
<td><code>0x0705</code></td>
|
<td><code>0x077805</code></td>
|
||||||
<td colspan="2"><i>FP7_120k__CPS31</i></td>
|
<td colspan="2"><i>FP7_120k__CPS31</i></td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td> CPS41ES </td>
|
<td> CPS31E </td>
|
||||||
<td> 196k </td>
|
<td> 120k </td>
|
||||||
<td><code>0x0706</code></td>
|
<td><code>0x077804</code></td>
|
||||||
<td colspan="2"><i>FP7_196k__CPS41ES</i></td>
|
<td colspan="2"><i>FP7_120k__CPS31E</i></td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td> CPS31ES </td>
|
<td> CPS31ES </td>
|
||||||
<td> 120k </td>
|
<td> 120k </td>
|
||||||
<td><code>0x0707</code></td>
|
<td><code>0x077807</code></td>
|
||||||
<td colspan="2"><i>FP7_120k__CPS31ES</i></td>
|
<td colspan="2"><i>FP7_120k__CPS31ES</i></td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
@@ -380,16 +347,36 @@ All supported PLC types for auto recognition are listed in this table. Other one
|
|||||||
<tr>
|
<tr>
|
||||||
<td> CPS31S </td>
|
<td> CPS31S </td>
|
||||||
<td> 120k </td>
|
<td> 120k </td>
|
||||||
<td><code>0x0708</code></td>
|
<td><code>0x077808</code></td>
|
||||||
<td colspan="2"><i>FP7_120k__CPS31S</i></td>
|
<td colspan="2"><i>FP7_120k__CPS31S</i></td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td> CPS21 </td>
|
<td> CPS41E </td>
|
||||||
<td> 64k </td>
|
<td> 196k </td>
|
||||||
<td><code>0x0709</code></td>
|
<td><code>0x07C403</code></td>
|
||||||
<td colspan="2"><i>FP7_64k__CPS21</i></td>
|
<td colspan="2"><i>FP7_196k__CPS41E</i></td>
|
||||||
|
<td align=center> ❌ </td>
|
||||||
|
<td align=center> ❌ </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td> CPS41ES </td>
|
||||||
|
<td> 196k </td>
|
||||||
|
<td><code>0x07C406</code></td>
|
||||||
|
<td colspan="2"><i>FP7_196k__CPS41ES</i></td>
|
||||||
|
<td align=center> ❌ </td>
|
||||||
|
<td align=center> ❌ </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="7" height=50>📟 <b>FP-C</b> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td> - </td>
|
||||||
|
<td> 16k </td>
|
||||||
|
<td><code>0x001013</code></td>
|
||||||
|
<td><i>FPdC_16k</i></td>
|
||||||
|
<td align=center>⚠️</td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -399,19 +386,49 @@ All supported PLC types for auto recognition are listed in this table. Other one
|
|||||||
<tr>
|
<tr>
|
||||||
<td> - </td>
|
<td> - </td>
|
||||||
<td> 2.7k </td>
|
<td> 2.7k </td>
|
||||||
<td><code>0x0045</code></td>
|
<td><code>0x000045</code></td>
|
||||||
<td><i>FPde_2c7k</i></td>
|
<td><i>FPde_2c7k</i></td>
|
||||||
<td align=center>⚠️</td>
|
<td align=center>⚠️</td>
|
||||||
<td align=center> ✅ </td>
|
<td align=center> ✅ </td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td colspan="7" height=50>📟 <b>FP-M</b> </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td> C16T </td>
|
||||||
|
<td> 0.9k </td>
|
||||||
|
<td><code>0x000004</code></td>
|
||||||
|
<td><i>FPdM_0c9k__C16T</i></td>
|
||||||
|
<td align=center>⚠️</td>
|
||||||
|
<td align=center> ❌ </td>
|
||||||
|
<td align=center> ❌ </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td> C20R, C20T, C32T </td>
|
||||||
|
<td> 2.7k </td>
|
||||||
|
<td><code>0x000005</code></td>
|
||||||
|
<td><i>FPdM_2c7k__C20R_C20T_C32T</i></td>
|
||||||
|
<td align=center>⚠️</td>
|
||||||
|
<td align=center> ❌ </td>
|
||||||
|
<td align=center> ❌ </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td> C20RC, C20TC, C32TC </td>
|
||||||
|
<td> 5k </td>
|
||||||
|
<td><code>0x000006</code></td>
|
||||||
|
<td><i>FPdM_5k__C20RC_C20TC_C32TC</i></td>
|
||||||
|
<td align=center>⚠️</td>
|
||||||
|
<td align=center> ❌ </td>
|
||||||
|
<td align=center> ❌ </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
<td colspan="7" height=50>📟 <b>FP-SIGMA</b> </td>
|
<td colspan="7" height=50>📟 <b>FP-SIGMA</b> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td> - </td>
|
<td> - </td>
|
||||||
<td> 12k </td>
|
<td> 12k </td>
|
||||||
<td><code>0x0043</code></td>
|
<td><code>0x000C43</code></td>
|
||||||
<td><i>FPdSIGMA_12k</i></td>
|
<td><i>FPdSIGMA_12k</i></td>
|
||||||
<td align=center>⚠️</td>
|
<td align=center>⚠️</td>
|
||||||
<td align=center> ✅ </td>
|
<td align=center> ✅ </td>
|
||||||
@@ -419,8 +436,17 @@ All supported PLC types for auto recognition are listed in this table. Other one
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td> - </td>
|
<td> - </td>
|
||||||
|
<td> 16k </td>
|
||||||
|
<td><code>0x0010E1</code></td>
|
||||||
|
<td><i>FPdSIGMA_16k</i></td>
|
||||||
|
<td align=center>⚠️</td>
|
||||||
|
<td align=center> ✅ </td>
|
||||||
|
<td align=center> ❌ </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td> - </td>
|
||||||
<td> 32k </td>
|
<td> 32k </td>
|
||||||
<td><code>0x0044</code></td>
|
<td><code>0x002044</code></td>
|
||||||
<td><i>FPdSIGMA_32k</i></td>
|
<td><i>FPdSIGMA_32k</i></td>
|
||||||
<td align=center>⚠️</td>
|
<td align=center>⚠️</td>
|
||||||
<td align=center> ✅ </td>
|
<td align=center> ✅ </td>
|
||||||
@@ -428,18 +454,9 @@ All supported PLC types for auto recognition are listed in this table. Other one
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td> - </td>
|
<td> - </td>
|
||||||
<td> 16k </td>
|
|
||||||
<td><code>0x00E1</code></td>
|
|
||||||
<td><i>FPdSIGMA_16k_OR_FPdSIGMA_40k</i></td>
|
|
||||||
<td align=center>⚠️</td>
|
|
||||||
<td align=center> ✅ </td>
|
|
||||||
<td align=center> ❌ </td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td> - </td>
|
|
||||||
<td> 40k </td>
|
<td> 40k </td>
|
||||||
<td><code>0x00E1</code></td>
|
<td><code>0x0028E1</code></td>
|
||||||
<td><i>FPdSIGMA_16k_OR_FPdSIGMA_40k</i></td>
|
<td><i>FPdSIGMA_40k</i></td>
|
||||||
<td align=center>⚠️</td>
|
<td align=center>⚠️</td>
|
||||||
<td align=center> ✅ </td>
|
<td align=center> ✅ </td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
@@ -448,19 +465,28 @@ All supported PLC types for auto recognition are listed in this table. Other one
|
|||||||
<td colspan="7" height=50>📟 <b>FP-X</b> </td>
|
<td colspan="7" height=50>📟 <b>FP-X</b> </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
<td> C40RT0A </td>
|
||||||
|
<td> 2.5k </td>
|
||||||
|
<td><code>0x00007A</code></td>
|
||||||
|
<td><i>FPdX_2c5k__C40RT0A</i></td>
|
||||||
|
<td align=center>⚠️</td>
|
||||||
|
<td align=center> ✅ </td>
|
||||||
|
<td align=center> ❌ </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
<td> C14R </td>
|
<td> C14R </td>
|
||||||
<td> 16k </td>
|
<td> 16k </td>
|
||||||
<td><code>0x0070</code></td>
|
<td><code>0x001070</code></td>
|
||||||
<td><i>FPdX_16k__C14R</i></td>
|
<td><i>FPdX_16k__C14R</i></td>
|
||||||
<td align=center>⚠️</td>
|
<td align=center>⚠️</td>
|
||||||
<td align=center> ✅ </td>
|
<td align=center> ✅ </td>
|
||||||
<td align=center> ✅ </td>
|
<td align=center> ✅ </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td> C30R, C60R </td>
|
<td> C14T/P </td>
|
||||||
<td> 32k </td>
|
<td> 16k </td>
|
||||||
<td><code>0x0071</code></td>
|
<td><code>0x001076</code></td>
|
||||||
<td><i>FPdX_32k__C30R_C60R</i></td>
|
<td><i>FPdX_16k__C14TsP</i></td>
|
||||||
<td align=center>⚠️</td>
|
<td align=center>⚠️</td>
|
||||||
<td align=center> ✅ </td>
|
<td align=center> ✅ </td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
@@ -468,26 +494,17 @@ All supported PLC types for auto recognition are listed in this table. Other one
|
|||||||
<tr>
|
<tr>
|
||||||
<td> L14 </td>
|
<td> L14 </td>
|
||||||
<td> 16k </td>
|
<td> 16k </td>
|
||||||
<td><code>0x0073</code></td>
|
<td><code>0x001073</code></td>
|
||||||
<td><i>FPdX_16k__L14</i></td>
|
<td><i>FPdX_16k__L14</i></td>
|
||||||
<td align=center>⚠️</td>
|
<td align=center>⚠️</td>
|
||||||
<td align=center> ✅ </td>
|
<td align=center> ✅ </td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td> L30, L60 </td>
|
<td> C30R, C60R </td>
|
||||||
<td> 32k </td>
|
<td> 32k </td>
|
||||||
<td><code>0x0074</code></td>
|
<td><code>0x002071</code></td>
|
||||||
<td><i>FPdX_32k__L30_L60</i></td>
|
<td><i>FPdX_32k__C30R_C60R</i></td>
|
||||||
<td align=center>⚠️</td>
|
|
||||||
<td align=center> ✅ </td>
|
|
||||||
<td align=center> ❌ </td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td> C14T/P </td>
|
|
||||||
<td> 16k </td>
|
|
||||||
<td><code>0x0076</code></td>
|
|
||||||
<td><i>FPdX_16k__C14TsP</i></td>
|
|
||||||
<td align=center>⚠️</td>
|
<td align=center>⚠️</td>
|
||||||
<td align=center> ✅ </td>
|
<td align=center> ✅ </td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
@@ -495,17 +512,17 @@ All supported PLC types for auto recognition are listed in this table. Other one
|
|||||||
<tr>
|
<tr>
|
||||||
<td> C30T/P, C60T/P, C38AT, C40T </td>
|
<td> C30T/P, C60T/P, C38AT, C40T </td>
|
||||||
<td> 32k </td>
|
<td> 32k </td>
|
||||||
<td><code>0x0077</code></td>
|
<td><code>0x002077</code></td>
|
||||||
<td><i>FPdX_32k__C30TsP_C60TsP_C38AT_C40T</i></td>
|
<td><i>FPdX_32k__C30TsP_C60TsP_C38AT_C40T</i></td>
|
||||||
<td align=center>⚠️</td>
|
<td align=center>⚠️</td>
|
||||||
<td align=center> ✅ </td>
|
<td align=center> ✅ </td>
|
||||||
<td align=center> ✅ </td>
|
<td align=center> ✅ </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td> C40RT0A </td>
|
<td> L30, L60 </td>
|
||||||
<td> 2.5k </td>
|
<td> 32k </td>
|
||||||
<td><code>0x007A</code></td>
|
<td><code>0x002074</code></td>
|
||||||
<td><i>FPdX_2c5k__C40RT0A</i></td>
|
<td><i>FPdX_32k__L30_L60</i></td>
|
||||||
<td align=center>⚠️</td>
|
<td align=center>⚠️</td>
|
||||||
<td align=center> ✅ </td>
|
<td align=center> ✅ </td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
@@ -516,7 +533,7 @@ All supported PLC types for auto recognition are listed in this table. Other one
|
|||||||
<tr>
|
<tr>
|
||||||
<td> L14, L30 </td>
|
<td> L14, L30 </td>
|
||||||
<td> 2.5k </td>
|
<td> 2.5k </td>
|
||||||
<td><code>0x0072</code></td>
|
<td><code>0x000072</code></td>
|
||||||
<td><i>FPdX0_2c5k__L14_L30</i></td>
|
<td><i>FPdX0_2c5k__L14_L30</i></td>
|
||||||
<td align=center>⚠️</td>
|
<td align=center>⚠️</td>
|
||||||
<td align=center> ✅ </td>
|
<td align=center> ✅ </td>
|
||||||
@@ -525,7 +542,7 @@ All supported PLC types for auto recognition are listed in this table. Other one
|
|||||||
<tr>
|
<tr>
|
||||||
<td> L40, L60 </td>
|
<td> L40, L60 </td>
|
||||||
<td> 8k </td>
|
<td> 8k </td>
|
||||||
<td><code>0x0075</code></td>
|
<td><code>0x000875</code></td>
|
||||||
<td><i>FPdX0_8k__L40_L60</i></td>
|
<td><i>FPdX0_8k__L40_L60</i></td>
|
||||||
<td align=center>⚠️</td>
|
<td align=center>⚠️</td>
|
||||||
<td align=center> ✅ </td>
|
<td align=center> ✅ </td>
|
||||||
@@ -534,7 +551,7 @@ All supported PLC types for auto recognition are listed in this table. Other one
|
|||||||
<tr>
|
<tr>
|
||||||
<td> L40, L60 </td>
|
<td> L40, L60 </td>
|
||||||
<td> 16k </td>
|
<td> 16k </td>
|
||||||
<td><code>0x007F</code></td>
|
<td><code>0x00107F</code></td>
|
||||||
<td><i>FPdX0_16k__L40_L60</i></td>
|
<td><i>FPdX0_16k__L40_L60</i></td>
|
||||||
<td align=center>⚠️</td>
|
<td align=center>⚠️</td>
|
||||||
<td align=center> ✅ </td>
|
<td align=center> ✅ </td>
|
||||||
@@ -546,31 +563,31 @@ All supported PLC types for auto recognition are listed in this table. Other one
|
|||||||
<tr>
|
<tr>
|
||||||
<td> C14R </td>
|
<td> C14R </td>
|
||||||
<td> 16k </td>
|
<td> 16k </td>
|
||||||
<td><code>0x00A0</code></td>
|
<td><code>0x0010A0</code></td>
|
||||||
<td colspan="2"><i>FPdXH_16k__C14R</i></td>
|
<td colspan="2"><i>FPdXH_16k__C14R</i></td>
|
||||||
<td align=center> ✅ </td>
|
<td align=center> ✅ </td>
|
||||||
<td align=center> ✅ </td>
|
<td align=center> ✅ </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td> C30R, C40R, C60R </td>
|
<td> C14T/P </td>
|
||||||
<td> 32k </td>
|
<td> 16k </td>
|
||||||
<td><code>0x00A1</code></td>
|
<td><code>0x0010A4</code></td>
|
||||||
<td colspan="2"><i>FPdXH_32k__C30R_C40R_C60R</i></td>
|
<td colspan="2"><i>FPdXH_16k__C14TsP</i></td>
|
||||||
<td align=center> ✅ </td>
|
<td align=center> ✅ </td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td> C14T/P </td>
|
<td> C30R, C40R, C60R </td>
|
||||||
<td> 16k </td>
|
<td> 32k </td>
|
||||||
<td><code>0x00A4</code></td>
|
<td><code>0x0020A1</code></td>
|
||||||
<td colspan="2"><i>FPdXH_16k__C14TsP</i></td>
|
<td colspan="2"><i>FPdXH_32k__C30R_C40R_C60R</i></td>
|
||||||
<td align=center> ✅ </td>
|
<td align=center> ✅ </td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td> C30T/P, C40T, C60T/P </td>
|
<td> C30T/P, C40T, C60T/P </td>
|
||||||
<td> 32k </td>
|
<td> 32k </td>
|
||||||
<td><code>0x00A5</code></td>
|
<td><code>0x0020A5</code></td>
|
||||||
<td colspan="2"><i>FPdXH_32k__C30TsP_C40T_C60TsP</i></td>
|
<td colspan="2"><i>FPdXH_32k__C30TsP_C40T_C60TsP</i></td>
|
||||||
<td align=center> ✅ </td>
|
<td align=center> ✅ </td>
|
||||||
<td align=center> ✅ </td>
|
<td align=center> ✅ </td>
|
||||||
@@ -578,39 +595,15 @@ All supported PLC types for auto recognition are listed in this table. Other one
|
|||||||
<tr>
|
<tr>
|
||||||
<td> C38AT </td>
|
<td> C38AT </td>
|
||||||
<td> 32k </td>
|
<td> 32k </td>
|
||||||
<td><code>0x00A7</code></td>
|
<td><code>0x0020A7</code></td>
|
||||||
<td colspan="2"><i>FPdXH_32k__C38AT</i></td>
|
<td colspan="2"><i>FPdXH_32k__C38AT</i></td>
|
||||||
<td align=center> ✅ </td>
|
<td align=center> ✅ </td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td> M4T/L </td>
|
|
||||||
<td> 32k </td>
|
|
||||||
<td><code>0x00A8</code></td>
|
|
||||||
<td colspan="2"><i>FPdXH_32k__M4TsL</i></td>
|
|
||||||
<td align=center> ✅ </td>
|
|
||||||
<td align=center> ❌ </td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td> M8N16T/P </td>
|
|
||||||
<td> 32k </td>
|
|
||||||
<td><code>0x00AC</code></td>
|
|
||||||
<td colspan="2"><i>FPdXH_32k__M8N16TsP</i></td>
|
|
||||||
<td align=center> ✅ </td>
|
|
||||||
<td align=center> ❌ </td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td> M8N30T </td>
|
|
||||||
<td> 32k </td>
|
|
||||||
<td><code>0x00AD</code></td>
|
|
||||||
<td colspan="2"><i>FPdXH_32k__M8N30T</i></td>
|
|
||||||
<td align=center> ✅ </td>
|
|
||||||
<td align=center> ❌ </td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td> C40ET, C60ET </td>
|
<td> C40ET, C60ET </td>
|
||||||
<td> 32k </td>
|
<td> 32k </td>
|
||||||
<td><code>0x00AE</code></td>
|
<td><code>0x0020AE</code></td>
|
||||||
<td colspan="2"><i>FPdXH_32k__C40ET_C60ET</i></td>
|
<td colspan="2"><i>FPdXH_32k__C40ET_C60ET</i></td>
|
||||||
<td align=center> ✅ </td>
|
<td align=center> ✅ </td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
@@ -618,11 +611,35 @@ All supported PLC types for auto recognition are listed in this table. Other one
|
|||||||
<tr>
|
<tr>
|
||||||
<td> C60ETF </td>
|
<td> C60ETF </td>
|
||||||
<td> 32k </td>
|
<td> 32k </td>
|
||||||
<td><code>0x00AF</code></td>
|
<td><code>0x0020AF</code></td>
|
||||||
<td colspan="2"><i>FPdXH_32k__C60ETF</i></td>
|
<td colspan="2"><i>FPdXH_32k__C60ETF</i></td>
|
||||||
<td align=center> ✅ </td>
|
<td align=center> ✅ </td>
|
||||||
<td align=center> ❌ </td>
|
<td align=center> ❌ </td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td> M4T/L </td>
|
||||||
|
<td> 32k </td>
|
||||||
|
<td><code>0x0020A8</code></td>
|
||||||
|
<td colspan="2"><i>FPdXH_32k__M4TsL</i></td>
|
||||||
|
<td align=center> ✅ </td>
|
||||||
|
<td align=center> ❌ </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td> M8N16T/P </td>
|
||||||
|
<td> 32k </td>
|
||||||
|
<td><code>0x0020AC</code></td>
|
||||||
|
<td colspan="2"><i>FPdXH_32k__M8N16TsP</i></td>
|
||||||
|
<td align=center> ✅ </td>
|
||||||
|
<td align=center> ❌ </td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td> M8N30T </td>
|
||||||
|
<td> 32k </td>
|
||||||
|
<td><code>0x0020AD</code></td>
|
||||||
|
<td colspan="2"><i>FPdXH_32k__M8N30T</i></td>
|
||||||
|
<td align=center> ✅ </td>
|
||||||
|
<td align=center> ❌ </td>
|
||||||
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
|
|
||||||
@@ -47,27 +47,6 @@
|
|||||||
| 1604 | System register size
|
| 1604 | System register size
|
||||||
| 96230000001480004 | ?
|
| 96230000001480004 | ?
|
||||||
|
|
||||||
### %EE$EX00RT with error
|
|
||||||
|
|
||||||
|Reponse Byte|Description|
|
|
||||||
|------------|-----------|
|
|
||||||
| 00 | Extended mode
|
|
||||||
| 32 | Data item count
|
|
||||||
| 70 | Machine type
|
|
||||||
| 00 | Version (Fixed to 00)
|
|
||||||
| 16 | Prog capacity in K
|
|
||||||
| 81 | Operation mode / status
|
|
||||||
| 00 | Link unit
|
|
||||||
| 60 | Error flag
|
|
||||||
| 0000 | Self diag error
|
|
||||||
| 50 | Version
|
|
||||||
| 02 | Hardware information
|
|
||||||
| 0 | Number of programs
|
|
||||||
| 4100 | Program size BCD
|
|
||||||
| 1600 | Header size (no. of words) bcd
|
|
||||||
| 1604 | System register size
|
|
||||||
| 96230000001480004 | ?
|
|
||||||
|
|
||||||
What are the last bytes?
|
What are the last bytes?
|
||||||
|
|
||||||
FP-X 16k C14R
|
FP-X 16k C14R
|
||||||
@@ -96,6 +75,76 @@ FP-XH 16k C14R
|
|||||||
| 60 | Error flag |
|
| 60 | Error flag |
|
||||||
| 0000 | Self diag error |
|
| 0000 | Self diag error |
|
||||||
|
|
||||||
|
## FP-X0 2.5k L14,L30
|
||||||
|
|
||||||
|
### %EE$RT
|
||||||
|
|
||||||
|
|Reponse Byte|Description|
|
||||||
|
|------------|-----------|
|
||||||
|
| 72 | Model code |
|
||||||
|
| 12 | Version |
|
||||||
|
| 02 | Prog capacity |
|
||||||
|
| 82 | Op mode |
|
||||||
|
| 00 | Link unit |
|
||||||
|
| 00 | Error flag |
|
||||||
|
| 0000 | Self diag error |
|
||||||
|
|
||||||
|
### %EE$EX00RT
|
||||||
|
|
||||||
|
|Reponse Byte|Description|
|
||||||
|
|------------|-----------|
|
||||||
|
| 00 | Extended mode
|
||||||
|
| 32 | Data item count
|
||||||
|
| 72 | Machine type
|
||||||
|
| 00 | Version (Fixed to 00)
|
||||||
|
| 02 | Prog capacity in K
|
||||||
|
| 82 | Operation mode / status
|
||||||
|
| 00 | Link unit
|
||||||
|
| 00 | Error flag
|
||||||
|
| 0000 | Self diag error
|
||||||
|
| 23 | Version
|
||||||
|
| 01 | Hardware information
|
||||||
|
| 0 | Number of programs
|
||||||
|
| 4100 | Program size BCD
|
||||||
|
| 0301 | Header size (no. of words) bcd
|
||||||
|
| 2819 | System register size
|
||||||
|
| 0000001480004 | ?
|
||||||
|
|
||||||
|
## FP0 2.7k C10,C14
|
||||||
|
|
||||||
|
### %EE$RT
|
||||||
|
|
||||||
|
|Reponse Byte|Description|
|
||||||
|
|------------|-----------|
|
||||||
|
| 05 | Model code |
|
||||||
|
| 12 | Version |
|
||||||
|
| 03 | Prog capacity |
|
||||||
|
| 82 | Op mode |
|
||||||
|
| 00 | Link unit |
|
||||||
|
| 00 | Error flag |
|
||||||
|
| 0000 | Self diag error |
|
||||||
|
|
||||||
|
### %EE$EX00RT
|
||||||
|
|
||||||
|
|Reponse Byte|Description|
|
||||||
|
|------------|-----------|
|
||||||
|
| 00 | Extended mode
|
||||||
|
| 32 | Data item count
|
||||||
|
| 40 | Machine type
|
||||||
|
| 00 | Version (Fixed to 00)
|
||||||
|
| 03 | Prog capacity in K
|
||||||
|
| 82 | Operation mode / status
|
||||||
|
| 00 | Link unit
|
||||||
|
| 00 | Error flag
|
||||||
|
| 0000 | Self diag error
|
||||||
|
| 23 | Version
|
||||||
|
| 01 | Hardware information
|
||||||
|
| 0 | Number of programs
|
||||||
|
| 4100 | Program size BCD
|
||||||
|
| 0301 | Header size (no. of words) bcd
|
||||||
|
| 2819 | System register size
|
||||||
|
| 20130000080070004 | ?
|
||||||
|
|
||||||
# Mewtocol-7 Com
|
# Mewtocol-7 Com
|
||||||
|
|
||||||
## Getting the status of the plc
|
## Getting the status of the plc
|
||||||
@@ -18,7 +18,7 @@ ArgumentNullException.ThrowIfNull(entryLoc);
|
|||||||
|
|
||||||
string filePath = null!;
|
string filePath = null!;
|
||||||
|
|
||||||
if(args.Length == 0) {
|
if (args.Length == 0) {
|
||||||
|
|
||||||
filePath = Path.Combine(entryLoc.Location, @"..\..\..\..\Docs\plctypes.md");
|
filePath = Path.Combine(entryLoc.Location, @"..\..\..\..\Docs\plctypes.md");
|
||||||
|
|
||||||
@@ -32,18 +32,14 @@ Console.WriteLine($"{filePath}");
|
|||||||
|
|
||||||
StringBuilder markdownBuilder = new StringBuilder();
|
StringBuilder markdownBuilder = new StringBuilder();
|
||||||
|
|
||||||
var plcs = Enum.GetValues(typeof(PlcType)).Cast<PlcType>().OrderBy(x => x.ToString());
|
var plcNames = Enum.GetNames<PlcType>().OrderBy(x => x).ToArray();
|
||||||
|
|
||||||
void WritePlcTypeTable(IEnumerable<PlcType> vals) {
|
void WritePlcTypeTable(string[] names) {
|
||||||
|
|
||||||
var groups = vals.GroupBy(x => x.ToNameDecompose()[0].Group)
|
var groups = names.Select(x => x.ToNameDecompose())
|
||||||
.SelectMany(grouping => grouping.OrderBy(b => (int)b))
|
.GroupBy(x => x.Group)
|
||||||
.GroupBy(
|
.SelectMany(g => g.OrderBy(x => x.Size))
|
||||||
x => string.Join(", ",
|
.GroupBy(x => x.Group);
|
||||||
x.ToNameDecompose()
|
|
||||||
.DistinctBy(y => y.Group)
|
|
||||||
.Select(y => y.Group))
|
|
||||||
);
|
|
||||||
|
|
||||||
markdownBuilder.AppendLine("<table>");
|
markdownBuilder.AppendLine("<table>");
|
||||||
|
|
||||||
@@ -51,19 +47,16 @@ void WritePlcTypeTable(IEnumerable<PlcType> vals) {
|
|||||||
|
|
||||||
foreach (var group in groups) {
|
foreach (var group in groups) {
|
||||||
|
|
||||||
group.OrderBy(x => (int)x);
|
group.OrderBy(x => x.TypeCode);
|
||||||
|
|
||||||
bool isFirstGroup = true;
|
bool isFirstGroup = true;
|
||||||
|
|
||||||
foreach (var enu in group) {
|
foreach (var enu in group) {
|
||||||
|
|
||||||
ParsedPlcName[] decomposed = null!;
|
|
||||||
string cpuOrMachCode = null!;
|
string cpuOrMachCode = null!;
|
||||||
|
|
||||||
decomposed = enu.ToNameDecompose();
|
cpuOrMachCode = enu.TypeCode.ToString("X6");
|
||||||
|
ArgumentNullException.ThrowIfNull(enu);
|
||||||
cpuOrMachCode = ((int)enu).ToString("X4");
|
|
||||||
ArgumentNullException.ThrowIfNull(decomposed);
|
|
||||||
|
|
||||||
//first iteration
|
//first iteration
|
||||||
if (isFirstIt) {
|
if (isFirstIt) {
|
||||||
@@ -84,7 +77,7 @@ void WritePlcTypeTable(IEnumerable<PlcType> vals) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isFirstGroup) {
|
if (isFirstGroup) {
|
||||||
|
|
||||||
markdownBuilder.AppendLine("<tr>");
|
markdownBuilder.AppendLine("<tr>");
|
||||||
|
|
||||||
@@ -96,32 +89,28 @@ void WritePlcTypeTable(IEnumerable<PlcType> vals) {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (var decomp in decomposed) {
|
markdownBuilder.AppendLine("<tr>");
|
||||||
|
|
||||||
markdownBuilder.AppendLine("<tr>");
|
markdownBuilder.AppendLine($"<td> {(enu.SubTypes.Length == 0 ? "-" : string.Join(", ", enu.SubTypes))} </td>");
|
||||||
|
markdownBuilder.AppendLine($"<td> {enu.Size}k </td>");
|
||||||
|
markdownBuilder.AppendLine($"<td><code>0x{cpuOrMachCode}</code></td>");
|
||||||
|
|
||||||
markdownBuilder.AppendLine($"<td> {(decomp.SubTypes.Length == 0 ? "-" : string.Join(", ", decomp.SubTypes))} </td>");
|
if (enu.IsDiscontinuedModel) {
|
||||||
markdownBuilder.AppendLine($"<td> {decomp.Size}k </td>");
|
|
||||||
markdownBuilder.AppendLine($"<td><code>0x{cpuOrMachCode}</code></td>");
|
|
||||||
|
|
||||||
if(enu.IsDiscontinued()) {
|
markdownBuilder.AppendLine($"<td><i>{enu.EncodedName}</i></td>");
|
||||||
|
markdownBuilder.AppendLine($"<td align=center>⚠️</td>");
|
||||||
|
|
||||||
markdownBuilder.AppendLine($"<td><i>{enu.ToString()}</i></td>");
|
} else {
|
||||||
markdownBuilder.AppendLine($"<td align=center>⚠️</td>");
|
|
||||||
|
|
||||||
} else {
|
markdownBuilder.AppendLine($"<td colspan=\"2\"><i>{enu.EncodedName}</i></td>");
|
||||||
|
|
||||||
markdownBuilder.AppendLine($"<td colspan=\"2\"><i>{enu.ToString()}</i></td>");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
markdownBuilder.AppendLine($"<td align=center> {(enu.IsEXRTPLC() ? "✅" : "❌")} </td>");
|
|
||||||
markdownBuilder.AppendLine($"<td align=center> {(enu.WasTestedLive() ? "✅" : "❌")} </td>");
|
|
||||||
|
|
||||||
markdownBuilder.AppendLine("</tr>");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
markdownBuilder.AppendLine($"<td align=center> {(enu.UsesEXRT ? "✅" : "❌")} </td>");
|
||||||
|
markdownBuilder.AppendLine($"<td align=center> {(enu.WasTestedLive ? "✅" : "❌")} </td>");
|
||||||
|
|
||||||
|
markdownBuilder.AppendLine("</tr>");
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -135,8 +124,20 @@ void WritePlcTypeTable(IEnumerable<PlcType> vals) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
markdownBuilder.AppendLine($"# PLC Type Table");
|
markdownBuilder.AppendLine($"# PLC Type Table");
|
||||||
markdownBuilder.AppendLine($"All supported PLC types for auto recognition are listed in this table. " +
|
markdownBuilder.AppendLine($"Auto Generated @ **{DateTime.Now.ToUniversalTime().ToString("u", CultureInfo.InvariantCulture)}**\n");
|
||||||
$"Other ones might also be supported but are shown as unknown in the library");
|
markdownBuilder.AppendLine(
|
||||||
|
$"All supported PLC types for auto recognition are listed in this table. " +
|
||||||
|
$"Other ones might also be supported but are shown as unknown in the library. " +
|
||||||
|
$"Some models are never uniquely identifiable by their typecode and need extra hints like Prog Capacity in EXRT or RT. \n\n" +
|
||||||
|
$"Typecode explained:\n" +
|
||||||
|
$"```\n" +
|
||||||
|
$"From left to right\n" +
|
||||||
|
$"0x\n" +
|
||||||
|
$"07 <= extended code (00 non mewtocol 7 devices)\n" +
|
||||||
|
$"20 <= Is hex for 32 (Prog capacity)\n" +
|
||||||
|
$"A5 <= Is the actual typecode, can overlap with others\n" +
|
||||||
|
$"```"
|
||||||
|
);
|
||||||
|
|
||||||
markdownBuilder.AppendLine($"> <b>Discontinued PLCs</b><br>");
|
markdownBuilder.AppendLine($"> <b>Discontinued PLCs</b><br>");
|
||||||
markdownBuilder.AppendLine($"> These are PLCs that are no longer sold by Panasonic. Marked with ⚠️\n");
|
markdownBuilder.AppendLine($"> These are PLCs that are no longer sold by Panasonic. Marked with ⚠️\n");
|
||||||
@@ -144,6 +145,6 @@ markdownBuilder.AppendLine($"> These are PLCs that are no longer sold by Panason
|
|||||||
markdownBuilder.AppendLine($"> <b>EXRT PLCs</b><br>");
|
markdownBuilder.AppendLine($"> <b>EXRT PLCs</b><br>");
|
||||||
markdownBuilder.AppendLine($"> These are PLCs that utilize the basic `%EE#RT` and `%EE#EX00RT` command. All newer models do this. Old models only use the `%EE#RT` command.\n");
|
markdownBuilder.AppendLine($"> These are PLCs that utilize the basic `%EE#RT` and `%EE#EX00RT` command. All newer models do this. Old models only use the `%EE#RT` command.\n");
|
||||||
|
|
||||||
WritePlcTypeTable(plcs);
|
WritePlcTypeTable(plcNames);
|
||||||
|
|
||||||
File.WriteAllText(filePath, markdownBuilder.ToString());
|
File.WriteAllText(filePath, markdownBuilder.ToString());
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
<Project Sdk="Microsoft.NET.Sdk">
|
|
||||||
|
|
||||||
<PropertyGroup>
|
|
||||||
|
|
||||||
<IsPublishable>false</IsPublishable>
|
|
||||||
<IsPackable>false</IsPackable>
|
|
||||||
<OutputType>Exe</OutputType>
|
|
||||||
<TargetFramework>net6.0</TargetFramework>
|
|
||||||
<ImplicitUsings>enable</ImplicitUsings>
|
|
||||||
<Nullable>enable</Nullable>
|
|
||||||
|
|
||||||
</PropertyGroup>
|
|
||||||
|
|
||||||
<ItemGroup>
|
|
||||||
<ProjectReference Include="..\MewtocolNet\MewtocolNet.csproj" />
|
|
||||||
</ItemGroup>
|
|
||||||
|
|
||||||
</Project>
|
|
||||||
@@ -13,8 +13,7 @@ internal class Program {
|
|||||||
static async Task AsyncMain () {
|
static async Task AsyncMain () {
|
||||||
|
|
||||||
//the library provides a logging tool, comment this out if needed
|
//the library provides a logging tool, comment this out if needed
|
||||||
Logger.LogLevel = LogLevel.Verbose;
|
Logger.LogLevel = LogLevel.Critical;
|
||||||
Logger.OnNewLogMessage((d, l, m) => Console.WriteLine($"{d}: {m}"));
|
|
||||||
|
|
||||||
//create a new interface to the plc using ethernet / tcp ip
|
//create a new interface to the plc using ethernet / tcp ip
|
||||||
//the using keyword is optional, if you want to use your PLC instance
|
//the using keyword is optional, if you want to use your PLC instance
|
||||||
@@ -58,6 +57,11 @@ internal class Program {
|
|||||||
plc.ConfigureConnection("192.168.115.212", 9094);
|
plc.ConfigureConnection("192.168.115.212", 9094);
|
||||||
await plc.ConnectAsync();
|
await plc.ConnectAsync();
|
||||||
|
|
||||||
|
plc.Disconnect();
|
||||||
|
|
||||||
|
plc.ConfigureConnection("192.168.115.214", 9094);
|
||||||
|
await plc.ConnectAsync();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//you can also find any applicable source endpoints by using:
|
//you can also find any applicable source endpoints by using:
|
||||||
|
|||||||
@@ -6,7 +6,8 @@ namespace Examples.BasicRegisterReadWrite;
|
|||||||
|
|
||||||
internal class Program {
|
internal class Program {
|
||||||
|
|
||||||
const string PLC_IP = "192.168.178.55";
|
//const string PLC_IP = "192.168.178.55";
|
||||||
|
const string PLC_IP = "192.168.115.210";
|
||||||
|
|
||||||
static void Main(string[] args) => Task.Run(AsyncMain).Wait();
|
static void Main(string[] args) => Task.Run(AsyncMain).Wait();
|
||||||
|
|
||||||
@@ -54,6 +55,8 @@ internal class Program {
|
|||||||
//a simple 2 dimensional ARRAY [0..2, 0..2] OF INT at DT2003
|
//a simple 2 dimensional ARRAY [0..2, 0..2] OF INT at DT2003
|
||||||
b.Struct<short>("DT2003").AsArray(3, 3).Build(out simpleNumberRegister2Dim);
|
b.Struct<short>("DT2003").AsArray(3, 3).Build(out simpleNumberRegister2Dim);
|
||||||
|
|
||||||
|
b.Struct<bool>("R19A").Build();
|
||||||
|
|
||||||
})
|
})
|
||||||
.Build();
|
.Build();
|
||||||
|
|
||||||
|
|||||||
@@ -7,17 +7,21 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MewtocolNet", "MewtocolNet\
|
|||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MewtocolTests", "MewtocolTests\MewtocolTests.csproj", "{C1BF3AB0-CDFE-4070-A759-C3B25A20ABE1}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MewtocolTests", "MewtocolTests\MewtocolTests.csproj", "{C1BF3AB0-CDFE-4070-A759-C3B25A20ABE1}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DocBuilder", "DocBuilder\DocBuilder.csproj", "{50F2D23F-C875-4006-A0B6-7F5A181BC944}"
|
|
||||||
EndProject
|
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MewTerminal", "MewTerminal\MewTerminal.csproj", "{D1E751C6-296F-4CF1-AE28-C6D4388C7CF1}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MewTerminal", "MewTerminal\MewTerminal.csproj", "{D1E751C6-296F-4CF1-AE28-C6D4388C7CF1}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{323729B0-5FB2-4592-9FA6-220C46BBF84C}"
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Examples", "Examples", "{323729B0-5FB2-4592-9FA6-220C46BBF84C}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Examples.BasicEthernet", "Examples.BasicEthernet\Examples.BasicEthernet.csproj", "{80806065-163D-43F3-90CD-9221F391793F}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Examples.BasicEthernet", "Examples.BasicEthernet\Examples.BasicEthernet.csproj", "{80806065-163D-43F3-90CD-9221F391793F}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Examples.BasicRegisterReadWrite", "Examples.BasicRegisterReadWrite\Examples.BasicRegisterReadWrite.csproj", "{A24444C8-691D-44CB-8DE8-19618C6DE94B}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Examples.BasicRegisterReadWrite", "Examples.BasicRegisterReadWrite\Examples.BasicRegisterReadWrite.csproj", "{A24444C8-691D-44CB-8DE8-19618C6DE94B}"
|
||||||
EndProject
|
EndProject
|
||||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Examples.Polling", "Examples.Polling\Examples.Polling.csproj", "{9A36F2B1-FF9E-47BF-9931-3D3EB3C46B61}"
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Examples.Polling", "Examples.Polling\Examples.Polling.csproj", "{9A36F2B1-FF9E-47BF-9931-3D3EB3C46B61}"
|
||||||
|
EndProject
|
||||||
|
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "AutoTools", "AutoTools", "{BAEF983A-EFF2-48DF-A74E-57084166BB4D}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoTools.ChmDataExtract", "AutoTools.ChmDataExtract\AutoTools.ChmDataExtract.csproj", "{5A9DE453-AD64-4F8D-8215-3BB26674D164}"
|
||||||
|
EndProject
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AutoTools.DocBuilder", "AutoTools.DocBuilder\AutoTools.DocBuilder.csproj", "{00ACA0AB-3988-4EF7-98A6-B39A36B136DA}"
|
||||||
EndProject
|
EndProject
|
||||||
Global
|
Global
|
||||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
@@ -53,18 +57,6 @@ Global
|
|||||||
{C1BF3AB0-CDFE-4070-A759-C3B25A20ABE1}.Release|x64.Build.0 = Release|Any CPU
|
{C1BF3AB0-CDFE-4070-A759-C3B25A20ABE1}.Release|x64.Build.0 = Release|Any CPU
|
||||||
{C1BF3AB0-CDFE-4070-A759-C3B25A20ABE1}.Release|x86.ActiveCfg = Release|Any CPU
|
{C1BF3AB0-CDFE-4070-A759-C3B25A20ABE1}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
{C1BF3AB0-CDFE-4070-A759-C3B25A20ABE1}.Release|x86.Build.0 = Release|Any CPU
|
{C1BF3AB0-CDFE-4070-A759-C3B25A20ABE1}.Release|x86.Build.0 = Release|Any CPU
|
||||||
{50F2D23F-C875-4006-A0B6-7F5A181BC944}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
|
||||||
{50F2D23F-C875-4006-A0B6-7F5A181BC944}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
|
||||||
{50F2D23F-C875-4006-A0B6-7F5A181BC944}.Debug|x64.ActiveCfg = Debug|Any CPU
|
|
||||||
{50F2D23F-C875-4006-A0B6-7F5A181BC944}.Debug|x64.Build.0 = Debug|Any CPU
|
|
||||||
{50F2D23F-C875-4006-A0B6-7F5A181BC944}.Debug|x86.ActiveCfg = Debug|Any CPU
|
|
||||||
{50F2D23F-C875-4006-A0B6-7F5A181BC944}.Debug|x86.Build.0 = Debug|Any CPU
|
|
||||||
{50F2D23F-C875-4006-A0B6-7F5A181BC944}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
|
||||||
{50F2D23F-C875-4006-A0B6-7F5A181BC944}.Release|Any CPU.Build.0 = Release|Any CPU
|
|
||||||
{50F2D23F-C875-4006-A0B6-7F5A181BC944}.Release|x64.ActiveCfg = Release|Any CPU
|
|
||||||
{50F2D23F-C875-4006-A0B6-7F5A181BC944}.Release|x64.Build.0 = Release|Any CPU
|
|
||||||
{50F2D23F-C875-4006-A0B6-7F5A181BC944}.Release|x86.ActiveCfg = Release|Any CPU
|
|
||||||
{50F2D23F-C875-4006-A0B6-7F5A181BC944}.Release|x86.Build.0 = Release|Any CPU
|
|
||||||
{D1E751C6-296F-4CF1-AE28-C6D4388C7CF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
{D1E751C6-296F-4CF1-AE28-C6D4388C7CF1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
{D1E751C6-296F-4CF1-AE28-C6D4388C7CF1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
{D1E751C6-296F-4CF1-AE28-C6D4388C7CF1}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
{D1E751C6-296F-4CF1-AE28-C6D4388C7CF1}.Debug|x64.ActiveCfg = Debug|Any CPU
|
{D1E751C6-296F-4CF1-AE28-C6D4388C7CF1}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||||
@@ -113,6 +105,30 @@ Global
|
|||||||
{9A36F2B1-FF9E-47BF-9931-3D3EB3C46B61}.Release|x64.Build.0 = Release|Any CPU
|
{9A36F2B1-FF9E-47BF-9931-3D3EB3C46B61}.Release|x64.Build.0 = Release|Any CPU
|
||||||
{9A36F2B1-FF9E-47BF-9931-3D3EB3C46B61}.Release|x86.ActiveCfg = Release|Any CPU
|
{9A36F2B1-FF9E-47BF-9931-3D3EB3C46B61}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
{9A36F2B1-FF9E-47BF-9931-3D3EB3C46B61}.Release|x86.Build.0 = Release|Any CPU
|
{9A36F2B1-FF9E-47BF-9931-3D3EB3C46B61}.Release|x86.Build.0 = Release|Any CPU
|
||||||
|
{5A9DE453-AD64-4F8D-8215-3BB26674D164}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{5A9DE453-AD64-4F8D-8215-3BB26674D164}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{5A9DE453-AD64-4F8D-8215-3BB26674D164}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||||
|
{5A9DE453-AD64-4F8D-8215-3BB26674D164}.Debug|x64.Build.0 = Debug|Any CPU
|
||||||
|
{5A9DE453-AD64-4F8D-8215-3BB26674D164}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||||
|
{5A9DE453-AD64-4F8D-8215-3BB26674D164}.Debug|x86.Build.0 = Debug|Any CPU
|
||||||
|
{5A9DE453-AD64-4F8D-8215-3BB26674D164}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{5A9DE453-AD64-4F8D-8215-3BB26674D164}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{5A9DE453-AD64-4F8D-8215-3BB26674D164}.Release|x64.ActiveCfg = Release|Any CPU
|
||||||
|
{5A9DE453-AD64-4F8D-8215-3BB26674D164}.Release|x64.Build.0 = Release|Any CPU
|
||||||
|
{5A9DE453-AD64-4F8D-8215-3BB26674D164}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
|
{5A9DE453-AD64-4F8D-8215-3BB26674D164}.Release|x86.Build.0 = Release|Any CPU
|
||||||
|
{00ACA0AB-3988-4EF7-98A6-B39A36B136DA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{00ACA0AB-3988-4EF7-98A6-B39A36B136DA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{00ACA0AB-3988-4EF7-98A6-B39A36B136DA}.Debug|x64.ActiveCfg = Debug|Any CPU
|
||||||
|
{00ACA0AB-3988-4EF7-98A6-B39A36B136DA}.Debug|x64.Build.0 = Debug|Any CPU
|
||||||
|
{00ACA0AB-3988-4EF7-98A6-B39A36B136DA}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||||
|
{00ACA0AB-3988-4EF7-98A6-B39A36B136DA}.Debug|x86.Build.0 = Debug|Any CPU
|
||||||
|
{00ACA0AB-3988-4EF7-98A6-B39A36B136DA}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{00ACA0AB-3988-4EF7-98A6-B39A36B136DA}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
{00ACA0AB-3988-4EF7-98A6-B39A36B136DA}.Release|x64.ActiveCfg = Release|Any CPU
|
||||||
|
{00ACA0AB-3988-4EF7-98A6-B39A36B136DA}.Release|x64.Build.0 = Release|Any CPU
|
||||||
|
{00ACA0AB-3988-4EF7-98A6-B39A36B136DA}.Release|x86.ActiveCfg = Release|Any CPU
|
||||||
|
{00ACA0AB-3988-4EF7-98A6-B39A36B136DA}.Release|x86.Build.0 = Release|Any CPU
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(SolutionProperties) = preSolution
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
HideSolutionNode = FALSE
|
HideSolutionNode = FALSE
|
||||||
@@ -121,6 +137,8 @@ Global
|
|||||||
{80806065-163D-43F3-90CD-9221F391793F} = {323729B0-5FB2-4592-9FA6-220C46BBF84C}
|
{80806065-163D-43F3-90CD-9221F391793F} = {323729B0-5FB2-4592-9FA6-220C46BBF84C}
|
||||||
{A24444C8-691D-44CB-8DE8-19618C6DE94B} = {323729B0-5FB2-4592-9FA6-220C46BBF84C}
|
{A24444C8-691D-44CB-8DE8-19618C6DE94B} = {323729B0-5FB2-4592-9FA6-220C46BBF84C}
|
||||||
{9A36F2B1-FF9E-47BF-9931-3D3EB3C46B61} = {323729B0-5FB2-4592-9FA6-220C46BBF84C}
|
{9A36F2B1-FF9E-47BF-9931-3D3EB3C46B61} = {323729B0-5FB2-4592-9FA6-220C46BBF84C}
|
||||||
|
{5A9DE453-AD64-4F8D-8215-3BB26674D164} = {BAEF983A-EFF2-48DF-A74E-57084166BB4D}
|
||||||
|
{00ACA0AB-3988-4EF7-98A6-B39A36B136DA} = {BAEF983A-EFF2-48DF-A74E-57084166BB4D}
|
||||||
EndGlobalSection
|
EndGlobalSection
|
||||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
SolutionGuid = {4ABB8137-CD8F-4691-9802-9ED371012F47}
|
SolutionGuid = {4ABB8137-CD8F-4691-9802-9ED371012F47}
|
||||||
|
|||||||
@@ -230,27 +230,27 @@ namespace MewtocolNet {
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks if the register type is boolean
|
/// Checks if the register type is boolean
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static bool IsBoolean(this RegisterType type) {
|
internal static bool IsBoolean(this RegisterPrefix type) {
|
||||||
|
|
||||||
return type == RegisterType.X || type == RegisterType.Y || type == RegisterType.R;
|
return type == RegisterPrefix.X || type == RegisterPrefix.Y || type == RegisterPrefix.R;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks if the register type numeric
|
/// Checks if the register type numeric
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static bool IsNumericDTDDT(this RegisterType type) {
|
internal static bool IsNumericDTDDT(this RegisterPrefix type) {
|
||||||
|
|
||||||
return type == RegisterType.DT || type == RegisterType.DDT;
|
return type == RegisterPrefix.DT || type == RegisterPrefix.DDT;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Checks if the register type is an physical in or output of the plc
|
/// Checks if the register type is an physical in or output of the plc
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static bool IsPhysicalInOutType(this RegisterType type) {
|
internal static bool IsPhysicalInOutType(this RegisterPrefix type) {
|
||||||
|
|
||||||
return type == RegisterType.X || type == RegisterType.Y;
|
return type == RegisterPrefix.X || type == RegisterPrefix.Y;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -299,18 +299,29 @@ namespace MewtocolNet {
|
|||||||
|
|
||||||
if (plcT == 0) return "Unknown";
|
if (plcT == 0) return "Unknown";
|
||||||
|
|
||||||
return string.Join(" or ", ParsedPlcName.PlcDeconstruct(plcT).Select(x => x.WholeName));
|
if(!Enum.IsDefined(typeof(PlcType), plcT)) return "Unknown";
|
||||||
|
|
||||||
|
return ParsedPlcName.PlcDeconstruct(plcT.ToString()).ToString();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Converts the enum to a decomposed <see cref="ParsedPlcName"/> struct
|
/// Converts the enum to a decomposed <see cref="ParsedPlcName"/> struct
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static ParsedPlcName[] ToNameDecompose(this PlcType plcT) {
|
public static ParsedPlcName ToNameDecompose(this PlcType plcT) {
|
||||||
|
|
||||||
if ((int)plcT == 0) return Array.Empty<ParsedPlcName>();
|
if ((int)plcT == 0)
|
||||||
|
throw new NotSupportedException("No plc type found");
|
||||||
|
|
||||||
return ParsedPlcName.PlcDeconstruct(plcT);
|
if (!Enum.IsDefined(typeof(PlcType), plcT)) return null;
|
||||||
|
|
||||||
|
return ParsedPlcName.PlcDeconstruct(plcT.ToString());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
internal static ParsedPlcName ToNameDecompose(this string plcEnumString) {
|
||||||
|
|
||||||
|
return ParsedPlcName.PlcDeconstruct(plcEnumString);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ namespace MewtocolNet {
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// A structure containing the PLC name parsed
|
/// A structure containing the PLC name parsed
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public struct ParsedPlcName {
|
public class ParsedPlcName {
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Whole name of the PLC
|
/// Whole name of the PLC
|
||||||
@@ -31,51 +31,75 @@ namespace MewtocolNet {
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public string[] SubTypes { get; internal set; }
|
public string[] SubTypes { get; internal set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Typecode of the parsed string
|
||||||
|
/// </summary>
|
||||||
|
public int TypeCode { get; internal set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The encoded name, same as enum name
|
||||||
|
/// </summary>
|
||||||
|
public string EncodedName { get; internal set; }
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// True if the model is discontinued
|
||||||
|
/// </summary>
|
||||||
|
public bool IsDiscontinuedModel { get; internal set; }
|
||||||
|
|
||||||
|
internal bool WasTestedLive { get; set; }
|
||||||
|
|
||||||
|
internal bool UsesEXRT { get; set; }
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public override string ToString() => WholeName;
|
public override string ToString() => WholeName;
|
||||||
|
|
||||||
internal static ParsedPlcName[] PlcDeconstruct(PlcType plcT) {
|
internal static ParsedPlcName PlcDeconstruct(string wholeStr) {
|
||||||
|
|
||||||
string wholeStr = plcT.ToString();
|
|
||||||
|
|
||||||
var split = wholeStr.Replace("_OR_", "|").Split('|');
|
|
||||||
var reg = new Regex(@"(?<group>[A-Za-z0-9]*)_(?<size>[A-Za-z0-9]*)(?:__)?(?<additional>.*)");
|
var reg = new Regex(@"(?<group>[A-Za-z0-9]*)_(?<size>[A-Za-z0-9]*)(?:__)?(?<additional>.*)");
|
||||||
|
var match = reg.Match(wholeStr);
|
||||||
|
|
||||||
var retList = new List<ParsedPlcName>();
|
if (match.Success) {
|
||||||
|
|
||||||
foreach (var item in split) {
|
string groupStr = SanitizePlcEncodedString(match.Groups["group"].Value);
|
||||||
|
string sizeStr = SanitizePlcEncodedString(match.Groups["size"].Value);
|
||||||
|
float sizeFl = float.Parse(sizeStr.Replace("k", ""), NumberStyles.Float, CultureInfo.InvariantCulture);
|
||||||
|
string additionalStr = match.Groups["additional"].Value;
|
||||||
|
string[] subTypes = additionalStr.Split('_').Select(x => SanitizePlcEncodedString(x)).ToArray();
|
||||||
|
|
||||||
var match = reg.Match(item);
|
string wholeName = $"{groupStr} {sizeFl:0.##}k{(subTypes.Length > 0 ? " " : "")}{string.Join(",", subTypes)}";
|
||||||
|
|
||||||
if (match.Success) {
|
if (string.IsNullOrEmpty(subTypes[0]))
|
||||||
|
subTypes = Array.Empty<string>();
|
||||||
|
|
||||||
string groupStr = SanitizePlcEncodedString(match.Groups["group"].Value);
|
int typeCode = 999;
|
||||||
string sizeStr = SanitizePlcEncodedString(match.Groups["size"].Value);
|
bool discontinued = false, exrt = false, tested = false;
|
||||||
float sizeFl = float.Parse(sizeStr.Replace("k", ""), NumberStyles.Float, CultureInfo.InvariantCulture);
|
|
||||||
string additionalStr = match.Groups["additional"].Value;
|
|
||||||
string[] subTypes = additionalStr.Split('_').Select(x => SanitizePlcEncodedString(x)).ToArray();
|
|
||||||
|
|
||||||
string wholeName = $"{groupStr} {sizeFl:0.##}k{(subTypes.Length > 0 ? " " : "")}{string.Join(",", subTypes)}";
|
if(Enum.TryParse(wholeStr, out PlcType t)) {
|
||||||
|
|
||||||
if (string.IsNullOrEmpty(subTypes[0]))
|
typeCode = (int)t;
|
||||||
subTypes = Array.Empty<string>();
|
discontinued = t.IsDiscontinued();
|
||||||
|
exrt = t.IsEXRTPLC();
|
||||||
retList.Add(new ParsedPlcName {
|
tested = t.WasTestedLive();
|
||||||
Group = groupStr,
|
|
||||||
Size = sizeFl,
|
|
||||||
SubTypes = subTypes,
|
|
||||||
WholeName = wholeName,
|
|
||||||
});
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
throw new FormatException($"The plc enum was not formatted correctly: {item}");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
return new ParsedPlcName {
|
||||||
|
Group = groupStr,
|
||||||
|
Size = sizeFl,
|
||||||
|
SubTypes = subTypes,
|
||||||
|
WholeName = wholeName,
|
||||||
|
EncodedName = wholeStr,
|
||||||
|
TypeCode = typeCode,
|
||||||
|
IsDiscontinuedModel = discontinued,
|
||||||
|
UsesEXRT = exrt,
|
||||||
|
WasTestedLive = tested,
|
||||||
|
};
|
||||||
|
|
||||||
return retList.ToArray();
|
} else {
|
||||||
|
|
||||||
|
throw new FormatException($"The plc enum was not formatted correctly: {wholeStr}");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
|
<AssemblyAttribute Include="System.Runtime.CompilerServices.InternalsVisibleTo">
|
||||||
<_Parameter1>DocBuilder</_Parameter1>
|
<_Parameter1>AutoTools.DocBuilder</_Parameter1>
|
||||||
</AssemblyAttribute>
|
</AssemblyAttribute>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
using System.ComponentModel;
|
using System;
|
||||||
|
using System.ComponentModel;
|
||||||
using System.Globalization;
|
using System.Globalization;
|
||||||
|
using System.Linq;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
|
|
||||||
@@ -38,7 +40,7 @@ namespace MewtocolNet {
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Program capacity in 1K steps
|
/// Program capacity in 1K steps
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public int ProgramCapacity { get; internal set; }
|
public float ProgramCapacity { get; internal set; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Version of the cpu
|
/// Version of the cpu
|
||||||
@@ -94,9 +96,11 @@ namespace MewtocolNet {
|
|||||||
if (match.Success) {
|
if (match.Success) {
|
||||||
|
|
||||||
byte typeCodeByte = byte.Parse(match.Groups["mc"].Value, NumberStyles.HexNumber);
|
byte typeCodeByte = byte.Parse(match.Groups["mc"].Value, NumberStyles.HexNumber);
|
||||||
|
var overWriteBytes = BitConverter.GetBytes((int)this.TypeCode);
|
||||||
|
overWriteBytes[0] = typeCodeByte;
|
||||||
|
|
||||||
this.TypeCode = (PlcType)typeCodeByte;
|
this.TypeCode = (PlcType)BitConverter.ToInt32(overWriteBytes, 0);
|
||||||
this.CpuVersion = match.Groups["ver"].Value;
|
this.CpuVersion = match.Groups["ver"].Value.Insert(1, ".");
|
||||||
this.HardwareInformation = (HWInformation)byte.Parse(match.Groups["hwif"].Value, NumberStyles.HexNumber);
|
this.HardwareInformation = (HWInformation)byte.Parse(match.Groups["hwif"].Value, NumberStyles.HexNumber);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@@ -114,11 +118,27 @@ namespace MewtocolNet {
|
|||||||
if (match.Success) {
|
if (match.Success) {
|
||||||
|
|
||||||
byte typeCodeByte = byte.Parse(match.Groups["cputype"].Value, NumberStyles.HexNumber);
|
byte typeCodeByte = byte.Parse(match.Groups["cputype"].Value, NumberStyles.HexNumber);
|
||||||
|
byte capacity = byte.Parse(match.Groups["cap"].Value, NumberStyles.Number);
|
||||||
|
var typeCodeFull = (PlcType)BitConverter.ToInt32(new byte[] { typeCodeByte, capacity, 0, 0}, 0);
|
||||||
|
|
||||||
|
float definedProgCapacity = 0;
|
||||||
|
var composedNow = typeCodeFull.ToNameDecompose();
|
||||||
|
|
||||||
|
if (composedNow != null) {
|
||||||
|
|
||||||
|
//already recognized the type code, use the capacity value encoded in the enum
|
||||||
|
definedProgCapacity = composedNow.Size;
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
definedProgCapacity = int.Parse(match.Groups["cap"].Value);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
inf = new PLCInfo {
|
inf = new PLCInfo {
|
||||||
TypeCode = (PlcType)typeCodeByte,
|
TypeCode = typeCodeFull,
|
||||||
CpuVersion = match.Groups["cpuver"].Value,
|
CpuVersion = match.Groups["cpuver"].Value.Insert(1, "."),
|
||||||
ProgramCapacity = int.Parse(match.Groups["cap"].Value),
|
ProgramCapacity = definedProgCapacity,
|
||||||
SelfDiagnosticError = match.Groups["sdiag"].Value,
|
SelfDiagnosticError = match.Groups["sdiag"].Value,
|
||||||
OperationMode = (OPMode)byte.Parse(match.Groups["op"].Value, NumberStyles.HexNumber),
|
OperationMode = (OPMode)byte.Parse(match.Groups["op"].Value, NumberStyles.HexNumber),
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -7,9 +7,16 @@ namespace MewtocolNet {
|
|||||||
|
|
||||||
//MISSING! FP7 and EcoLogix
|
//MISSING! FP7 and EcoLogix
|
||||||
|
|
||||||
|
// Byte layout explained:
|
||||||
|
// PLCs that are identifiable by just one byte have just one byte as their code 0x00
|
||||||
|
// PLCs that are not identifiable by just one byte and also need a prog size param to identfy use the second byte for capacity 0x32_00 => 32k of type 00
|
||||||
|
// PLCs that use the mewtocol 7 identifcation method (currently only fp7 and EL500) use the third byte for their inital identifier (07 for fp7) => 0x07_00_09
|
||||||
|
// Sometimes the type is no directly identifable, then two types share the same code and make logically no difference
|
||||||
|
|
||||||
|
//special codes for mem size are: 02 = 2.5k, 03 = 2.7k
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The type of the PLC. Plcs that don't use the Mewtocol-7-Com protocol have only 2 hex digits,
|
/// Type identifier of the plc
|
||||||
/// All newer ones have 4 hex digits where the first byte defines the series type
|
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum PlcType {
|
public enum PlcType {
|
||||||
|
|
||||||
@@ -19,25 +26,29 @@ namespace MewtocolNet {
|
|||||||
/// FP5 16k
|
/// FP5 16k
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcLegacy]
|
[PlcLegacy]
|
||||||
FP5_16k = 0x02,
|
FP5_16k = 0x10_02,
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP5 24k
|
/// FP5 24k
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcLegacy]
|
[PlcLegacy]
|
||||||
FP5_24k = 0x12,
|
FP5_24k = 0x18_12,
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region FP2 Family (Legacy)
|
#region FP2 Family (Legacy)
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP2 16k OR FP2 32k
|
/// FP2 16k
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcLegacy]
|
[PlcLegacy]
|
||||||
FP2_16k_OR_FP2_32k = 0x50,
|
FP2_16k = 0x10_50,
|
||||||
|
|
||||||
//misses entry FP2 32k
|
/// <summary>
|
||||||
|
/// FP2 32k
|
||||||
|
/// </summary>
|
||||||
|
[PlcLegacy]
|
||||||
|
FP2_32k = 0x20_50,
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -47,54 +58,92 @@ namespace MewtocolNet {
|
|||||||
/// FP3 10k
|
/// FP3 10k
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcLegacy]
|
[PlcLegacy]
|
||||||
FP3_10k = 0x03,
|
FP3_10k = 0x0A_03,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP3 or FP-C 16k
|
/// FP-C 16k
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcLegacy]
|
[PlcLegacy]
|
||||||
FP3_16k_OR_FPdC_16k = 0x13,
|
FPdC_16k = 0x10_13,
|
||||||
|
/// <summary>
|
||||||
|
/// FP3
|
||||||
|
/// </summary>
|
||||||
|
[PlcLegacy]
|
||||||
|
FP3_16k = FPdC_16k,
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region FP1 / FPM Family (Legacy)
|
#region FP1 / FPM Family (Legacy)
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP1 0.9k C14,C16 or FP-M 0.9k C16T
|
/// FP1 0.9k C14,C16
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcLegacy]
|
[PlcLegacy]
|
||||||
FP1_0c9k__C14_C16_OR_FPdM_0c9k__C16T = 0x04,
|
FP1_0c9k__C14_C16 = 0x00_04,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP1 2.7k C24,C40 or FP-M 2.7k C20R,C20T,C32T
|
/// FP-M 0.9k C16T
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcLegacy]
|
[PlcLegacy]
|
||||||
FP1_2c7k__C24_C40_OR_FPdM_2c7k__C20R_C20T_C32T = 0x05,
|
FPdM_0c9k__C16T = FP1_0c9k__C14_C16,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP1 5.0k C56,C72 or FPM 5k C20RC,C20TC,C32TC
|
/// FP1 2.7k C24,C40
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcLegacy]
|
[PlcLegacy]
|
||||||
FP1_5k__C56_C72_OR_FPdM_5k__C20RC_C20TC_C32TC = 0x06,
|
FP1_2c7k__C24_C40 = 0x03_05,
|
||||||
|
/// <summary>
|
||||||
|
/// FP-M 2.7k C20R,C20T,C32T
|
||||||
|
/// </summary>
|
||||||
|
[PlcLegacy]
|
||||||
|
FPdM_2c7k__C20R_C20T_C32T = FP1_2c7k__C24_C40,
|
||||||
|
/// <summary>
|
||||||
|
/// FP1 5.0k C56,C72
|
||||||
|
/// </summary>
|
||||||
|
[PlcLegacy]
|
||||||
|
FP1_5k__C56_C72 = 0x00_06,
|
||||||
|
/// <summary>
|
||||||
|
/// FPM 5.0k C20RC,C20TC,C32TC
|
||||||
|
/// </summary>
|
||||||
|
[PlcLegacy]
|
||||||
|
FPdM_5k__C20RC_C20TC_C32TC = FP1_5k__C56_C72,
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region FP10 Family (Legacy)
|
#region FP10 Family (Legacy)
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP10 30k,60k OR FP10S 30k
|
/// FP10S 30k
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcLegacy]
|
[PlcLegacy]
|
||||||
FP10_30k_OR_FP10_60k_OR_FP10S_30k = 0x20,
|
FP10S_30k = 0x1E_20,
|
||||||
|
/// <summary>
|
||||||
//misses entry FP10 60k
|
/// FP10 30k
|
||||||
|
/// </summary>
|
||||||
|
[PlcLegacy]
|
||||||
|
FP10_30k = FP10S_30k,
|
||||||
|
/// <summary>
|
||||||
|
/// FP10 60k
|
||||||
|
/// </summary>
|
||||||
|
[PlcLegacy]
|
||||||
|
FP10_60k = 0x3C_20,
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region FP10SH Family (Legacy)
|
#region FP10SH Family (Legacy)
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP10SH 30k, 60k, 120k
|
/// FP10SH 30k
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcLegacy]
|
[PlcLegacy]
|
||||||
FP10SH_30k_OR_FP10SH_60k_OR_FP10SH_120k = 0x30,
|
FP10SH_30k = 0x1E_30,
|
||||||
|
/// <summary>
|
||||||
|
/// FP10SH 60k
|
||||||
|
/// </summary>
|
||||||
|
[PlcLegacy]
|
||||||
|
FP10SH_60k = 0x3C_30,
|
||||||
|
/// <summary>
|
||||||
|
/// FP10SH 120k
|
||||||
|
/// </summary>
|
||||||
|
[PlcLegacy]
|
||||||
|
FP10SH_120k = 0x78_30,
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -104,17 +153,17 @@ namespace MewtocolNet {
|
|||||||
/// FP0 2.7k C10,C14,C16
|
/// FP0 2.7k C10,C14,C16
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcLegacy]
|
[PlcLegacy]
|
||||||
FP0_2c7k__C10_C14_C16 = 0x40,
|
FP0_2c7k__C10_C14_C16 = 0x03_40,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP0 5k
|
/// FP0 5k
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcLegacy]
|
[PlcLegacy]
|
||||||
FP0_5k__C32_SL1 = 0x41,
|
FP0_5k__C32_SL1 = 0x00_41,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP0 10k
|
/// FP0 10k
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcLegacy]
|
[PlcLegacy]
|
||||||
FP0_10c0k__T32 = 0x42,
|
FP0_10c0k__T32 = 0x0A_42,
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -124,17 +173,22 @@ namespace MewtocolNet {
|
|||||||
/// FP-SIGMA 12k
|
/// FP-SIGMA 12k
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcLegacy, PlcEXRT]
|
[PlcLegacy, PlcEXRT]
|
||||||
FPdSIGMA_12k = 0x43,
|
FPdSIGMA_12k = 0x0C_43,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP-SIGMA 32k
|
/// FP-SIGMA 32k
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcLegacy, PlcEXRT]
|
[PlcLegacy, PlcEXRT]
|
||||||
FPdSIGMA_32k = 0x44,
|
FPdSIGMA_32k = 0x20_44,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP-SIGMA 16k or FP-SIGMA 40k
|
/// FP-SIGMA 16k
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcLegacy, PlcEXRT]
|
[PlcLegacy, PlcEXRT]
|
||||||
FPdSIGMA_16k_OR_FPdSIGMA_40k = 0xE1,
|
FPdSIGMA_16k = 0x10_E1,
|
||||||
|
/// <summary>
|
||||||
|
/// FP-SIGMA 40k (never supported)
|
||||||
|
/// </summary>
|
||||||
|
[PlcLegacy, PlcEXRT]
|
||||||
|
FPdSIGMA_40k = 0x28_E1,
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -144,7 +198,7 @@ namespace MewtocolNet {
|
|||||||
/// FP-e 2.7k
|
/// FP-e 2.7k
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcLegacy, PlcEXRT]
|
[PlcLegacy, PlcEXRT]
|
||||||
FPde_2c7k = 0x45,
|
FPde_2c7k = 0x03_45,
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -159,37 +213,37 @@ namespace MewtocolNet {
|
|||||||
/// FP0R 32k C32
|
/// FP0R 32k C32
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcEXRT]
|
[PlcEXRT]
|
||||||
FP0R_32k__C32 = 0x47,
|
FP0R_32k__C32 = 0x20_47,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP0R 32k T32
|
/// FP0R 32k T32
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcEXRT]
|
[PlcEXRT]
|
||||||
FP0R_32k__T32 = 0x48,
|
FP0R_32k__T32 = 0x20_48,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP0R 32k F32
|
/// FP0R 32k F32
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcEXRT]
|
[PlcEXRT]
|
||||||
FP0R_32k__F32 = 0x49,
|
FP0R_32k__F32 = 0x20_49,
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
#region FP2SH Family (Legacy)
|
#region FP2SH Family (Legacy)
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// FP2SH 60k
|
|
||||||
/// </summary>
|
|
||||||
[PlcLegacy, PlcEXRT]
|
|
||||||
FP2SH_60k = 0x60,
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP2SH 32k
|
/// FP2SH 32k
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcLegacy, PlcEXRT]
|
[PlcLegacy, PlcEXRT]
|
||||||
FP2SH_32k = 0x62,
|
FP2SH_32k = 0x20_62,
|
||||||
|
/// <summary>
|
||||||
|
/// FP2SH 60k
|
||||||
|
/// </summary>
|
||||||
|
[PlcLegacy, PlcEXRT]
|
||||||
|
FP2SH_60k = 0x3C_60,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP2SH 120k
|
/// FP2SH 120k
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcLegacy, PlcEXRT]
|
[PlcLegacy, PlcEXRT]
|
||||||
FP2SH_120k = 0xE0,
|
FP2SH_120k = 0x78_E0,
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -199,52 +253,52 @@ namespace MewtocolNet {
|
|||||||
/// FP-X 16k C14R
|
/// FP-X 16k C14R
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcLegacy, PlcEXRT, PlcCodeTested]
|
[PlcLegacy, PlcEXRT, PlcCodeTested]
|
||||||
FPdX_16k__C14R = 0x70,
|
FPdX_16k__C14R = 0x10_70,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP-X 32k C30R,C60R
|
/// FP-X 32k C30R,C60R
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcLegacy, PlcEXRT]
|
[PlcLegacy, PlcEXRT]
|
||||||
FPdX_32k__C30R_C60R = 0x71,
|
FPdX_32k__C30R_C60R = 0x20_71,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP-X0 2.5k L14,L30
|
/// FP-X0 2.5k L14,L30
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcLegacy, PlcEXRT]
|
[PlcLegacy, PlcEXRT]
|
||||||
FPdX0_2c5k__L14_L30 = 0x72,
|
FPdX0_2c5k__L14_L30 = 0x02_72,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP-X 16k L14
|
/// FP-X 16k L14
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcLegacy, PlcEXRT]
|
[PlcLegacy, PlcEXRT]
|
||||||
FPdX_16k__L14 = 0x73,
|
FPdX_16k__L14 = 0x10_73,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP-X 32k L30,L60
|
/// FP-X 32k L30,L60
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcLegacy, PlcEXRT]
|
[PlcLegacy, PlcEXRT]
|
||||||
FPdX_32k__L30_L60 = 0x74,
|
FPdX_32k__L30_L60 = 0x20_74,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP-X0 8k L40,L60
|
/// FP-X0 8k L40,L60
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcLegacy, PlcEXRT]
|
[PlcLegacy, PlcEXRT]
|
||||||
FPdX0_8k__L40_L60 = 0x75,
|
FPdX0_8k__L40_L60 = 0x08_75,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP-X 16k C14T/P
|
/// FP-X 16k C14T/P
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcLegacy, PlcEXRT]
|
[PlcLegacy, PlcEXRT]
|
||||||
FPdX_16k__C14TsP = 0x76,
|
FPdX_16k__C14TsP = 0x10_76,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP-X 32k C30T/P,C60T/P,C38AT,C40T
|
/// FP-X 32k C30T/P,C60T/P,C38AT,C40T
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcLegacy, PlcEXRT, PlcCodeTested]
|
[PlcLegacy, PlcEXRT, PlcCodeTested]
|
||||||
FPdX_32k__C30TsP_C60TsP_C38AT_C40T = 0x77,
|
FPdX_32k__C30TsP_C60TsP_C38AT_C40T = 0x20_77,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP-X 2.5k C40RT0A
|
/// FP-X 2.5k C40RT0A
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcLegacy, PlcEXRT]
|
[PlcLegacy, PlcEXRT]
|
||||||
FPdX_2c5k__C40RT0A = 0x7A,
|
FPdX_2c5k__C40RT0A = 0x02_7A,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP-X0 16k L40,L60
|
/// FP-X0 16k L40,L60
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcLegacy, PlcEXRT]
|
[PlcLegacy, PlcEXRT]
|
||||||
FPdX0_16k__L40_L60 = 0x7F,
|
FPdX0_16k__L40_L60 = 0x10_7F,
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -254,52 +308,52 @@ namespace MewtocolNet {
|
|||||||
/// FP-XH 16k C14R
|
/// FP-XH 16k C14R
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcEXRT, PlcCodeTested]
|
[PlcEXRT, PlcCodeTested]
|
||||||
FPdXH_16k__C14R = 0xA0,
|
FPdXH_16k__C14R = 0x10_A0,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP-XH 32k C30R,C40R,C60R
|
/// FP-XH 32k C30R,C40R,C60R
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcEXRT]
|
[PlcEXRT]
|
||||||
FPdXH_32k__C30R_C40R_C60R = 0xA1,
|
FPdXH_32k__C30R_C40R_C60R = 0x20_A1,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP-XH 16k C14T/P
|
/// FP-XH 16k C14T/P
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcEXRT]
|
[PlcEXRT]
|
||||||
FPdXH_16k__C14TsP = 0xA4,
|
FPdXH_16k__C14TsP = 0x10_A4,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP-XH 32k C30T/P,C40T,C60T/P
|
/// FP-XH 32k C30T/P,C40T,C60T/P
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcEXRT, PlcCodeTested]
|
[PlcEXRT, PlcCodeTested]
|
||||||
FPdXH_32k__C30TsP_C40T_C60TsP = 0xA5,
|
FPdXH_32k__C30TsP_C40T_C60TsP = 0x20_A5,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP-XH 32k C38AT
|
/// FP-XH 32k C38AT
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcEXRT]
|
[PlcEXRT]
|
||||||
FPdXH_32k__C38AT = 0xA7,
|
FPdXH_32k__C38AT = 0x20_A7,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP-XH 32k M4T/L
|
/// FP-XH 32k M4T/L
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcEXRT]
|
[PlcEXRT]
|
||||||
FPdXH_32k__M4TsL = 0xA8,
|
FPdXH_32k__M4TsL = 0x20_A8,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP-XH 32k M8N16T/P (RTEX)
|
/// FP-XH 32k M8N16T/P (RTEX)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcEXRT]
|
[PlcEXRT]
|
||||||
FPdXH_32k__M8N16TsP = 0xAC,
|
FPdXH_32k__M8N16TsP = 0x20_AC,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP-XH 32k M8N30T (RTEX)
|
/// FP-XH 32k M8N30T (RTEX)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcEXRT]
|
[PlcEXRT]
|
||||||
FPdXH_32k__M8N30T = 0xAD,
|
FPdXH_32k__M8N30T = 0x20_AD,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP-XH 32k C40ET,C60ET
|
/// FP-XH 32k C40ET,C60ET
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcEXRT]
|
[PlcEXRT]
|
||||||
FPdXH_32k__C40ET_C60ET = 0xAE,
|
FPdXH_32k__C40ET_C60ET = 0x20_AE,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP-XH 32k C60ETF
|
/// FP-XH 32k C60ETF
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcEXRT]
|
[PlcEXRT]
|
||||||
FPdXH_32k__C60ETF = 0xAF,
|
FPdXH_32k__C60ETF = 0x20_AF,
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -309,12 +363,12 @@ namespace MewtocolNet {
|
|||||||
/// FP0H 32k C32T/P
|
/// FP0H 32k C32T/P
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcEXRT]
|
[PlcEXRT]
|
||||||
FP0H_32k__C32TsP = 0xB0,
|
FP0H_32k__C32TsP = 0x20_B0,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP0H 32k C32ET/EP
|
/// FP0H 32k C32ET/EP
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcEXRT]
|
[PlcEXRT]
|
||||||
FP0H_32k__C32ETsEP = 0xB1,
|
FP0H_32k__C32ETsEP = 0x20_B1,
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -323,31 +377,31 @@ namespace MewtocolNet {
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP7 CPS41E (Series code 7)
|
/// FP7 CPS41E (Series code 7)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
FP7_196k__CPS41E = 0x0703,
|
FP7_196k__CPS41E = 0x07_C4_03,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP7 CPS31E (Series code 7)
|
/// FP7 CPS31E (Series code 7)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
FP7_120k__CPS31E = 0x0704,
|
FP7_120k__CPS31E = 0x07_78_04,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP7 CPS31 (Series code 7)
|
/// FP7 CPS31 (Series code 7)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
FP7_120k__CPS31 = 0x0705,
|
FP7_120k__CPS31 = 0x07_78_05,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP7 CPS41ES (Series code 7)
|
/// FP7 CPS41ES (Series code 7)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
FP7_196k__CPS41ES = 0x0706,
|
FP7_196k__CPS41ES = 0x07_C4_06,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP7 CPS31ES (Series code 7)
|
/// FP7 CPS31ES (Series code 7)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
FP7_120k__CPS31ES = 0x0707,
|
FP7_120k__CPS31ES = 0x07_78_07,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP7 CPS31S (Series code 7)
|
/// FP7 CPS31S (Series code 7)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
FP7_120k__CPS31S = 0x0708,
|
FP7_120k__CPS31S = 0x07_78_08,
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// FP7 CPS21 (Series code 7)
|
/// FP7 CPS21 (Series code 7)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
FP7_64k__CPS21 = 0x0709,
|
FP7_64k__CPS21 = 0x07_40_09,
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
@@ -357,7 +411,7 @@ namespace MewtocolNet {
|
|||||||
/// EcoLogiX (Series code 7)
|
/// EcoLogiX (Series code 7)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[PlcLegacy]
|
[PlcLegacy]
|
||||||
ECOLOGIX_0k__ELC500 = 0x0710,
|
ECOLOGIX_0k__ELC500 = 0x07_00_10,
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The register prefixed type
|
/// The register prefixed type
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum RegisterType {
|
public enum RegisterPrefix {
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Physical input as a bool (Relay)
|
/// Physical input as a bool (Relay)
|
||||||
@@ -25,10 +25,6 @@
|
|||||||
/// Double word area (Register)
|
/// Double word area (Register)
|
||||||
/// </summary>
|
/// </summary>
|
||||||
DDT = 4,
|
DDT = 4,
|
||||||
/// <summary>
|
|
||||||
/// Area of a byte sequence longer than 2 words
|
|
||||||
/// </summary>
|
|
||||||
DT_BYTE_RANGE = 5,
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// The type of an input/output register
|
/// The type of an input/output register
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public enum IOType {
|
public enum SingleBitPrefix {
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Physical input as a bool (Relay)
|
/// Physical input as a bool (Relay)
|
||||||
@@ -23,7 +23,6 @@ namespace MewtocolNet.RegisterBuilding {
|
|||||||
|
|
||||||
(x) => TryBuildBoolean(x),
|
(x) => TryBuildBoolean(x),
|
||||||
(x) => TryBuildNumericBased(x),
|
(x) => TryBuildNumericBased(x),
|
||||||
(x) => TryBuildByteRangeBased(x),
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -44,7 +43,7 @@ namespace MewtocolNet.RegisterBuilding {
|
|||||||
string area = match.Groups["area"].Value;
|
string area = match.Groups["area"].Value;
|
||||||
string special = match.Groups["special"].Value;
|
string special = match.Groups["special"].Value;
|
||||||
|
|
||||||
IOType regType;
|
SingleBitPrefix regType;
|
||||||
uint areaAdd = 0;
|
uint areaAdd = 0;
|
||||||
byte specialAdd = 0x0;
|
byte specialAdd = 0x0;
|
||||||
|
|
||||||
@@ -111,7 +110,7 @@ namespace MewtocolNet.RegisterBuilding {
|
|||||||
return new ParseResult {
|
return new ParseResult {
|
||||||
state = ParseResultState.Success,
|
state = ParseResultState.Success,
|
||||||
stepData = new StepData {
|
stepData = new StepData {
|
||||||
regType = (RegisterType)(int)regType,
|
regType = (RegisterPrefix)(int)regType,
|
||||||
memAddress = areaAdd,
|
memAddress = areaAdd,
|
||||||
specialAddress = specialAdd,
|
specialAddress = specialAdd,
|
||||||
}
|
}
|
||||||
@@ -134,7 +133,7 @@ namespace MewtocolNet.RegisterBuilding {
|
|||||||
string prefix = match.Groups["prefix"].Value;
|
string prefix = match.Groups["prefix"].Value;
|
||||||
string area = match.Groups["area"].Value;
|
string area = match.Groups["area"].Value;
|
||||||
|
|
||||||
RegisterType regType;
|
RegisterPrefix regType;
|
||||||
uint areaAdd = 0;
|
uint areaAdd = 0;
|
||||||
|
|
||||||
//try cast the prefix
|
//try cast the prefix
|
||||||
@@ -166,73 +165,6 @@ namespace MewtocolNet.RegisterBuilding {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// one to two word registers
|
|
||||||
private static ParseResult TryBuildByteRangeBased(string plcAddrName) {
|
|
||||||
|
|
||||||
var split = plcAddrName.Split('-');
|
|
||||||
|
|
||||||
if (split.Length > 2)
|
|
||||||
return new ParseResult {
|
|
||||||
state = ParseResultState.FailedHard,
|
|
||||||
hardFailReason = $"Cannot parse '{plcAddrName}', to many delimters '-'"
|
|
||||||
};
|
|
||||||
|
|
||||||
uint[] addresses = new uint[2];
|
|
||||||
|
|
||||||
for (int i = 0; i < split.Length; i++) {
|
|
||||||
|
|
||||||
string addr = split[i];
|
|
||||||
var patternByte = new Regex(@"(?<prefix>DT|DDT)(?<area>[0-9]{1,5})");
|
|
||||||
|
|
||||||
var match = patternByte.Match(addr);
|
|
||||||
|
|
||||||
if (!match.Success)
|
|
||||||
return new ParseResult {
|
|
||||||
state = ParseResultState.FailedSoft
|
|
||||||
};
|
|
||||||
|
|
||||||
string prefix = match.Groups["prefix"].Value;
|
|
||||||
string area = match.Groups["area"].Value;
|
|
||||||
|
|
||||||
RegisterType regType;
|
|
||||||
uint areaAdd = 0;
|
|
||||||
|
|
||||||
//try cast the prefix
|
|
||||||
if (!Enum.TryParse(prefix, out regType)) {
|
|
||||||
|
|
||||||
return new ParseResult {
|
|
||||||
state = ParseResultState.FailedHard,
|
|
||||||
hardFailReason = $"Cannot parse '{plcAddrName}', the prefix is not allowed for word range registers"
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(area) && !uint.TryParse(area, out areaAdd)) {
|
|
||||||
|
|
||||||
return new ParseResult {
|
|
||||||
state = ParseResultState.FailedHard,
|
|
||||||
hardFailReason = $"Cannot parse '{plcAddrName}', the area address: '{area}' is wrong"
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
addresses[i] = areaAdd;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return new ParseResult {
|
|
||||||
state = ParseResultState.Success,
|
|
||||||
stepData = new StepData {
|
|
||||||
regType = RegisterType.DT_BYTE_RANGE,
|
|
||||||
wasAddressStringRangeBased = true,
|
|
||||||
dotnetVarType = typeof(byte[]),
|
|
||||||
memAddress = addresses[0],
|
|
||||||
byteSizeHint = (addresses[1] - addresses[0] + 1) * 2
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
internal static StepData ParseAddress(string plcAddrName, string name = null) {
|
internal static StepData ParseAddress(string plcAddrName, string name = null) {
|
||||||
|
|
||||||
foreach (var method in parseMethods) {
|
foreach (var method in parseMethods) {
|
||||||
|
|||||||
@@ -62,8 +62,6 @@ namespace MewtocolNet.RegisterBuilding {
|
|||||||
|
|
||||||
var instance = (Register)constr.Invoke(parameters);
|
var instance = (Register)constr.Invoke(parameters);
|
||||||
|
|
||||||
instance.RegisterType = RegisterType.DT_BYTE_RANGE;
|
|
||||||
|
|
||||||
if (data.boundProperty != null && data.boundProperty.PropertyType != data.dotnetVarType)
|
if (data.boundProperty != null && data.boundProperty.PropertyType != data.dotnetVarType)
|
||||||
throw new TypeAccessException($"The bound property {data.boundProperty} must by of type: {data.dotnetVarType}");
|
throw new TypeAccessException($"The bound property {data.boundProperty} must by of type: {data.dotnetVarType}");
|
||||||
|
|
||||||
@@ -129,7 +127,7 @@ namespace MewtocolNet.RegisterBuilding {
|
|||||||
//-------------------------------------------
|
//-------------------------------------------
|
||||||
//as boolean register
|
//as boolean register
|
||||||
|
|
||||||
var io = (IOType)(int)data.regType;
|
var io = (SingleBitPrefix)(int)data.regType;
|
||||||
var spAddr = data.specialAddress;
|
var spAddr = data.specialAddress;
|
||||||
var areaAddr = data.memAddress;
|
var areaAddr = data.memAddress;
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ namespace MewtocolNet.RegisterBuilding {
|
|||||||
internal bool wasAddressStringRangeBased;
|
internal bool wasAddressStringRangeBased;
|
||||||
internal string originalParseStr;
|
internal string originalParseStr;
|
||||||
internal string name;
|
internal string name;
|
||||||
internal RegisterType regType;
|
internal RegisterPrefix regType;
|
||||||
internal uint memAddress;
|
internal uint memAddress;
|
||||||
internal byte specialAddress;
|
internal byte specialAddress;
|
||||||
internal Type dotnetVarType;
|
internal Type dotnetVarType;
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ namespace MewtocolNet.Registers {
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Type of the underlying register
|
/// Type of the underlying register
|
||||||
/// </summary>
|
/// </summary>
|
||||||
RegisterType RegisterType { get; }
|
RegisterPrefix RegisterType { get; }
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// The name of the register
|
/// The name of the register
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ namespace MewtocolNet.Registers {
|
|||||||
public object ValueObj => lastValue;
|
public object ValueObj => lastValue;
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public RegisterType RegisterType { get; internal set; }
|
public RegisterPrefix RegisterType { get; internal set; }
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public string Name => name;
|
public string Name => name;
|
||||||
@@ -106,7 +106,7 @@ namespace MewtocolNet.Registers {
|
|||||||
|
|
||||||
public virtual string GetAsPLC() => ValueObj?.ToString() ?? "null";
|
public virtual string GetAsPLC() => ValueObj?.ToString() ?? "null";
|
||||||
|
|
||||||
public virtual string GetRegisterString() => RegisterType == RegisterType.DT_BYTE_RANGE ? "DT" : RegisterType.ToString();
|
public virtual string GetRegisterString() => RegisterType.ToString();
|
||||||
|
|
||||||
public virtual string GetCombinedName() => $"{GetContainerName()}{(GetContainerName() != null ? "." : "")}{Name ?? "Unnamed"}";
|
public virtual string GetCombinedName() => $"{GetContainerName()}{(GetContainerName() != null ? "." : "")}{Name ?? "Unnamed"}";
|
||||||
|
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ namespace MewtocolNet.Registers {
|
|||||||
byteSizePerItem = (int)_reservedByteSize / itemCount;
|
byteSizePerItem = (int)_reservedByteSize / itemCount;
|
||||||
reservedByteSize = _reservedByteSize;
|
reservedByteSize = _reservedByteSize;
|
||||||
|
|
||||||
RegisterType = RegisterType.DT_BYTE_RANGE;
|
RegisterType = byteSizePerItem == 4 ? RegisterPrefix.DDT : RegisterPrefix.DT;
|
||||||
addressLength = Math.Max((_reservedByteSize / 2), 1);
|
addressLength = Math.Max((_reservedByteSize / 2), 1);
|
||||||
|
|
||||||
CheckAddressOverflow(memoryAddress, addressLength);
|
CheckAddressOverflow(memoryAddress, addressLength);
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ namespace MewtocolNet.Registers {
|
|||||||
public BoolRegister() =>
|
public BoolRegister() =>
|
||||||
throw new NotSupportedException("Direct register instancing is not supported, use the builder pattern");
|
throw new NotSupportedException("Direct register instancing is not supported, use the builder pattern");
|
||||||
|
|
||||||
internal BoolRegister(IOType _io, byte _spAddress = 0x0, uint _areaAdress = 0, string _name = null) {
|
internal BoolRegister(SingleBitPrefix _io, byte _spAddress = 0x0, uint _areaAdress = 0, string _name = null) {
|
||||||
|
|
||||||
lastValue = null;
|
lastValue = null;
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@ namespace MewtocolNet.Registers {
|
|||||||
specialAddress = _spAddress;
|
specialAddress = _spAddress;
|
||||||
name = _name;
|
name = _name;
|
||||||
|
|
||||||
RegisterType = (RegisterType)(int)_io;
|
RegisterType = (RegisterPrefix)(int)_io;
|
||||||
|
|
||||||
CheckAddressOverflow(memoryAddress, 0);
|
CheckAddressOverflow(memoryAddress, 0);
|
||||||
|
|
||||||
@@ -34,10 +34,10 @@ namespace MewtocolNet.Registers {
|
|||||||
|
|
||||||
protected override void CheckAddressOverflow(uint addressStart, uint addressLen) {
|
protected override void CheckAddressOverflow(uint addressStart, uint addressLen) {
|
||||||
|
|
||||||
if ((int)RegisterType == (int)IOType.R && addressStart >= 512)
|
if ((int)RegisterType == (int)SingleBitPrefix.R && addressStart >= 512)
|
||||||
throw new NotSupportedException("R area addresses cant be greater than 511");
|
throw new NotSupportedException("R area addresses cant be greater than 511");
|
||||||
|
|
||||||
if (((int)RegisterType == (int)IOType.X || (int)RegisterType == (int)IOType.Y) && addressStart >= 110)
|
if (((int)RegisterType == (int)SingleBitPrefix.X || (int)RegisterType == (int)SingleBitPrefix.Y) && addressStart >= 110)
|
||||||
throw new NotSupportedException("XY area addresses cant be greater than 110");
|
throw new NotSupportedException("XY area addresses cant be greater than 110");
|
||||||
|
|
||||||
if (specialAddress > 0xF)
|
if (specialAddress > 0xF)
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ namespace MewtocolNet.Registers {
|
|||||||
reservedStringLength = (int)_reservedByteSize;
|
reservedStringLength = (int)_reservedByteSize;
|
||||||
Resize(_reservedByteSize);
|
Resize(_reservedByteSize);
|
||||||
|
|
||||||
RegisterType = RegisterType.DT_BYTE_RANGE;
|
RegisterType = RegisterPrefix.DT;
|
||||||
|
|
||||||
CheckAddressOverflow(memoryAddress, addressLength);
|
CheckAddressOverflow(memoryAddress, addressLength);
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ namespace MewtocolNet.Registers {
|
|||||||
/// <typeparam name="T">The type of the numeric value</typeparam>
|
/// <typeparam name="T">The type of the numeric value</typeparam>
|
||||||
public class StructRegister<T> : Register, IRegister<T> where T : struct {
|
public class StructRegister<T> : Register, IRegister<T> where T : struct {
|
||||||
|
|
||||||
|
internal byte specialAddress;
|
||||||
internal uint addressLength;
|
internal uint addressLength;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -23,22 +24,29 @@ namespace MewtocolNet.Registers {
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public uint AddressLength => addressLength;
|
public uint AddressLength => addressLength;
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// The registers memory adress if not a special register
|
||||||
|
/// </summary>
|
||||||
|
public byte SpecialAddress => specialAddress;
|
||||||
|
|
||||||
public T? Value => (T?)ValueObj;
|
public T? Value => (T?)ValueObj;
|
||||||
|
|
||||||
[Obsolete("Creating registers directly is not supported use IPlc.Register instead")]
|
[Obsolete("Creating registers directly is not supported use IPlc.Register instead")]
|
||||||
public StructRegister() =>
|
public StructRegister() =>
|
||||||
throw new NotSupportedException("Direct register instancing is not supported, use the builder pattern");
|
throw new NotSupportedException("Direct register instancing is not supported, use the builder pattern");
|
||||||
|
|
||||||
|
//struct for 16-32bit registers
|
||||||
internal StructRegister(uint _address, uint _reservedByteSize, string _name = null) {
|
internal StructRegister(uint _address, uint _reservedByteSize, string _name = null) {
|
||||||
|
|
||||||
memoryAddress = _address;
|
memoryAddress = _address;
|
||||||
|
specialAddress = 0x0;
|
||||||
name = _name;
|
name = _name;
|
||||||
|
|
||||||
addressLength = _reservedByteSize / 2;
|
addressLength = _reservedByteSize / 2;
|
||||||
if (_reservedByteSize % 2 != 0) addressLength++;
|
if (_reservedByteSize % 2 != 0) addressLength++;
|
||||||
|
|
||||||
if (_reservedByteSize == 2) RegisterType = RegisterType.DT;
|
if (_reservedByteSize == 2) RegisterType = RegisterPrefix.DT;
|
||||||
if(_reservedByteSize == 4) RegisterType = RegisterType.DDT;
|
if(_reservedByteSize == 4) RegisterType = RegisterPrefix.DDT;
|
||||||
|
|
||||||
CheckAddressOverflow(memoryAddress, addressLength);
|
CheckAddressOverflow(memoryAddress, addressLength);
|
||||||
|
|
||||||
@@ -47,6 +55,36 @@ namespace MewtocolNet.Registers {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//struct for one bit registers
|
||||||
|
internal StructRegister(SingleBitPrefix _io, byte _spAddress = 0x0, uint _areaAdress = 0, string _name = null) {
|
||||||
|
|
||||||
|
lastValue = null;
|
||||||
|
|
||||||
|
memoryAddress = _areaAdress;
|
||||||
|
specialAddress = _spAddress;
|
||||||
|
name = _name;
|
||||||
|
|
||||||
|
RegisterType = (RegisterPrefix)(int)_io;
|
||||||
|
|
||||||
|
CheckAddressOverflow(memoryAddress, 0);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
protected override void CheckAddressOverflow(uint addressStart, uint addressLen) {
|
||||||
|
|
||||||
|
if ((int)RegisterType == (int)SingleBitPrefix.R && addressStart >= 512)
|
||||||
|
throw new NotSupportedException("R area addresses cant be greater than 511");
|
||||||
|
|
||||||
|
if (((int)RegisterType == (int)SingleBitPrefix.X || (int)RegisterType == (int)SingleBitPrefix.Y) && addressStart >= 110)
|
||||||
|
throw new NotSupportedException("XY area addresses cant be greater than 110");
|
||||||
|
|
||||||
|
if (specialAddress > 0xF)
|
||||||
|
throw new NotSupportedException("Special address cant be greater than 15 or 0xF");
|
||||||
|
|
||||||
|
base.CheckAddressOverflow(addressStart, addressLen);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/// <inheritdoc/>
|
/// <inheritdoc/>
|
||||||
public override string GetAsPLC() {
|
public override string GetAsPLC() {
|
||||||
|
|
||||||
|
|||||||
@@ -8,18 +8,18 @@ namespace MewtocolNet.TypeConversion {
|
|||||||
|
|
||||||
internal static class Conversions {
|
internal static class Conversions {
|
||||||
|
|
||||||
internal static Dictionary<PlcVarType, RegisterType> dictPlcTypeToRegisterType = new Dictionary<PlcVarType, RegisterType> {
|
internal static Dictionary<PlcVarType, RegisterPrefix> dictPlcTypeToRegisterType = new Dictionary<PlcVarType, RegisterPrefix> {
|
||||||
|
|
||||||
{ PlcVarType.BOOL, RegisterType.R },
|
{ PlcVarType.BOOL, RegisterPrefix.R },
|
||||||
{ PlcVarType.INT, RegisterType.DT },
|
{ PlcVarType.INT, RegisterPrefix.DT },
|
||||||
{ PlcVarType.UINT, RegisterType.DT },
|
{ PlcVarType.UINT, RegisterPrefix.DT },
|
||||||
{ PlcVarType.DINT, RegisterType.DDT },
|
{ PlcVarType.DINT, RegisterPrefix.DDT },
|
||||||
{ PlcVarType.UDINT, RegisterType.DDT },
|
{ PlcVarType.UDINT, RegisterPrefix.DDT },
|
||||||
{ PlcVarType.REAL, RegisterType.DDT },
|
{ PlcVarType.REAL, RegisterPrefix.DDT },
|
||||||
{ PlcVarType.TIME, RegisterType.DDT },
|
{ PlcVarType.TIME, RegisterPrefix.DDT },
|
||||||
{ PlcVarType.WORD, RegisterType.DT },
|
{ PlcVarType.WORD, RegisterPrefix.DT },
|
||||||
{ PlcVarType.DWORD, RegisterType.DDT },
|
{ PlcVarType.DWORD, RegisterPrefix.DDT },
|
||||||
{ PlcVarType.STRING, RegisterType.DT_BYTE_RANGE },
|
{ PlcVarType.STRING, RegisterPrefix.DT },
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ namespace MewtocolNet.TypeConversion {
|
|||||||
internal static List<IPlcTypeConverter> items = new List<IPlcTypeConverter> {
|
internal static List<IPlcTypeConverter> items = new List<IPlcTypeConverter> {
|
||||||
|
|
||||||
//default bool R conversion
|
//default bool R conversion
|
||||||
new PlcTypeConversion<bool>(RegisterType.R) {
|
new PlcTypeConversion<bool>(RegisterPrefix.R) {
|
||||||
HoldingRegisterType = typeof(BoolRegister),
|
HoldingRegisterType = typeof(BoolRegister),
|
||||||
PlcVarType = PlcVarType.BOOL,
|
PlcVarType = PlcVarType.BOOL,
|
||||||
FromRaw = (reg, bytes) => (bool)(bytes[0] == 1),
|
FromRaw = (reg, bytes) => (bool)(bytes[0] == 1),
|
||||||
@@ -37,7 +37,7 @@ namespace MewtocolNet.TypeConversion {
|
|||||||
},
|
},
|
||||||
|
|
||||||
//default bool X conversion
|
//default bool X conversion
|
||||||
new PlcTypeConversion<bool>(RegisterType.X) {
|
new PlcTypeConversion<bool>(RegisterPrefix.X) {
|
||||||
HoldingRegisterType = typeof(BoolRegister),
|
HoldingRegisterType = typeof(BoolRegister),
|
||||||
PlcVarType = PlcVarType.BOOL,
|
PlcVarType = PlcVarType.BOOL,
|
||||||
FromRaw = (reg, bytes) => (bool)(bytes[0] == 1),
|
FromRaw = (reg, bytes) => (bool)(bytes[0] == 1),
|
||||||
@@ -45,7 +45,7 @@ namespace MewtocolNet.TypeConversion {
|
|||||||
},
|
},
|
||||||
|
|
||||||
//default bool Y conversion
|
//default bool Y conversion
|
||||||
new PlcTypeConversion<bool>(RegisterType.Y) {
|
new PlcTypeConversion<bool>(RegisterPrefix.Y) {
|
||||||
HoldingRegisterType = typeof(BoolRegister),
|
HoldingRegisterType = typeof(BoolRegister),
|
||||||
PlcVarType = PlcVarType.BOOL,
|
PlcVarType = PlcVarType.BOOL,
|
||||||
FromRaw = (reg, bytes) => (bool)(bytes[0] == 1),
|
FromRaw = (reg, bytes) => (bool)(bytes[0] == 1),
|
||||||
@@ -53,7 +53,7 @@ namespace MewtocolNet.TypeConversion {
|
|||||||
},
|
},
|
||||||
|
|
||||||
//default short DT conversion
|
//default short DT conversion
|
||||||
new PlcTypeConversion<short>(RegisterType.DT) {
|
new PlcTypeConversion<short>(RegisterPrefix.DT) {
|
||||||
HoldingRegisterType = typeof(StructRegister<short>),
|
HoldingRegisterType = typeof(StructRegister<short>),
|
||||||
PlcVarType = PlcVarType.INT,
|
PlcVarType = PlcVarType.INT,
|
||||||
FromRaw = (reg, bytes) => BitConverter.ToInt16(bytes, 0),
|
FromRaw = (reg, bytes) => BitConverter.ToInt16(bytes, 0),
|
||||||
@@ -61,7 +61,7 @@ namespace MewtocolNet.TypeConversion {
|
|||||||
},
|
},
|
||||||
|
|
||||||
//default ushort DT conversion
|
//default ushort DT conversion
|
||||||
new PlcTypeConversion<ushort>(RegisterType.DT) {
|
new PlcTypeConversion<ushort>(RegisterPrefix.DT) {
|
||||||
HoldingRegisterType = typeof(StructRegister<ushort>),
|
HoldingRegisterType = typeof(StructRegister<ushort>),
|
||||||
PlcVarType = PlcVarType.UINT,
|
PlcVarType = PlcVarType.UINT,
|
||||||
FromRaw = (reg, bytes) => BitConverter.ToUInt16(bytes, 0),
|
FromRaw = (reg, bytes) => BitConverter.ToUInt16(bytes, 0),
|
||||||
@@ -69,7 +69,7 @@ namespace MewtocolNet.TypeConversion {
|
|||||||
},
|
},
|
||||||
|
|
||||||
//default Word DT conversion
|
//default Word DT conversion
|
||||||
new PlcTypeConversion<Word>(RegisterType.DT) {
|
new PlcTypeConversion<Word>(RegisterPrefix.DT) {
|
||||||
HoldingRegisterType = typeof(StructRegister<Word>),
|
HoldingRegisterType = typeof(StructRegister<Word>),
|
||||||
PlcVarType = PlcVarType.WORD,
|
PlcVarType = PlcVarType.WORD,
|
||||||
FromRaw = (reg, bytes) => new Word(bytes),
|
FromRaw = (reg, bytes) => new Word(bytes),
|
||||||
@@ -77,7 +77,7 @@ namespace MewtocolNet.TypeConversion {
|
|||||||
},
|
},
|
||||||
|
|
||||||
//default int DDT conversion
|
//default int DDT conversion
|
||||||
new PlcTypeConversion<int>(RegisterType.DDT) {
|
new PlcTypeConversion<int>(RegisterPrefix.DDT) {
|
||||||
HoldingRegisterType = typeof(StructRegister<int>),
|
HoldingRegisterType = typeof(StructRegister<int>),
|
||||||
PlcVarType = PlcVarType.DINT,
|
PlcVarType = PlcVarType.DINT,
|
||||||
FromRaw = (reg, bytes) => BitConverter.ToInt32(bytes, 0),
|
FromRaw = (reg, bytes) => BitConverter.ToInt32(bytes, 0),
|
||||||
@@ -85,7 +85,7 @@ namespace MewtocolNet.TypeConversion {
|
|||||||
},
|
},
|
||||||
|
|
||||||
//default uint DDT conversion
|
//default uint DDT conversion
|
||||||
new PlcTypeConversion<uint>(RegisterType.DDT) {
|
new PlcTypeConversion<uint>(RegisterPrefix.DDT) {
|
||||||
HoldingRegisterType = typeof(StructRegister<uint>),
|
HoldingRegisterType = typeof(StructRegister<uint>),
|
||||||
PlcVarType = PlcVarType.UDINT,
|
PlcVarType = PlcVarType.UDINT,
|
||||||
FromRaw = (reg, bytes) => BitConverter.ToUInt32(bytes, 0),
|
FromRaw = (reg, bytes) => BitConverter.ToUInt32(bytes, 0),
|
||||||
@@ -93,7 +93,7 @@ namespace MewtocolNet.TypeConversion {
|
|||||||
},
|
},
|
||||||
|
|
||||||
//default DWord DDT conversion
|
//default DWord DDT conversion
|
||||||
new PlcTypeConversion<DWord>(RegisterType.DDT) {
|
new PlcTypeConversion<DWord>(RegisterPrefix.DDT) {
|
||||||
HoldingRegisterType = typeof(StructRegister<DWord>),
|
HoldingRegisterType = typeof(StructRegister<DWord>),
|
||||||
PlcVarType = PlcVarType.DWORD,
|
PlcVarType = PlcVarType.DWORD,
|
||||||
FromRaw = (reg, bytes) => new DWord(bytes),
|
FromRaw = (reg, bytes) => new DWord(bytes),
|
||||||
@@ -101,7 +101,7 @@ namespace MewtocolNet.TypeConversion {
|
|||||||
},
|
},
|
||||||
|
|
||||||
//default float DDT conversion
|
//default float DDT conversion
|
||||||
new PlcTypeConversion<float>(RegisterType.DDT) {
|
new PlcTypeConversion<float>(RegisterPrefix.DDT) {
|
||||||
HoldingRegisterType = typeof(StructRegister<float>),
|
HoldingRegisterType = typeof(StructRegister<float>),
|
||||||
PlcVarType = PlcVarType.REAL,
|
PlcVarType = PlcVarType.REAL,
|
||||||
FromRaw = (reg, bytes) => BitConverter.ToSingle(bytes, 0),
|
FromRaw = (reg, bytes) => BitConverter.ToSingle(bytes, 0),
|
||||||
@@ -109,7 +109,7 @@ namespace MewtocolNet.TypeConversion {
|
|||||||
},
|
},
|
||||||
|
|
||||||
//default TimeSpan DDT conversion
|
//default TimeSpan DDT conversion
|
||||||
new PlcTypeConversion<TimeSpan>(RegisterType.DDT) {
|
new PlcTypeConversion<TimeSpan>(RegisterPrefix.DDT) {
|
||||||
HoldingRegisterType = typeof(StructRegister<TimeSpan>),
|
HoldingRegisterType = typeof(StructRegister<TimeSpan>),
|
||||||
PlcVarType = PlcVarType.TIME,
|
PlcVarType = PlcVarType.TIME,
|
||||||
FromRaw = (reg, bytes) => {
|
FromRaw = (reg, bytes) => {
|
||||||
@@ -130,7 +130,7 @@ namespace MewtocolNet.TypeConversion {
|
|||||||
//default string DT Range conversion Example bytes: (04 00 03 00 XX XX XX)
|
//default string DT Range conversion Example bytes: (04 00 03 00 XX XX XX)
|
||||||
//first 4 bytes are reserved size (2 bytes) and used size (2 bytes)
|
//first 4 bytes are reserved size (2 bytes) and used size (2 bytes)
|
||||||
//the remaining bytes are the ascii bytes for the string
|
//the remaining bytes are the ascii bytes for the string
|
||||||
new PlcTypeConversion<string>(RegisterType.DT_BYTE_RANGE) {
|
new PlcTypeConversion<string>(RegisterPrefix.DT) {
|
||||||
HoldingRegisterType = typeof(StringRegister),
|
HoldingRegisterType = typeof(StringRegister),
|
||||||
PlcVarType = PlcVarType.STRING,
|
PlcVarType = PlcVarType.STRING,
|
||||||
FromRaw = (reg, bytes) => {
|
FromRaw = (reg, bytes) => {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ namespace MewtocolNet {
|
|||||||
|
|
||||||
Type GetHoldingRegisterType();
|
Type GetHoldingRegisterType();
|
||||||
|
|
||||||
RegisterType GetPlcRegisterType();
|
RegisterPrefix GetPlcRegisterType();
|
||||||
|
|
||||||
PlcVarType GetPlcVarType();
|
PlcVarType GetPlcVarType();
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ namespace MewtocolNet {
|
|||||||
|
|
||||||
public Type MainType { get; private set; }
|
public Type MainType { get; private set; }
|
||||||
|
|
||||||
public RegisterType PlcType { get; private set; }
|
public RegisterPrefix PlcType { get; private set; }
|
||||||
|
|
||||||
public PlcVarType PlcVarType { get; set; }
|
public PlcVarType PlcVarType { get; set; }
|
||||||
|
|
||||||
@@ -17,7 +17,7 @@ namespace MewtocolNet {
|
|||||||
|
|
||||||
public Func<Register, T, byte[]> ToRaw { get; set; }
|
public Func<Register, T, byte[]> ToRaw { get; set; }
|
||||||
|
|
||||||
public PlcTypeConversion(RegisterType plcType) {
|
public PlcTypeConversion(RegisterPrefix plcType) {
|
||||||
|
|
||||||
MainType = typeof(T);
|
MainType = typeof(T);
|
||||||
PlcType = plcType;
|
PlcType = plcType;
|
||||||
@@ -28,7 +28,7 @@ namespace MewtocolNet {
|
|||||||
|
|
||||||
public Type GetHoldingRegisterType() => HoldingRegisterType;
|
public Type GetHoldingRegisterType() => HoldingRegisterType;
|
||||||
|
|
||||||
public RegisterType GetPlcRegisterType() => PlcType;
|
public RegisterPrefix GetPlcRegisterType() => PlcType;
|
||||||
|
|
||||||
public PlcVarType GetPlcVarType() => PlcVarType;
|
public PlcVarType GetPlcVarType() => PlcVarType;
|
||||||
|
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ namespace MewtocolNet {
|
|||||||
|
|
||||||
public static List<Type> GetAllowRegisterTypes() => conversions.Select(x => x.GetHoldingRegisterType()).ToList();
|
public static List<Type> GetAllowRegisterTypes() => conversions.Select(x => x.GetHoldingRegisterType()).ToList();
|
||||||
|
|
||||||
public static RegisterType? GetDefaultRegisterType(Type type) =>
|
public static RegisterPrefix? GetDefaultRegisterType(Type type) =>
|
||||||
conversions.FirstOrDefault(x => x.GetDotnetType() == type)?.GetPlcRegisterType();
|
conversions.FirstOrDefault(x => x.GetDotnetType() == type)?.GetPlcRegisterType();
|
||||||
|
|
||||||
public static Type GetDefaultRegisterHoldingType(this PlcVarType type) =>
|
public static Type GetDefaultRegisterHoldingType(this PlcVarType type) =>
|
||||||
|
|||||||
@@ -32,9 +32,9 @@ namespace MewtocolNet {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static RegisterType ToRegisterTypeDefault(this Type type) {
|
internal static RegisterPrefix ToRegisterTypeDefault(this Type type) {
|
||||||
|
|
||||||
if (type.IsEnum) return RegisterType.DT;
|
if (type.IsEnum) return RegisterPrefix.DT;
|
||||||
|
|
||||||
var found = PlcValueParser.GetDefaultRegisterType(type);
|
var found = PlcValueParser.GetDefaultRegisterType(type);
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ namespace MewtocolNet.UnderlyingRegisters {
|
|||||||
|
|
||||||
private MewtocolInterface mewInterface;
|
private MewtocolInterface mewInterface;
|
||||||
|
|
||||||
internal RegisterType registerType;
|
internal RegisterPrefix registerType;
|
||||||
internal ulong addressStart;
|
internal ulong addressStart;
|
||||||
internal ulong addressEnd;
|
internal ulong addressEnd;
|
||||||
|
|
||||||
|
|||||||
@@ -75,14 +75,13 @@ namespace MewtocolNet.UnderlyingRegisters {
|
|||||||
TestPollLevelExistence(reg);
|
TestPollLevelExistence(reg);
|
||||||
|
|
||||||
switch (reg.RegisterType) {
|
switch (reg.RegisterType) {
|
||||||
case RegisterType.X:
|
case RegisterPrefix.X:
|
||||||
case RegisterType.Y:
|
case RegisterPrefix.Y:
|
||||||
case RegisterType.R:
|
case RegisterPrefix.R:
|
||||||
AddToWRArea(reg);
|
AddToWRArea(reg);
|
||||||
break;
|
break;
|
||||||
case RegisterType.DT:
|
case RegisterPrefix.DT:
|
||||||
case RegisterType.DDT:
|
case RegisterPrefix.DDT:
|
||||||
case RegisterType.DT_BYTE_RANGE:
|
|
||||||
AddToDTArea(reg);
|
AddToDTArea(reg);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -148,13 +147,13 @@ namespace MewtocolNet.UnderlyingRegisters {
|
|||||||
List<WRArea> collection = null;
|
List<WRArea> collection = null;
|
||||||
|
|
||||||
switch (insertReg.RegisterType) {
|
switch (insertReg.RegisterType) {
|
||||||
case RegisterType.X:
|
case RegisterPrefix.X:
|
||||||
collection = pollLevelFound.externalRelayInAreas;
|
collection = pollLevelFound.externalRelayInAreas;
|
||||||
break;
|
break;
|
||||||
case RegisterType.Y:
|
case RegisterPrefix.Y:
|
||||||
collection = pollLevelFound.externalRelayOutAreas;
|
collection = pollLevelFound.externalRelayOutAreas;
|
||||||
break;
|
break;
|
||||||
case RegisterType.R:
|
case RegisterPrefix.R:
|
||||||
collection = pollLevelFound.internalRelayAreas;
|
collection = pollLevelFound.internalRelayAreas;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ namespace MewtocolNet.UnderlyingRegisters {
|
|||||||
|
|
||||||
private MewtocolInterface mewInterface;
|
private MewtocolInterface mewInterface;
|
||||||
|
|
||||||
internal RegisterType registerType;
|
internal RegisterPrefix registerType;
|
||||||
internal ulong addressStart;
|
internal ulong addressStart;
|
||||||
|
|
||||||
internal byte[] wordData = new byte[2];
|
internal byte[] wordData = new byte[2];
|
||||||
|
|||||||
19
MewtocolTests/TestPlcTypeEnumDuplicates.cs
Normal file
19
MewtocolTests/TestPlcTypeEnumDuplicates.cs
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
using MewtocolNet;
|
||||||
|
using Xunit;
|
||||||
|
using Xunit.Abstractions;
|
||||||
|
|
||||||
|
using MewtocolNet.Helpers;
|
||||||
|
|
||||||
|
namespace MewtocolTests {
|
||||||
|
|
||||||
|
public class TestPlcTypeEnumDuplicates {
|
||||||
|
|
||||||
|
private readonly ITestOutputHelper output;
|
||||||
|
|
||||||
|
public TestPlcTypeEnumDuplicates(ITestOutputHelper output) {
|
||||||
|
this.output = output;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -23,27 +23,27 @@ public class TestRegisterBuilder {
|
|||||||
|
|
||||||
var tests = new Dictionary<string, IRegister>() {
|
var tests = new Dictionary<string, IRegister>() {
|
||||||
|
|
||||||
{"Y0", new BoolRegister(IOType.Y)},
|
{"Y0", new BoolRegister(SingleBitPrefix.Y)},
|
||||||
{"Y1", new BoolRegister(IOType.Y, 0x1)},
|
{"Y1", new BoolRegister(SingleBitPrefix.Y, 0x1)},
|
||||||
{"Y2", new BoolRegister(IOType.Y, 0x2)},
|
{"Y2", new BoolRegister(SingleBitPrefix.Y, 0x2)},
|
||||||
{"Y3", new BoolRegister(IOType.Y, 0x3)},
|
{"Y3", new BoolRegister(SingleBitPrefix.Y, 0x3)},
|
||||||
{"Y4", new BoolRegister(IOType.Y, 0x4)},
|
{"Y4", new BoolRegister(SingleBitPrefix.Y, 0x4)},
|
||||||
{"Y5", new BoolRegister(IOType.Y, 0x5)},
|
{"Y5", new BoolRegister(SingleBitPrefix.Y, 0x5)},
|
||||||
{"Y6", new BoolRegister(IOType.Y, 0x6)},
|
{"Y6", new BoolRegister(SingleBitPrefix.Y, 0x6)},
|
||||||
{"Y7", new BoolRegister(IOType.Y, 0x7)},
|
{"Y7", new BoolRegister(SingleBitPrefix.Y, 0x7)},
|
||||||
{"Y8", new BoolRegister(IOType.Y, 0x8)},
|
{"Y8", new BoolRegister(SingleBitPrefix.Y, 0x8)},
|
||||||
{"Y9", new BoolRegister(IOType.Y, 0x9)},
|
{"Y9", new BoolRegister(SingleBitPrefix.Y, 0x9)},
|
||||||
|
|
||||||
{"YA", new BoolRegister(IOType.Y, 0xA)},
|
{"YA", new BoolRegister(SingleBitPrefix.Y, 0xA)},
|
||||||
{"YB", new BoolRegister(IOType.Y, 0xB)},
|
{"YB", new BoolRegister(SingleBitPrefix.Y, 0xB)},
|
||||||
{"YC", new BoolRegister(IOType.Y, 0xC)},
|
{"YC", new BoolRegister(SingleBitPrefix.Y, 0xC)},
|
||||||
{"YD", new BoolRegister(IOType.Y, 0xD)},
|
{"YD", new BoolRegister(SingleBitPrefix.Y, 0xD)},
|
||||||
{"YE", new BoolRegister(IOType.Y, 0xE)},
|
{"YE", new BoolRegister(SingleBitPrefix.Y, 0xE)},
|
||||||
{"YF", new BoolRegister(IOType.Y, 0xF)},
|
{"YF", new BoolRegister(SingleBitPrefix.Y, 0xF)},
|
||||||
|
|
||||||
{"Y1A", new BoolRegister(IOType.Y, 0xA, 1)},
|
{"Y1A", new BoolRegister(SingleBitPrefix.Y, 0xA, 1)},
|
||||||
{"Y10B", new BoolRegister(IOType.Y, 0xB, 10)},
|
{"Y10B", new BoolRegister(SingleBitPrefix.Y, 0xB, 10)},
|
||||||
{"Y109C", new BoolRegister(IOType.Y, 0xC, 109)},
|
{"Y109C", new BoolRegister(SingleBitPrefix.Y, 0xC, 109)},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -56,27 +56,27 @@ public class TestRegisterBuilder {
|
|||||||
|
|
||||||
var tests = new Dictionary<string, IRegister>() {
|
var tests = new Dictionary<string, IRegister>() {
|
||||||
|
|
||||||
{"X0", new BoolRegister(IOType.X)},
|
{"X0", new BoolRegister(SingleBitPrefix.X)},
|
||||||
{"X1", new BoolRegister(IOType.X, 0x1)},
|
{"X1", new BoolRegister(SingleBitPrefix.X, 0x1)},
|
||||||
{"X2", new BoolRegister(IOType.X, 0x2)},
|
{"X2", new BoolRegister(SingleBitPrefix.X, 0x2)},
|
||||||
{"X3", new BoolRegister(IOType.X, 0x3)},
|
{"X3", new BoolRegister(SingleBitPrefix.X, 0x3)},
|
||||||
{"X4", new BoolRegister(IOType.X, 0x4)},
|
{"X4", new BoolRegister(SingleBitPrefix.X, 0x4)},
|
||||||
{"X5", new BoolRegister(IOType.X, 0x5)},
|
{"X5", new BoolRegister(SingleBitPrefix.X, 0x5)},
|
||||||
{"X6", new BoolRegister(IOType.X, 0x6)},
|
{"X6", new BoolRegister(SingleBitPrefix.X, 0x6)},
|
||||||
{"X7", new BoolRegister(IOType.X, 0x7)},
|
{"X7", new BoolRegister(SingleBitPrefix.X, 0x7)},
|
||||||
{"X8", new BoolRegister(IOType.X, 0x8)},
|
{"X8", new BoolRegister(SingleBitPrefix.X, 0x8)},
|
||||||
{"X9", new BoolRegister(IOType.X, 0x9)},
|
{"X9", new BoolRegister(SingleBitPrefix.X, 0x9)},
|
||||||
|
|
||||||
{"XA", new BoolRegister(IOType.X, 0xA)},
|
{"XA", new BoolRegister(SingleBitPrefix.X, 0xA)},
|
||||||
{"XB", new BoolRegister(IOType.X, 0xB)},
|
{"XB", new BoolRegister(SingleBitPrefix.X, 0xB)},
|
||||||
{"XC", new BoolRegister(IOType.X, 0xC)},
|
{"XC", new BoolRegister(SingleBitPrefix.X, 0xC)},
|
||||||
{"XD", new BoolRegister(IOType.X, 0xD)},
|
{"XD", new BoolRegister(SingleBitPrefix.X, 0xD)},
|
||||||
{"XE", new BoolRegister(IOType.X, 0xE)},
|
{"XE", new BoolRegister(SingleBitPrefix.X, 0xE)},
|
||||||
{"XF", new BoolRegister(IOType.X, 0xF)},
|
{"XF", new BoolRegister(SingleBitPrefix.X, 0xF)},
|
||||||
|
|
||||||
{"X1A", new BoolRegister(IOType.X, 0xA, 1)},
|
{"X1A", new BoolRegister(SingleBitPrefix.X, 0xA, 1)},
|
||||||
{"X10B", new BoolRegister(IOType.X, 0xB, 10)},
|
{"X10B", new BoolRegister(SingleBitPrefix.X, 0xB, 10)},
|
||||||
{"X109C", new BoolRegister(IOType.X, 0xC, 109)},
|
{"X109C", new BoolRegister(SingleBitPrefix.X, 0xC, 109)},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -89,30 +89,30 @@ public class TestRegisterBuilder {
|
|||||||
|
|
||||||
var tests = new Dictionary<string, IRegister>() {
|
var tests = new Dictionary<string, IRegister>() {
|
||||||
|
|
||||||
{"R0", new BoolRegister(IOType.R)},
|
{"R0", new BoolRegister(SingleBitPrefix.R)},
|
||||||
{"R1", new BoolRegister(IOType.R, 0x1)},
|
{"R1", new BoolRegister(SingleBitPrefix.R, 0x1)},
|
||||||
{"R2", new BoolRegister(IOType.R, 0x2)},
|
{"R2", new BoolRegister(SingleBitPrefix.R, 0x2)},
|
||||||
{"R3", new BoolRegister(IOType.R, 0x3)},
|
{"R3", new BoolRegister(SingleBitPrefix.R, 0x3)},
|
||||||
{"R4", new BoolRegister(IOType.R, 0x4)},
|
{"R4", new BoolRegister(SingleBitPrefix.R, 0x4)},
|
||||||
{"R5", new BoolRegister(IOType.R, 0x5)},
|
{"R5", new BoolRegister(SingleBitPrefix.R, 0x5)},
|
||||||
{"R6", new BoolRegister(IOType.R, 0x6)},
|
{"R6", new BoolRegister(SingleBitPrefix.R, 0x6)},
|
||||||
{"R7", new BoolRegister(IOType.R, 0x7)},
|
{"R7", new BoolRegister(SingleBitPrefix.R, 0x7)},
|
||||||
{"R8", new BoolRegister(IOType.R, 0x8)},
|
{"R8", new BoolRegister(SingleBitPrefix.R, 0x8)},
|
||||||
{"R9", new BoolRegister(IOType.R, 0x9)},
|
{"R9", new BoolRegister(SingleBitPrefix.R, 0x9)},
|
||||||
|
|
||||||
{"RA", new BoolRegister(IOType.R, 0xA)},
|
{"RA", new BoolRegister(SingleBitPrefix.R, 0xA)},
|
||||||
{"RB", new BoolRegister(IOType.R, 0xB)},
|
{"RB", new BoolRegister(SingleBitPrefix.R, 0xB)},
|
||||||
{"RC", new BoolRegister(IOType.R, 0xC)},
|
{"RC", new BoolRegister(SingleBitPrefix.R, 0xC)},
|
||||||
{"RD", new BoolRegister(IOType.R, 0xD)},
|
{"RD", new BoolRegister(SingleBitPrefix.R, 0xD)},
|
||||||
{"RE", new BoolRegister(IOType.R, 0xE)},
|
{"RE", new BoolRegister(SingleBitPrefix.R, 0xE)},
|
||||||
{"RF", new BoolRegister(IOType.R, 0xF)},
|
{"RF", new BoolRegister(SingleBitPrefix.R, 0xF)},
|
||||||
|
|
||||||
{"R1A", new BoolRegister(IOType.R, 0xA, 1)},
|
{"R1A", new BoolRegister(SingleBitPrefix.R, 0xA, 1)},
|
||||||
{"R10B", new BoolRegister(IOType.R, 0xB, 10)},
|
{"R10B", new BoolRegister(SingleBitPrefix.R, 0xB, 10)},
|
||||||
{"R109C", new BoolRegister(IOType.R, 0xC, 109)},
|
{"R109C", new BoolRegister(SingleBitPrefix.R, 0xC, 109)},
|
||||||
{"R1000", new BoolRegister(IOType.R, 0x0, 100)},
|
{"R1000", new BoolRegister(SingleBitPrefix.R, 0x0, 100)},
|
||||||
{"R511", new BoolRegister(IOType.R, 0x0, 511)},
|
{"R511", new BoolRegister(SingleBitPrefix.R, 0x0, 511)},
|
||||||
{"R511A", new BoolRegister(IOType.R, 0xA, 511)},
|
{"R511A", new BoolRegister(SingleBitPrefix.R, 0xA, 511)},
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace MewtocolTests {
|
|||||||
|
|
||||||
var ex1 = Assert.Throws<NotSupportedException>(() => {
|
var ex1 = Assert.Throws<NotSupportedException>(() => {
|
||||||
|
|
||||||
new BoolRegister(IOType.R, _areaAdress: 512);
|
new BoolRegister(SingleBitPrefix.R, _areaAdress: 512);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -39,7 +39,7 @@ namespace MewtocolTests {
|
|||||||
|
|
||||||
var ex2 = Assert.Throws<NotSupportedException>(() => {
|
var ex2 = Assert.Throws<NotSupportedException>(() => {
|
||||||
|
|
||||||
new BoolRegister(IOType.X, _areaAdress: 110);
|
new BoolRegister(SingleBitPrefix.X, _areaAdress: 110);
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user