Skip to content

Commit

Permalink
Create draft PR for #500 (#501)
Browse files Browse the repository at this point in the history
  • Loading branch information
TomKovac authored Dec 16, 2024
1 parent 7489032 commit 776a4c2
Showing 1 changed file with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,17 @@ public Task StartPlcSim([Option('x', Description = "PlcSim instance name")] stri
break;
}
}
}

foreach (var instanceInfo in instanceInfos)
{
// Get name of the existing instance
string instanceName = instanceInfo.GetType().GetField("Name", BindingFlags.Public | BindingFlags.Instance).GetValue(instanceInfo)?.ToString();
if (instanceName.Equals(PlcSimInstanceName))
{
Console.WriteLine($"Instance {PlcSimInstanceName} already registered.");
var createInterfaceMethod = simulationRuntimeManager.GetMethod("CreateInterface", BindingFlags.Static | BindingFlags.Public, null, new Type[] { typeof(string) }, null);

plcSimInstance = createInterfaceMethod.Invoke(null, new object[] { PlcSimInstanceName });
instanceAlreadyRegistered = true;
break;
Expand Down

0 comments on commit 776a4c2

Please sign in to comment.