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> <WarningLevel>4</WarningLevel>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <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" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" /> <Reference Include="System.Xml.Linq" />
@ -59,10 +63,5 @@
<ItemGroup> <ItemGroup>
<Folder Include="Impl\" /> <Folder Include="Impl\" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<PackageReference Include="HslCommunication">
<Version>12.1.3</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project> </Project>

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

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

Loading…
Cancel
Save