Skip to content

Commit 94396c7

Browse files
committed
fix: Ignore symbols for FCs if no symbols are available
1 parent 59a1206 commit 94396c7

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

LibNoDaveConnectionLibrary/DataTypes/Blocks/Step7V5/S7FunctionBlockRow.cs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -781,9 +781,12 @@ public string ToString(bool useSymbol, bool addSemicolonAfterCommand, bool useDa
781781
}
782782
else
783783
{
784-
par = "\"" + sym.Symbol + "\"." + paras[1];
785-
if (hasBit)
786-
par += "." + paras[2];
784+
if (sym != null)
785+
{
786+
par = "\"" + sym.Symbol + "\"." + paras[1];
787+
if (hasBit)
788+
par += "." + paras[2];
789+
}
787790
}
788791
}
789792
}

LibNoDaveConnectionLibrary/DataTypes/Projectfolders/Step7V5/BlocksOfflineFolder.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,14 @@ public Block GetBlock(ProjectBlockInfo blkInfo, S7ConvertingOptions myConvOpt)
660660

661661
retVal.AWLCode = MC7toAWL.GetAWL(0, myTmpBlk.mc7code.Length - 2, (int)myConvOpt.Mnemonic, myTmpBlk.mc7code, Networks, ParaList, prgFld, retVal, retVal.Parameter);
662662

663-
retVal.AWLCode = JumpMarks.AddJumpmarks(retVal.AWLCode, myTmpBlk.jumpmarks, myTmpBlk.nwinfo, myConvOpt);
663+
try
664+
{
665+
retVal.AWLCode = JumpMarks.AddJumpmarks(retVal.AWLCode, myTmpBlk.jumpmarks, myTmpBlk.nwinfo, myConvOpt);
666+
}
667+
catch
668+
{
669+
//If the Jumpmarks are not valid, then just ignore them (eg. blocks written in C)
670+
}
664671

665672
LocalDataConverter.ConvertLocaldataToSymbols(retVal, myConvOpt);
666673

0 commit comments

Comments
 (0)