Dreamine.IO.Fastech.Ethernet
1.0.1
Dreamine.IO.Fastech.Ethernet 산업 자동화 및 I/O 기능을 제공합니다.
Toggle main menu visibility
로딩중...
검색중...
일치하는것 없음
FastechAnalogInputChannel.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
FastechAnalogInputChannel : IAnalogInputChannel
17
{
26
private
readonly
FastechEthernetIoController
_controller
;
27
52
internal
FastechAnalogInputChannel(
FastechEthernetIoController
controller)
53
{
54
_controller
= controller ??
throw
new
ArgumentNullException(nameof(controller));
55
}
56
89
public
async Task<IoResult<double>>
ReadAsync
(AnalogIoPoint 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<double>.Failure(result.Message ??
"Failed to read the analog input."
, result.ErrorCode);
96
}
97
98
return
result.Value.Length == 1
99
? IoResult<double>.Success(result.Value[0])
100
: IoResult<double>.Failure(
"The analog input response did not contain exactly one value."
);
101
}
102
135
public
Task<IoResult<double[]>>
ReadAsync
(IReadOnlyList<AnalogIoPoint> points, CancellationToken cancellationToken =
default
)
136
{
137
return
_controller
.ReadAnalogInputsAsync(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.FastechAnalogInputChannel._controller
readonly FastechEthernetIoController _controller
Definition
FastechAnalogInputChannel.cs:26
Dreamine.IO.Fastech.Ethernet.Channels.FastechAnalogInputChannel.ReadAsync
async Task< IoResult< double > > ReadAsync(AnalogIoPoint point, CancellationToken cancellationToken=default)
Definition
FastechAnalogInputChannel.cs:89
Dreamine.IO.Fastech.Ethernet.Channels.FastechAnalogInputChannel.ReadAsync
Task< IoResult< double[]> > ReadAsync(IReadOnlyList< AnalogIoPoint > points, CancellationToken cancellationToken=default)
Definition
FastechAnalogInputChannel.cs:135
Dreamine.IO.Fastech.Ethernet.Controllers.FastechEthernetIoController
Definition
FastechEthernetIoController.cs:22
Channels
FastechAnalogInputChannel.cs
다음에 의해 생성됨 :
1.17.0