Dreamine.PLC.Mitsubishi.MC 1.0.1
Dreamine.PLC.Mitsubishi.MC 산업 자동화 및 I/O 기능을 제공합니다.
로딩중...
검색중...
일치하는것 없음
Dreamine.PLC.Mitsubishi.MC.Clients.MitsubishiMcPlcClient 클래스 참조sealed

더 자세히 ...

Dreamine.PLC.Mitsubishi.MC.Clients.MitsubishiMcPlcClient에 대한 상속 다이어그램 :
Dreamine.PLC.Mitsubishi.MC.Clients.MitsubishiMcPlcClient에 대한 협력 다이어그램:

Public 멤버 함수

 MitsubishiMcPlcClient (MitsubishiMcConnectionOptions options)
 MitsubishiMcPlcClient (MitsubishiMcConnectionOptions options, IMitsubishiMcTransport transport, MitsubishiMcBinary3EFrameBuilder frameBuilder, MitsubishiMcBinary3EResponseParser responseParser)
override async ValueTask DisposeAsync ()

Protected 멤버 함수

override Task< PlcResult > ConnectCoreAsync (CancellationToken cancellationToken)
override Task< PlcResult > DisconnectCoreAsync (CancellationToken cancellationToken)
override async Task< PlcResult< bool[]> > ReadBitsCoreAsync (PlcAddress address, int count, CancellationToken cancellationToken)
override async Task< PlcResult< short[]> > ReadWordsCoreAsync (PlcAddress address, int count, CancellationToken cancellationToken)
override async Task< PlcResult > WriteBitsCoreAsync (PlcAddress address, IReadOnlyList< bool > values, CancellationToken cancellationToken)
override async Task< PlcResult > WriteWordsCoreAsync (PlcAddress address, IReadOnlyList< short > values, CancellationToken cancellationToken)

속성

MitsubishiMcConnectionOptions Options [get]

정적 Private 멤버 함수

static IMitsubishiMcTransport CreateTransport (MitsubishiMcConnectionOptions options)

Private 속성

readonly MitsubishiMcConnectionOptions _options
readonly IMitsubishiMcTransport _transport
readonly MitsubishiMcBinary3EFrameBuilder _frameBuilder
readonly MitsubishiMcBinary3EResponseParser _responseParser

상세한 설명

Mitsubishi MC 프로토콜 PLC 클라이언트를 제공합니다.

MitsubishiMcPlcClient.cs 파일의 18 번째 라인에서 정의되었습니다.

생성자 & 소멸자 문서화

◆ MitsubishiMcPlcClient() [1/2]

Dreamine.PLC.Mitsubishi.MC.Clients.MitsubishiMcPlcClient.MitsubishiMcPlcClient ( MitsubishiMcConnectionOptions options)
inline

옵션에 맞는 기본 전송과 프레임 구성 요소로 클라이언트를 초기화합니다.

매개변수
options연결 옵션입니다.
예외
ArgumentNullException옵션이 null인 경우 발생합니다.
ArgumentOutOfRangeException전송 타입이 지원되지 않는 경우 발생합니다.

MitsubishiMcPlcClient.cs 파일의 87 번째 라인에서 정의되었습니다.

88 : this(
89 options,
90 CreateTransport(options),
91 new MitsubishiMcBinary3EFrameBuilder(),
92 new MitsubishiMcBinary3EResponseParser())
93 {
94 }

다음을 참조함 : CreateTransport().

이 함수 내부에서 호출하는 함수들에 대한 그래프입니다.:

◆ MitsubishiMcPlcClient() [2/2]

Dreamine.PLC.Mitsubishi.MC.Clients.MitsubishiMcPlcClient.MitsubishiMcPlcClient ( MitsubishiMcConnectionOptions options,
IMitsubishiMcTransport transport,
MitsubishiMcBinary3EFrameBuilder frameBuilder,
MitsubishiMcBinary3EResponseParser responseParser )
inline

지정한 옵션, 전송, 프레임 빌더 및 응답 파서로 클라이언트를 초기화합니다.

매개변수
options연결 옵션입니다.
transportMC 전송입니다.
frameBuilderBinary 3E 빌더입니다.
responseParserBinary 3E 파서입니다.
예외
ArgumentNullException인수 중 하나가 null인 경우 발생합니다.

MitsubishiMcPlcClient.cs 파일의 140 번째 라인에서 정의되었습니다.

145 {
146 _options = options ?? throw new ArgumentNullException(nameof(options));
147 _transport = transport ?? throw new ArgumentNullException(nameof(transport));
148 _frameBuilder = frameBuilder ?? throw new ArgumentNullException(nameof(frameBuilder));
149 _responseParser = responseParser ?? throw new ArgumentNullException(nameof(responseParser));
150 }

다음을 참조함 : _frameBuilder, _options, _responseParser, _transport.

멤버 함수 문서화

◆ ConnectCoreAsync()

override Task< PlcResult > Dreamine.PLC.Mitsubishi.MC.Clients.MitsubishiMcPlcClient.ConnectCoreAsync ( CancellationToken cancellationToken)
inlineprotected

구성된 호스트와 포트로 MC 전송을 연결합니다.

매개변수
cancellationToken취소 토큰입니다.
반환값
연결 결과입니다.

MitsubishiMcPlcClient.cs 파일의 232 번째 라인에서 정의되었습니다.

233 {
234 return _transport.ConnectAsync(
235 _options.Host,
236 _options.Port,
237 _options.ConnectTimeoutMs,
238 cancellationToken);
239 }

다음을 참조함 : _options, _transport.

◆ CreateTransport()

IMitsubishiMcTransport Dreamine.PLC.Mitsubishi.MC.Clients.MitsubishiMcPlcClient.CreateTransport ( MitsubishiMcConnectionOptions options)
inlinestaticprivate

옵션의 전송 타입에 맞는 TCP 또는 UDP 전송을 만듭니다.

매개변수
options연결 옵션입니다.
반환값
생성된 전송입니다.
예외
ArgumentNullException옵션이 null인 경우 발생합니다.
ArgumentOutOfRangeException전송 타입이 지원되지 않는 경우 발생합니다.

MitsubishiMcPlcClient.cs 파일의 198 번째 라인에서 정의되었습니다.

199 {
200 ArgumentNullException.ThrowIfNull(options);
201
202 return options.TransportType switch
203 {
204 MitsubishiMcTransportType.Tcp => new TcpMitsubishiMcTransport(),
205 MitsubishiMcTransportType.Udp => new UdpMitsubishiMcTransport(),
206 _ => throw new ArgumentOutOfRangeException(nameof(options), options.TransportType, "Unsupported Mitsubishi MC transport type.")
207 };
208 }

다음을 참조함 : Dreamine.PLC.Mitsubishi.MC.Options.Tcp, Dreamine.PLC.Mitsubishi.MC.Options.MitsubishiMcConnectionOptions.TransportType, Dreamine.PLC.Mitsubishi.MC.Options.Udp.

다음에 의해서 참조됨 : MitsubishiMcPlcClient().

이 함수를 호출하는 함수들에 대한 그래프입니다.:

◆ DisconnectCoreAsync()

override Task< PlcResult > Dreamine.PLC.Mitsubishi.MC.Clients.MitsubishiMcPlcClient.DisconnectCoreAsync ( CancellationToken cancellationToken)
inlineprotected

MC 전송 연결을 해제합니다.

매개변수
cancellationToken취소 토큰입니다.
반환값
연결 해제 결과입니다.

MitsubishiMcPlcClient.cs 파일의 263 번째 라인에서 정의되었습니다.

264 {
265 return _transport.DisconnectAsync(cancellationToken);
266 }

다음을 참조함 : _transport.

◆ DisposeAsync()

override async ValueTask Dreamine.PLC.Mitsubishi.MC.Clients.MitsubishiMcPlcClient.DisposeAsync ( )
inline

기본 클라이언트와 MC 전송을 순서대로 비동기 해제합니다.

반환값
비동기 해제 작업입니다.

MitsubishiMcPlcClient.cs 파일의 577 번째 라인에서 정의되었습니다.

578 {
579 await base.DisposeAsync().ConfigureAwait(false);
580 await _transport.DisposeAsync().ConfigureAwait(false);
581 }

다음을 참조함 : _transport.

◆ ReadBitsCoreAsync()

override async Task< PlcResult< bool[]> > Dreamine.PLC.Mitsubishi.MC.Clients.MitsubishiMcPlcClient.ReadBitsCoreAsync ( PlcAddress address,
int count,
CancellationToken cancellationToken )
inlineprotected

비트 읽기 프레임을 송수신하고 응답 비트를 구문 분석합니다.

매개변수
address시작 주소입니다.
count비트 수입니다.
cancellationToken취소 토큰입니다.
반환값
비트 결과입니다.

MitsubishiMcPlcClient.cs 파일의 304 번째 라인에서 정의되었습니다.

308 {
309 var frameResult = _frameBuilder.BuildBatchReadFrame(
310 _options,
311 address,
312 count,
313 isBitAccess: true);
314
315 if (!frameResult.IsSuccess || frameResult.Value is null)
316 {
317 return PlcResult<bool[]>.Failure(
318 frameResult.Message ?? "Failed to build Mitsubishi MC bit read frame.",
319 frameResult.ErrorCode);
320 }
321
322 var responseResult = await _transport.SendAndReceiveAsync(
323 frameResult.Value,
324 _options.ReceiveTimeoutMs,
325 _options.RetryCount,
326 cancellationToken).ConfigureAwait(false);
327
328 if (!responseResult.IsSuccess || responseResult.Value is null)
329 {
330 return PlcResult<bool[]>.Failure(
331 responseResult.Message ?? "Failed to receive Mitsubishi MC bit read response.",
332 responseResult.ErrorCode);
333 }
334
335 return _responseParser.ParseReadBits(responseResult.Value, count);
336 }

다음을 참조함 : _frameBuilder, _options, _responseParser, _transport.

◆ ReadWordsCoreAsync()

override async Task< PlcResult< short[]> > Dreamine.PLC.Mitsubishi.MC.Clients.MitsubishiMcPlcClient.ReadWordsCoreAsync ( PlcAddress address,
int count,
CancellationToken cancellationToken )
inlineprotected

워드 읽기 프레임을 송수신하고 응답 워드를 구문 분석합니다.

매개변수
address시작 주소입니다.
count워드 수입니다.
cancellationToken취소 토큰입니다.
반환값
워드 결과입니다.

MitsubishiMcPlcClient.cs 파일의 374 번째 라인에서 정의되었습니다.

378 {
379 var frameResult = _frameBuilder.BuildBatchReadFrame(
380 _options,
381 address,
382 count,
383 isBitAccess: false);
384
385 if (!frameResult.IsSuccess || frameResult.Value is null)
386 {
387 return PlcResult<short[]>.Failure(
388 frameResult.Message ?? "Failed to build Mitsubishi MC word read frame.",
389 frameResult.ErrorCode);
390 }
391
392 var responseResult = await _transport.SendAndReceiveAsync(
393 frameResult.Value,
394 _options.ReceiveTimeoutMs,
395 _options.RetryCount,
396 cancellationToken).ConfigureAwait(false);
397
398 if (!responseResult.IsSuccess || responseResult.Value is null)
399 {
400 return PlcResult<short[]>.Failure(
401 responseResult.Message ?? "Failed to receive Mitsubishi MC word read response.",
402 responseResult.ErrorCode);
403 }
404
405 return _responseParser.ParseReadWords(responseResult.Value, count);
406 }

다음을 참조함 : _frameBuilder, _options, _responseParser, _transport.

◆ WriteBitsCoreAsync()

override async Task< PlcResult > Dreamine.PLC.Mitsubishi.MC.Clients.MitsubishiMcPlcClient.WriteBitsCoreAsync ( PlcAddress address,
IReadOnlyList< bool > values,
CancellationToken cancellationToken )
inlineprotected

비트 쓰기 프레임을 송수신하고 종료 코드를 확인합니다.

매개변수
address시작 주소입니다.
values비트 값입니다.
cancellationToken취소 토큰입니다.
반환값
쓰기 결과입니다.

MitsubishiMcPlcClient.cs 파일의 444 번째 라인에서 정의되었습니다.

448 {
449 var frameResult = _frameBuilder.BuildBatchWriteBitsFrame(
450 _options,
451 address,
452 values);
453
454 if (!frameResult.IsSuccess || frameResult.Value is null)
455 {
456 return PlcResult.Failure(
457 frameResult.Message ?? "Failed to build Mitsubishi MC bit write frame.",
458 frameResult.ErrorCode);
459 }
460
461 var responseResult = await _transport.SendAndReceiveAsync(
462 frameResult.Value,
463 _options.ReceiveTimeoutMs,
464 _options.RetryCount,
465 cancellationToken).ConfigureAwait(false);
466
467 if (!responseResult.IsSuccess || responseResult.Value is null)
468 {
469 return PlcResult.Failure(
470 responseResult.Message ?? "Failed to receive Mitsubishi MC bit write response.",
471 responseResult.ErrorCode);
472 }
473
474 var parseResult = _responseParser.Parse(responseResult.Value);
475 if (!parseResult.IsSuccess)
476 {
477 return PlcResult.Failure(
478 parseResult.Message ?? "Failed to parse Mitsubishi MC bit write response.",
479 parseResult.ErrorCode);
480 }
481
482 return PlcResult.Success();
483 }

다음을 참조함 : _frameBuilder, _options, _responseParser, _transport.

◆ WriteWordsCoreAsync()

override async Task< PlcResult > Dreamine.PLC.Mitsubishi.MC.Clients.MitsubishiMcPlcClient.WriteWordsCoreAsync ( PlcAddress address,
IReadOnlyList< short > values,
CancellationToken cancellationToken )
inlineprotected

워드 쓰기 프레임을 송수신하고 종료 코드를 확인합니다.

매개변수
address시작 주소입니다.
values워드 값입니다.
cancellationToken취소 토큰입니다.
반환값
쓰기 결과입니다.

MitsubishiMcPlcClient.cs 파일의 521 번째 라인에서 정의되었습니다.

525 {
526 var frameResult = _frameBuilder.BuildBatchWriteWordsFrame(
527 _options,
528 address,
529 values);
530
531 if (!frameResult.IsSuccess || frameResult.Value is null)
532 {
533 return PlcResult.Failure(
534 frameResult.Message ?? "Failed to build Mitsubishi MC word write frame.",
535 frameResult.ErrorCode);
536 }
537
538 var responseResult = await _transport.SendAndReceiveAsync(
539 frameResult.Value,
540 _options.ReceiveTimeoutMs,
541 _options.RetryCount,
542 cancellationToken).ConfigureAwait(false);
543
544 if (!responseResult.IsSuccess || responseResult.Value is null)
545 {
546 return PlcResult.Failure(
547 responseResult.Message ?? "Failed to receive Mitsubishi MC word write response.",
548 responseResult.ErrorCode);
549 }
550
551 var parseResult = _responseParser.Parse(responseResult.Value);
552 if (!parseResult.IsSuccess)
553 {
554 return PlcResult.Failure(
555 parseResult.Message ?? "Failed to parse Mitsubishi MC word write response.",
556 parseResult.ErrorCode);
557 }
558
559 return PlcResult.Success();
560 }

다음을 참조함 : _frameBuilder, _options, _responseParser, _transport.

멤버 데이터 문서화

◆ _frameBuilder

readonly MitsubishiMcBinary3EFrameBuilder Dreamine.PLC.Mitsubishi.MC.Clients.MitsubishiMcPlcClient._frameBuilder
private

frame Builder 값을 보관합니다.

MitsubishiMcPlcClient.cs 파일의 46 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : MitsubishiMcPlcClient(), ReadBitsCoreAsync(), ReadWordsCoreAsync(), WriteBitsCoreAsync(), WriteWordsCoreAsync().

◆ _options

readonly MitsubishiMcConnectionOptions Dreamine.PLC.Mitsubishi.MC.Clients.MitsubishiMcPlcClient._options
private

options 값을 보관합니다.

MitsubishiMcPlcClient.cs 파일의 28 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : ConnectCoreAsync(), MitsubishiMcPlcClient(), ReadBitsCoreAsync(), ReadWordsCoreAsync(), WriteBitsCoreAsync(), WriteWordsCoreAsync().

◆ _responseParser

readonly MitsubishiMcBinary3EResponseParser Dreamine.PLC.Mitsubishi.MC.Clients.MitsubishiMcPlcClient._responseParser
private

response Parser 값을 보관합니다.

MitsubishiMcPlcClient.cs 파일의 55 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : MitsubishiMcPlcClient(), ReadBitsCoreAsync(), ReadWordsCoreAsync(), WriteBitsCoreAsync(), WriteWordsCoreAsync().

◆ _transport

readonly IMitsubishiMcTransport Dreamine.PLC.Mitsubishi.MC.Clients.MitsubishiMcPlcClient._transport
private

transport 값을 보관합니다.

MitsubishiMcPlcClient.cs 파일의 37 번째 라인에서 정의되었습니다.

다음에 의해서 참조됨 : ConnectCoreAsync(), DisconnectCoreAsync(), DisposeAsync(), MitsubishiMcPlcClient(), ReadBitsCoreAsync(), ReadWordsCoreAsync(), WriteBitsCoreAsync(), WriteWordsCoreAsync().

속성 문서화

◆ Options

MitsubishiMcConnectionOptions Dreamine.PLC.Mitsubishi.MC.Clients.MitsubishiMcPlcClient.Options
get

Mitsubishi MC 연결 옵션을 가져옵니다.

MitsubishiMcPlcClient.cs 파일의 160 번째 라인에서 정의되었습니다.


이 클래스에 대한 문서화 페이지는 다음의 파일로부터 생성되었습니다.: