-
Notifications
You must be signed in to change notification settings - Fork 145
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from hylasoft-usa/async
add async methods to interface
- Loading branch information
Showing
11 changed files
with
116 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using System.Collections.Generic; | ||
using System.Threading.Tasks; | ||
using Hylasoft.Opc.Common; | ||
using OpcDa = Opc.Da; | ||
|
||
namespace Hylasoft.Opc.Da | ||
{ | ||
/// <summary> | ||
/// Client Implementation for DA | ||
/// </summary> | ||
public partial class DaClient | ||
{ | ||
/// <summary> | ||
/// Read a tag asynchronusly | ||
/// </summary> | ||
public async Task<T> ReadAsync<T>(string tag) | ||
{ | ||
return await Task.Run(() => Read<T>(tag)); | ||
} | ||
|
||
/// <summary> | ||
/// Write a value on the specified opc tag asynchronously | ||
/// </summary> | ||
public async Task WriteAsync<T>(string tag, T item) | ||
{ | ||
await Task.Run(() => Write(tag, item)); | ||
} | ||
|
||
/// <summary> | ||
/// Finds a node on the Opc Server asynchronously | ||
/// </summary> | ||
public async Task<Node> FindNodeAsync(string tag) | ||
{ | ||
return await Task.Run(() => FindNode(tag)); | ||
} | ||
|
||
/// <summary> | ||
/// Explore a folder on the Opc Server asynchronously | ||
/// </summary> | ||
public async Task<IEnumerable<Node>> ExploreFolderAsync(string tag) | ||
{ | ||
return await Task.Run(() => ExploreFolder(tag)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters