-
-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathIOpcDaServer.cs
More file actions
80 lines (68 loc) · 2.35 KB
/
IOpcDaServer.cs
File metadata and controls
80 lines (68 loc) · 2.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
// Copyright (c) Argo Zhang (argo@163.com). All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Website: https://www.blazor.zone or https://argozhang.github.io/
using Opc.Da;
namespace BootstrapBlazor.OpcDa;
/// <summary>
/// OpcDaServer 接口定义
/// </summary>
public interface IOpcDaServer : IDisposable
{
/// <summary>
/// 获得 OPC Server 是否已连接
/// </summary>
bool IsConnected { get; }
/// <summary>
/// 获得 OPC Server 名称
/// </summary>
string? ServerName { get; }
/// <summary>
/// 连接到 OPC Server 方法
/// </summary>
/// <param name="serverName"></param>
/// <returns></returns>
bool Connect(string serverName);
/// <summary>
/// 断开连接方法
/// </summary>
void Disconnect();
/// <summary>
/// 取消订阅方法
/// </summary>
/// <param name="subscription"></param>
void CancelSubscription(IOpcSubscription subscription);
/// <summary>
/// 创建订阅方法
/// </summary>
/// <param name="name">订阅名称</param>
/// <param name="updateRate">更新频率 默认 1000 毫秒</param>
/// <param name="active">是否激活 默认 true</param>
/// <returns></returns>
IOpcSubscription CreateSubscription(string name, int updateRate = 1000, bool active = true);
/// <summary>
/// 读取 Item 值方法
/// </summary>
/// <param name="items"></param>
/// <returns></returns>
HashSet<OpcReadItem> Read(params HashSet<string> items);
/// <summary>
/// 读取 Item 值方法
/// </summary>
/// <param name="items"></param>
/// <returns></returns>
HashSet<OpcWriteItem> Write(params HashSet<OpcWriteItem> items);
/// <summary>
/// 浏览 OPC Server 中的位号 (即数据项或者标签)
/// </summary>
/// <param name="name"></param>
/// <param name="filters"></param>
/// <param name="position"></param>
/// <returns></returns>
OpcBrowseElement[] Browse(string name, OpcBrowseFilters filters, out OpcBrowsePosition? position);
/// <summary>
/// 浏览 OPC Server 中的位号 (即数据项或者标签)
/// </summary>
/// <param name="position"></param>
/// <returns></returns>
OpcBrowseElement[] BrowseNext(OpcBrowsePosition position);
}