This commit is contained in:
parallelbgls
2017-12-26 10:36:40 +08:00
parent 7ad440c9e5
commit f5a0a6533c
8 changed files with 16 additions and 18 deletions

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net45;netstandard20</TargetFrameworks>
<TargetFrameworks>net45;netstandard2.0</TargetFrameworks>
<AssemblyName>Modbus.Net.Modbus</AssemblyName>
<RootNamespace>Modbus.Net.Modbus</RootNamespace>
<PackageId>Modbus.Net.Modbus</PackageId>
@@ -23,7 +23,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>bin\Debug\net45\Modbus.Net.Modbus.xml</DocumentationFile>
<DocumentationFile>bin\Debug\Modbus.Net.Modbus.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>

View File

@@ -31,7 +31,7 @@ namespace Modbus.Net.OPC
/// E.g: the tag `foo.bar` reads the tag `bar` on the folder `foo`
/// </param>
/// <returns>The value retrieved from the OPC</returns>
T Read<T>(string tag);
ReadEvent<T> Read<T>(string tag);
/// <summary>
/// Write a value on the specified opc tag
@@ -47,7 +47,7 @@ namespace Modbus.Net.OPC
/// <summary>
/// Read a tag asynchronusly
/// </summary>
Task<T> ReadAsync<T>(string tag);
Task<ReadEvent<T>> ReadAsync<T>(string tag);
/// <summary>
/// Write a value on the specified opc tag asynchronously

View File

@@ -23,11 +23,11 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>bin\Debug\net45\Modbus.Net.OPC.xml</DocumentationFile>
<DocumentationFile>bin\Debug\Modbus.Net.OPC.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="H.Opc" Version="0.9.2" />
<PackageReference Include="H.Opc" Version="0.9.3" />
</ItemGroup>
<ItemGroup>

View File

@@ -90,11 +90,11 @@ namespace Modbus.Net.OPC
if (answerTag != null)
{
var result = await Client.ReadAsync<object>(answerTag);
Log.Verbose($"Opc Machine {ConnectionToken} Read opc tag {answerTag} for value {result}");
Log.Verbose($"Opc Machine {ConnectionToken} Read opc tag {answerTag} for value {result.Value}");
return new OpcParamOut
{
Success = true,
Value = BigEndianValueHelper.Instance.GetBytes(result, result.GetType())
Value = BigEndianValueHelper.Instance.GetBytes(result.Value, result.Value.GetType())
};
}
return new OpcParamOut

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net45;netstandard20</TargetFrameworks>
<TargetFrameworks>net45;netstandard2.0</TargetFrameworks>
<AssemblyName>Modbus.Net.Siemens</AssemblyName>
<RootNamespace>Modbus.Net.Siemens</RootNamespace>
<PackageId>Modbus.Net.Siemens</PackageId>
@@ -22,7 +22,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>bin\Debug\net45\Modbus.Net.Siemens.xml</DocumentationFile>
<DocumentationFile>bin\Debug\Modbus.Net.Siemens.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>

View File

@@ -3,7 +3,6 @@ using System.Collections.Generic;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
using Serilog;
namespace Modbus.Net
{
@@ -121,8 +120,7 @@ namespace Modbus.Net
/// <returns>从等待队列中匹配的信息</returns>
protected abstract MessageWaitingDef GetMessageFromWaitingList(byte[] receiveMessage);
/// <inheritdoc cref="IController.ForceRemoveWaitingMessage(MessageWaitingDef)"/>
/// <param name="def"></param>
/// <inheritdoc />
public void ForceRemoveWaitingMessage(MessageWaitingDef def)
{
lock (WaitingMessages)

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>net45;netstandard20</TargetFrameworks>
<TargetFrameworks>net45;netstandard2.0</TargetFrameworks>
<AssemblyName>Modbus.Net</AssemblyName>
<RootNamespace>Modbus.Net</RootNamespace>
<PackageId>Modbus.Net</PackageId>
@@ -23,7 +23,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<DocumentationFile>bin\Debug\net45\Modbus.Net.xml</DocumentationFile>
<DocumentationFile>bin\Debug\Modbus.Net.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
@@ -38,7 +38,7 @@
<Reference Include="System.Configuration" />
</ItemGroup>
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard20' ">
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="Nito.AsyncEx.Tasks" Version="1.1.0" />
<PackageReference Include="Nito.AsyncEx.Coordination" Version="1.0.2" />
<PackageReference Include="System.Collections.NonGeneric" Version="4.3.0" />