Dreamine.IO.Fastech.Ethernet
1.0.1
Dreamine.IO.Fastech.Ethernet 산업 자동화 및 I/O 기능을 제공합니다.
Toggle main menu visibility
로딩중...
검색중...
일치하는것 없음
FastechDigitalInputChannel.cs
이 파일의 문서화 페이지로 가기
1
using
Dreamine.IO.Abstractions.Channels;
2
using
Dreamine.IO.Abstractions.Models;
3
using
Dreamine.IO.Abstractions.Results;
4
using
Dreamine.IO.Fastech.Ethernet.Controllers
;
5
6
namespace
Dreamine.IO.Fastech.Ethernet.Channels
;
7
16
public
sealed
class
FastechDigitalInputChannel : IDigitalInputChannel
17
{
26
private
readonly
FastechEthernetIoController
_controller
;
27
52
internal
FastechDigitalInputChannel(
FastechEthernetIoController
controller)
53
{
54
_controller
= controller ??
throw
new
ArgumentNullException(nameof(controller));
55
}
56
89
public
async Task<IoResult<bool>>
ReadAsync
(IoPoint point, CancellationToken cancellationToken =
default
)
90
{
91
var result = await
ReadAsync
([point], cancellationToken).ConfigureAwait(
false
);
92
93
if
(!result.IsSuccess || result.Value is
null
)
94
{
95
return
IoResult<bool>.Failure(result.Message ??
"Failed to read the digital input."
, result.ErrorCode);
96
}
97
98
return
result.Value.Length == 1
99
? IoResult<bool>.Success(result.Value[0])
100
: IoResult<bool>.Failure(
"The digital input response did not contain exactly one value."
);
101
}
102
135
public
Task<IoResult<bool[]>>
ReadAsync
(IReadOnlyList<IoPoint> points, CancellationToken cancellationToken =
default
)
136
{
137
return
_controller
.ReadDigitalInputsAsync(points, cancellationToken);
138
}
139
}
Dreamine.IO.Fastech.Ethernet.Channels
Definition
FastechAnalogInputChannel.cs:6
Dreamine.IO.Fastech.Ethernet.Controllers
Definition
FastechEthernetIoController.cs:11
Dreamine.IO.Fastech.Ethernet.Channels.FastechDigitalInputChannel.ReadAsync
Task< IoResult< bool[]> > ReadAsync(IReadOnlyList< IoPoint > points, CancellationToken cancellationToken=default)
Definition
FastechDigitalInputChannel.cs:135
Dreamine.IO.Fastech.Ethernet.Channels.FastechDigitalInputChannel.ReadAsync
async Task< IoResult< bool > > ReadAsync(IoPoint point, CancellationToken cancellationToken=default)
Definition
FastechDigitalInputChannel.cs:89
Dreamine.IO.Fastech.Ethernet.Channels.FastechDigitalInputChannel._controller
readonly FastechEthernetIoController _controller
Definition
FastechDigitalInputChannel.cs:26
Dreamine.IO.Fastech.Ethernet.Controllers.FastechEthernetIoController
Definition
FastechEthernetIoController.cs:22
Channels
FastechDigitalInputChannel.cs
다음에 의해 생성됨 :
1.17.0