Skip to content

Commit

Permalink
Merge pull request #150 from fleibede/add-support-for-RTX-cpu
Browse files Browse the repository at this point in the history
Added support for WinLC RTX CPU and an older 319-3PN/DP CPU.
  • Loading branch information
jogibear9988 authored Apr 22, 2020
2 parents cf3a4f5 + 41f6d86 commit c593752
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 4 deletions.
1 change: 1 addition & 0 deletions LibNoDaveConnectionLibrary/DataTypes/PLCType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ public enum PLCType
SimaticET200 = 6,
Simatic1500 = 7,
SimaticET200SP = 8,
SimaticRTX = 9,
}
}
25 changes: 21 additions & 4 deletions LibNoDaveConnectionLibrary/Projectfiles/Step7ProjectV5.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,12 @@ public class Step7ProjectV5 : Project, IDisposable
const int objectType_Simatic300 = 1314969;
const int objectType_Simatic400 = 1314970;
const int objectType_Simatic400H = 1315650;
const int objectType_SimaticRTX = 1315651;
const int objectType_EternetInCPU3xx = 2364796;
const int objectType_EternetInCPU3xx_2 = 2364572; //Alternative type e.g. 6ES7 318-3EL00-0AB0 (Only one port).
const int objectType_EternetInCPU3xxF = 2364818;
const int objectType_EternetInCPU4xx = 2364763;
const int objectType_EternetInCPURTX = 2364315; // E.g. 6ES7 611-4SB00-0YB7
const int objectType_MpiDPinCPU = 1314972;
const int objectType_MpiDP400 = 1315038;
const int objectType_MpiDP300 = 1315016;
Expand Down Expand Up @@ -238,7 +241,10 @@ override protected void LoadProject()
{
if (!(bool)row["DELETED_FLAG"] || _showDeleted)
{
if ((int)row["OBJTYP"] == objectType_Simatic300 || (int)row["OBJTYP"] == objectType_Simatic400 || (int)row["OBJTYP"] == objectType_Simatic400H)
if ((int)row["OBJTYP"] == objectType_Simatic300 ||
(int)row["OBJTYP"] == objectType_Simatic400 ||
(int)row["OBJTYP"] == objectType_Simatic400H ||
(int)row["OBJTYP"] == objectType_SimaticRTX)
{
var x = new StationConfigurationFolder() { Project = this, Parent = ProjectStructure };
x.Name = ((string)row["Name"]).Replace("\0", "");
Expand All @@ -257,6 +263,9 @@ override protected void LoadProject()
case objectType_Simatic400H:
x.StationType = PLCType.Simatic400H;
break;
case objectType_SimaticRTX:
x.StationType = PLCType.SimaticRTX;
break;
}
x.Parent = ProjectStructure;
ProjectStructure.SubItems.Add(x);
Expand Down Expand Up @@ -534,7 +543,9 @@ override protected void LoadProject()
{
if (!(bool)row["DELETED_FLAG"] || _showDeleted)
{
if ((int)row["ID"] == y.ID && y.CpuType == PLCType.Simatic300)
if ((int)row["ID"] == y.ID &&
(y.CpuType == PLCType.Simatic300 ||
y.CpuType == PLCType.SimaticRTX))
//if ((int)row["UNITID"] == y.UnitID && y.CpuType == PLCType.Simatic300)
{
y.Name = ((string)row["Name"]).Replace("\0", "");
Expand Down Expand Up @@ -689,7 +700,9 @@ override protected void LoadProject()
int fldid = (int)row["TOBJID"];
foreach (var y in CPUFolders)
{
if (y.ID == cpuid && y.CpuType == PLCType.Simatic300)
if (y.ID == cpuid &&
(y.CpuType == PLCType.Simatic300 ||
y.CpuType == PLCType.SimaticRTX))
{
foreach (var z in S7ProgrammFolders)
{
Expand Down Expand Up @@ -931,7 +944,11 @@ override protected void LoadProject()
pnMasterSystems.Add(x);
_allFolders.Add(x);
}
else if (objType == objectType_EternetInCPU3xxF || objType == objectType_EternetInCPU3xx || objType == objectType_EternetInCPU4xx)
else if (objType == objectType_EternetInCPU3xxF ||
objType == objectType_EternetInCPU3xx ||
objType == objectType_EternetInCPU4xx ||
objType == objectType_EternetInCPU3xx_2 ||
objType == objectType_EternetInCPURTX)
{
var cpu = CPUFolders.FirstOrDefault(x => x.ID == Convert.ToInt32(row["UNITID"]));
if (cpu != null) cpu.IdTobjId = Convert.ToInt32(row["ID"]);
Expand Down

0 comments on commit c593752

Please sign in to comment.