1
0
Fork 0
master
nodyang@aliyun.com 2 months ago
parent 57cc190a41
commit 02d471ea46

File diff suppressed because it is too large Load Diff

@ -32,6 +32,10 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="HslCommunication, Version=12.1.3.0, Culture=neutral, PublicKeyToken=3d72ad3b6b5ec0e3, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\HighWayIot.Library\HslCommunication.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
@ -59,10 +63,5 @@
<ItemGroup>
<Folder Include="Impl\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="HslCommunication">
<Version>12.1.3</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

@ -36,7 +36,11 @@ namespace HighWayIot.Plc
SocketKeepAliveTime = -1,
IsPersistentConnection = true,
};
plc.ConnectServer();
var reslt= plc.ConnectServer();
if (!reslt.IsSuccess)
{
logHelper.Info("链接失败:"+reslt.Message);
}
}
catch (Exception ex)
{

@ -31,7 +31,7 @@ namespace HighWayIot.Winform
//Console.OutputEncoding = System.Text.Encoding.UTF8;
//Console.InputEncoding = System.Text.Encoding.UTF8;
var b= PlcConnect.IsConnect;
AllocConsole();//调用系统API调用控制台窗口
// 设置控制台编码为系统默认编码(解决乱码问题)

Loading…
Cancel
Save