1
0
Fork 0
master
nodyang@aliyun.com 4 weeks ago
commit a8a09be534

@ -32,10 +32,6 @@
<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" />
@ -63,5 +59,8 @@
<ItemGroup>
<Folder Include="Impl\" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

@ -54,22 +54,23 @@ namespace HighWayIot.Plc
return plc;
}
///// <summary>
///// plc 是不是保持链接
///// </summary>
//public static bool IsConnect
//{
// get
// {
// if (MelsecInstance == null) return false;
// var result = MelsecInstance.ReadPlcType();
// logHelper.Info($"PLC型号{result.Content}");
// return result.IsSuccess;
// }
//}
/// <summary>
/// plc 是不是保持链接
/// </summary>
public static bool IsConnect
{
get
{
if (MelsecInstance == null) return false;
var result = MelsecInstance.ReadPlcType();
logHelper.Info($"PLC型号 信息:[{result.Message}] 内容:[{result.Message}]");
return result.IsSuccess;
}
}
public static int Test()
{
var s = IsConnect;
return MelsecInstance.ReadInt16("D1").Content;
}

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="HslCommunication" version="12.1.3" targetFramework="net48" />
<package id="Newtonsoft.Json" version="13.0.1" targetFramework="net48" />
</packages>

@ -1,6 +1,18 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" />
</startup>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-13.0.0.0" newVersion="13.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Oracle.ManagedDataAccess" publicKeyToken="89b483f429c47342" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.122.21.1" newVersion="4.122.21.1" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>

@ -312,10 +312,5 @@
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<PackageReference Include="HslCommunication">
<Version>12.1.3</Version>
</PackageReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
Loading…
Cancel
Save