Skip to content

Commit

Permalink
Merge pull request #84 from StefanHasensperling/BugFix_Parameter.cs
Browse files Browse the repository at this point in the history
Bug fix in BlockInterface Parsing.
  • Loading branch information
jogibear9988 authored Sep 21, 2017
2 parents 8fa3e7d + 8f4450a commit c5342de
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions LibNoDaveConnectionLibrary/PLCs/S7_xxx/MC7/Parameter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,10 @@ internal static S7DataRow GetInterface(byte[] interfaceBytes, byte[] startValueB
GetVarTypeEN(parameterRETVAL, DataType, false, false, VarNameGen.GetNextVarName(), interfaceBytes,ref InterfacePos, startValueBytes, ref StartValuePos, ref ParaList, ref StackNr, VarNameGen, myBlk);
}
break;
default:
{
throw new Exception(string.Format ("invalid or unknown interface declarations found while parsing the block interface at pos {0} with Paratype {1} and Datatype {2}",InterfacePos, interfaceBytes[InterfacePos +1], interfaceBytes[InterfacePos]));
}
}
}

Expand Down Expand Up @@ -859,8 +863,9 @@ internal static void GetVarTypeEN(S7DataRow currPar, S7DataRowType datatype, bo
break;

default:
System.Diagnostics.Trace.WriteLine("Found unknown Datatype while parsing an Interface:" + Convert.ToString(datatype) + ")");
break;
{
throw new Exception(string.Format("invalid or unknown interface declarations found while parsing the block interface at pos {0} with Paratype {1} and Datatype {2}", InterfacePos, interfaceBytes[InterfacePos + 1], interfaceBytes[InterfacePos]));
}
}

ParaList.Add(VarName);
Expand Down

0 comments on commit c5342de

Please sign in to comment.