Skip to content

Commit 87226f6

Browse files
committed
Offsetinfo ProgramAlarm is more general for FBs / SFBs
1 parent 39adce3 commit 87226f6

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/S7CommPlusDriver/Core/POffsetInfoType.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public enum OffsetInfoType
5959
Struct = 12,
6060
Struct1Dim = 13,
6161
StructMDim = 14,
62-
ProgramAlarm = 15
62+
FbSfb = 15
6363
}
6464

6565
public abstract bool HasRelation();
@@ -93,15 +93,15 @@ public static POffsetInfoType Deserialize(Stream buffer, int offsetinfotype, out
9393
case OffsetInfoType.StructElemStructMDim:
9494
case OffsetInfoType.StructMDim:
9595
return POffsetInfoType_StructMDim.Deserialize(buffer, out length);
96-
case OffsetInfoType.ProgramAlarm:
97-
return POffsetInfoType_ProgramAlarm.Deserialize(buffer, out length);
96+
case OffsetInfoType.FbSfb:
97+
return POffsetInfoType_FbSfb.Deserialize(buffer, out length);
9898
}
9999
length = 0;
100100
return null;
101101
}
102102
}
103103

104-
public class POffsetInfoType_ProgramAlarm : POffsetInfoType, IOffsetInfoType_Relation
104+
public class POffsetInfoType_FbSfb : POffsetInfoType, IOffsetInfoType_Relation
105105
{
106106
public UInt16 UnspecifiedOffsetinfo1;
107107
public UInt16 UnspecifiedOffsetinfo2;
@@ -121,10 +121,10 @@ public class POffsetInfoType_ProgramAlarm : POffsetInfoType, IOffsetInfoType_Rel
121121
public override bool Is1Dim() { return false; }
122122
public override bool IsMDim() { return false; }
123123

124-
public static POffsetInfoType_ProgramAlarm Deserialize(Stream buffer, out int length)
124+
public static POffsetInfoType_FbSfb Deserialize(Stream buffer, out int length)
125125
{
126126
int ret = 0;
127-
POffsetInfoType_ProgramAlarm oi = new POffsetInfoType_ProgramAlarm();
127+
POffsetInfoType_FbSfb oi = new POffsetInfoType_FbSfb();
128128

129129
ret += S7p.DecodeUInt16LE(buffer, out oi.UnspecifiedOffsetinfo1);
130130
ret += S7p.DecodeUInt16LE(buffer, out oi.UnspecifiedOffsetinfo2);
@@ -147,7 +147,7 @@ public static POffsetInfoType_ProgramAlarm Deserialize(Stream buffer, out int le
147147
public override string ToString()
148148
{
149149
string s = "";
150-
s += "<POffsetInfoType_ProgramAlarm>" + Environment.NewLine;
150+
s += "<POffsetInfoType_FbSfb>" + Environment.NewLine;
151151
s += "<UnspecifiedOffsetinfo1>" + UnspecifiedOffsetinfo1.ToString() + "</UnspecifiedOffsetinfo1>" + Environment.NewLine;
152152
s += "<UnspecifiedOffsetinfo2>" + UnspecifiedOffsetinfo2.ToString() + "</UnspecifiedOffsetinfo2>" + Environment.NewLine;
153153

@@ -163,7 +163,7 @@ public override string ToString()
163163
s += "<RetainSectionOffset>" + RetainSectionOffset.ToString() + "</RetainSectionOffset>" + Environment.NewLine;
164164
s += "<VolatileSectionOffset>" + VolatileSectionOffset.ToString() + "</VolatileSectionOffset>" + Environment.NewLine;
165165

166-
s += "</POffsetInfoType_ProgramAlarm>" + Environment.NewLine;
166+
s += "</POffsetInfoType_FbSfb>" + Environment.NewLine;
167167

168168
return s;
169169
}

0 commit comments

Comments
 (0)