Skip to content

Commit

Permalink
IEC61850: auto reconnection with devices.
Browse files Browse the repository at this point in the history
  • Loading branch information
riclolsen authored Nov 18, 2023
1 parent d947443 commit e9694d1
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions iec61850_client/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace OSHMI_IEC61850_Client
{
class Program
{
static public string Version = "OSHMI IEC61850 Client Driver Version 0.9";
static public string Version = "OSHMI IEC61850 Client Driver Version 0.10";
static public string HmiConfigFile = "c:\\oshmi\\conf\\hmi.ini";
static public string OtherHmiIp = "";
static public string ConfigFile = "c:\\oshmi\\conf\\iec61850_client.conf";
Expand Down Expand Up @@ -778,12 +778,6 @@ static void Process(Iec61850Server srv)

do
{
// when device disconnected, will abort and keep trying to reconnect
if (con.GetState() != IedConnectionState.IED_STATE_CONNECTED)
{
throw new Exception(srv.name + " Connection error detected!");
}

// foreach (IEC61850_entry entry in srv.entries)
for (int i = 0; i < srv.entries.Count; i++)
{
Expand Down Expand Up @@ -924,6 +918,12 @@ static void Process(Iec61850Server srv)
else
// wait 1/10 second
Thread.Sleep(100);

// when device disconnected, will abort and keep trying to reconnect
if (con.GetState() != IedConnectionState.IED_STATE_CONNECTED)
{
throw new Exception(srv.name + " Connection error detected!");
}
}

if (brcbCountPrev != srv.brcbCount)
Expand Down

0 comments on commit e9694d1

Please sign in to comment.