This commit is contained in:
Admin 2026-08-12 10:12:51 +08:00
parent eda0be4ee8
commit 7aa52bd3ce
5 changed files with 20 additions and 13 deletions

View File

@ -495,7 +495,7 @@ namespace Model
{
//allDone.Set();
// ConnSocket = (Socket)ar.AsyncState;
if (ConnSocket.Connected)
if (ConnSocket!=null &&ConnSocket.Connected)
{
ConnSocket.EndConnect(ar);//挂起异步连接
@ -518,7 +518,7 @@ namespace Model
Showmsg.StatusBackground = ColorStr.Red;
Showmsg.StatusForeground = ColorStr.White;
//重连
ConnSocket.BeginConnect(Endpoint, new AsyncCallback(ConnectCallback), ConnSocket);
if (ConnSocket != null ) ConnSocket.BeginConnect(Endpoint, new AsyncCallback(ConnectCallback), ConnSocket);
}

View File

@ -41,9 +41,8 @@
<HintPath>..\packages\ControlzEx.4.3.2\lib\net45\ControlzEx.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="halcondotnet, Version=17.12.0.0, Culture=neutral, PublicKeyToken=4973bed59ddbf2b8, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files\MVTec\HALCON-17.12-Progress\bin\dotnet35\halcondotnet.dll</HintPath>
<Reference Include="halcondotnet">
<HintPath>..\FeiYu\bin\Debug\halcondotnet.dll</HintPath>
</Reference>
<Reference Include="HslCommunication, Version=10.2.0.0, Culture=neutral, PublicKeyToken=cdb2261fa039ed67, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>

View File

@ -2004,6 +2004,10 @@ namespace ViewModel
{
while (true)
{
try
{
if (RunStatu == RunStatuEnum.Normal)
{
if (MyPLC != null && MyPLC.PLC != null && MyPLC.PLC.PlcStatus.StatusBackground == ColorStr.Green)
@ -2014,7 +2018,7 @@ namespace ViewModel
lockTime = DateTime.Now;
MyPLC.PLC.Write("Y2", true);
Door = "已锁";
break;
}
@ -2029,7 +2033,7 @@ namespace ViewModel
if (MyPLC.PLC.PlcStatus.StatusBackground != ColorStr.Green)
{
ExcepStop("PLC未连接");
return;
}
if (MyPLC.PLC.ReadBool("X0") == false)
@ -2048,7 +2052,14 @@ namespace ViewModel
LogicDispatch(LogicDispatchFlow);
}
}
catch (Exception ex)
{
ExcepStop(ex.Message);
}
}

View File

@ -39,7 +39,7 @@
</Reference>
<Reference Include="halcondotnet, Version=17.12.0.0, Culture=neutral, PublicKeyToken=4973bed59ddbf2b8, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>C:\Program Files\MVTec\HALCON-17.12-Progress\bin\dotnet35\halcondotnet.dll</HintPath>
<HintPath>..\FeiYu\bin\Debug\halcondotnet.dll</HintPath>
</Reference>
<Reference Include="HslCommunication, Version=10.2.0.0, Culture=neutral, PublicKeyToken=cdb2261fa039ed67, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
@ -57,9 +57,6 @@
<HintPath>..\packages\MahApps.Metro.2.2.0\lib\net452\MahApps.Metro.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="MesService">
<HintPath>..\FeiYu\bin\Debug\MesService.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Xaml.Behaviors, Version=1.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Xaml.Behaviors.Wpf.1.1.19\lib\net45\Microsoft.Xaml.Behaviors.dll</HintPath>
<Private>True</Private>

View File

@ -40,7 +40,7 @@
<Private>True</Private>
</Reference>
<Reference Include="halcondotnet">
<HintPath>C:\Program Files\MVTec\HALCON-17.12-Progress\bin\dotnet35\halcondotnet.dll</HintPath>
<HintPath>..\FeiYu\bin\Debug\halcondotnet.dll</HintPath>
</Reference>
<Reference Include="LiveCharts, Version=0.9.7.0, Culture=neutral, PublicKeyToken=0bc1f845d1ebb8df, processorArchitecture=MSIL">
<HintPath>..\packages\LiveCharts.0.9.7\lib\net45\LiveCharts.dll</HintPath>