-
Notifications
You must be signed in to change notification settings - Fork 78
Expand file tree
/
Copy pathITag.cs
More file actions
59 lines (52 loc) · 2.03 KB
/
ITag.cs
File metadata and controls
59 lines (52 loc) · 2.03 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
// Copyright (c) libplctag.NET contributors
// https://github.com/libplctag/libplctag.NET
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
// file, You can obtain one at https://mozilla.org/MPL/2.0/.
using System;
using System.Threading;
using System.Threading.Tasks;
namespace libplctag
{
/// <summary>
/// An interface to represent any generic tag without
/// exposing its value
/// </summary>
public interface ITag : IDisposable
{
int[] ArrayDimensions { get; set; }
string Gateway { get; set; }
string Name { get; set; }
string Path { get; set; }
PlcType? PlcType { get; set; }
Protocol? Protocol { get; set; }
int? ReadCacheMillisecondDuration { get; set; }
TimeSpan Timeout { get; set; }
bool? UseConnectedMessaging { get; set; }
bool? AllowPacking { get; set; }
TimeSpan? AutoSyncReadInterval { get; set; }
TimeSpan? AutoSyncWriteInterval { get; set; }
DebugLevel DebugLevel { get; set; }
event EventHandler<TagEventArgs> ReadStarted;
event EventHandler<TagEventArgs> ReadCompleted;
event EventHandler<TagEventArgs> WriteStarted;
event EventHandler<TagEventArgs> WriteCompleted;
event EventHandler<TagEventArgs> Aborted;
event EventHandler<TagEventArgs> Destroyed;
Status GetStatus();
void Initialize();
Task InitializeAsync(CancellationToken token = default);
bool TryInitialize();
Task<bool> TryInitializeAsync(CancellationToken token = default);
object Read();
Task<object> ReadAsync(CancellationToken token = default);
bool TryRead();
Task<bool> TryReadAsync(CancellationToken token = default);
void Write();
Task WriteAsync(CancellationToken token = default);
bool TryWrite();
Task<bool> TryWriteAsync(CancellationToken token = default);
object Value { get; set; }
}
}