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

더 자세히 ...

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

Public 멤버 함수

 MitsubishiMxComponentPlcClient (MitsubishiMxComponentOptions options)
 MitsubishiMxComponentPlcClient (MitsubishiMxComponentOptions options, IComObjectFactory factory)
override async ValueTask DisposeAsync ()

Protected 멤버 함수

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

속성

MitsubishiMxComponentOptions Options [get]

Private 멤버 함수

Task< PlcResult< short[]> > ReadWordsOneByOne (object component, PlcAddress address, int count, CancellationToken cancellationToken)
Task< PlcResult< bool[]> > ReadBitsOneByOne (object component, PlcAddress address, int count, CancellationToken cancellationToken)
object RequireComponent ()
void ReleaseComponent ()

정적 Private 멤버 함수

static PlcResult ToResult (int resultCode, string message)
static bool TryExtractShortArray (object? source, int count, out short[] values)
static bool TryExtractBoolArray (object? source, int count, out bool[] values)

Private 속성

readonly MitsubishiMxComponentOptions _options
readonly IComObjectFactory _factory
object? _component

상세한 설명

Mitsubishi MX Component COM 인터페이스를 사용하는 PLC 클라이언트를 제공합니다.

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

생성자 & 소멸자 문서화

◆ MitsubishiMxComponentPlcClient() [1/2]

Dreamine.PLC.Mitsubishi.MxComponent.Clients.MitsubishiMxComponentPlcClient.MitsubishiMxComponentPlcClient ( MitsubishiMxComponentOptions options)
inline

기본 COM 개체 팩터리를 사용해 MitsubishiMxComponentPlcClient 클래스의 새 인스턴스를 초기화합니다.

매개변수
optionsMX Component 연결 및 메서드 설정입니다.
예외
ArgumentNullExceptionoptionsnull일 때 발생합니다.

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

75 : this(options, new DefaultComObjectFactory())
76 {
77 }

◆ MitsubishiMxComponentPlcClient() [2/2]

Dreamine.PLC.Mitsubishi.MxComponent.Clients.MitsubishiMxComponentPlcClient.MitsubishiMxComponentPlcClient ( MitsubishiMxComponentOptions options,
IComObjectFactory factory )
inline

지정한 COM 개체 팩터리를 사용해 MitsubishiMxComponentPlcClient 클래스의 새 인스턴스를 초기화합니다.

매개변수
optionsMX Component 연결 및 메서드 설정입니다.
factory후기 바인딩 COM 개체를 생성할 팩터리입니다.
예외
ArgumentNullExceptionoptions 또는 factorynull일 때 발생합니다.

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

112 {
113 _options = options ?? throw new ArgumentNullException(nameof(options));
114 _factory = factory ?? throw new ArgumentNullException(nameof(factory));
115 }

다음을 참조함 : _factory, _options.

멤버 함수 문서화

◆ ConnectCoreAsync()

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

COM 개체를 생성하고 논리 스테이션을 설정한 뒤 MX Component 연결을 엽니다.

매개변수
cancellationToken연결 작업을 취소하는 토큰입니다.
반환값
MX Component 반환 코드를 포함하는 연결 결과 작업입니다.
예외
OperationCanceledException취소 토큰이 취소된 경우 발생합니다.
PlatformNotSupportedException기본 팩터리를 Windows가 아닌 플랫폼에서 사용할 때 발생합니다.
InvalidOperationExceptionCOM 개체 생성이나 속성·메서드 호출이 실패할 때 발생할 수 있습니다.

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

176 {
177 cancellationToken.ThrowIfCancellationRequested();
178
179 _component = _factory.Create(_options.ProgId);
180 ComInvoker.SetProperty(_component, "ActLogicalStationNumber", _options.LogicalStationNumber);
181
182 var resultCode = ComInvoker.ToReturnCode(ComInvoker.Invoke(_component, _options.OpenMethodName));
183 return Task.FromResult(ToResult(resultCode, "MX Component open failed."));
184 }

다음을 참조함 : _component, _factory, _options, ToResult().

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

◆ DisconnectCoreAsync()

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

MX Component 연결을 닫고 보유한 COM 개체를 해제합니다.

매개변수
cancellationToken연결 해제 작업을 취소하는 토큰입니다.
반환값
MX Component 반환 코드를 포함하는 연결 해제 결과 작업입니다.
예외
OperationCanceledException취소 토큰이 취소된 경우 발생합니다.
InvalidOperationExceptionCOM 닫기 메서드 호출이 실패할 때 발생할 수 있습니다.

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

227 {
228 cancellationToken.ThrowIfCancellationRequested();
229
230 if (_component is null)
231 {
232 return Task.FromResult(PlcResult.Success());
233 }
234
235 var resultCode = ComInvoker.ToReturnCode(ComInvoker.Invoke(_component, _options.CloseMethodName));
236 ReleaseComponent();
237 return Task.FromResult(ToResult(resultCode, "MX Component close failed."));
238 }

다음을 참조함 : _component, _options, ReleaseComponent(), ToResult().

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

◆ DisposeAsync()

override async ValueTask Dreamine.PLC.Mitsubishi.MxComponent.Clients.MitsubishiMxComponentPlcClient.DisposeAsync ( )
inline

기본 PLC 클라이언트 자원을 비동기로 정리하고 MX Component COM 개체를 해제합니다.

반환값
비동기 정리 작업을 나타내는 값 작업입니다.

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

651 {
652 await base.DisposeAsync().ConfigureAwait(false);
653 ReleaseComponent();
654 }

다음을 참조함 : ReleaseComponent().

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

◆ ReadBitsCoreAsync()

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

연속된 PLC 비트 값을 읽으며 블록 호출이 호환되지 않으면 단건 호출로 전환합니다.

매개변수
address읽기를 시작할 PLC 주소입니다.
count읽을 비트 수입니다.
cancellationToken읽기 작업을 취소하는 토큰입니다.
반환값
읽은 비트 배열 또는 PLC 오류를 포함하는 결과 작업입니다.
예외
InvalidOperationException클라이언트가 연결되지 않았거나 폴백 COM 호출이 실패할 때 발생합니다.
OperationCanceledException취소 토큰이 취소된 경우 발생합니다.
NotSupportedExceptionPLC 장치 형식을 지원하지 않을 때 발생합니다.

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

308 {
309 var component = RequireComponent();
310 var device = MitsubishiMxDeviceNameFormatter.Format(address);
311 var buffer = new short[count];
312 var args = new object?[] { device, count, buffer };
313
314 try
315 {
316 cancellationToken.ThrowIfCancellationRequested();
317
318 var resultCode = ComInvoker.ToReturnCode(ComInvoker.InvokeWithByRef(component, _options.ReadDeviceBlock2MethodName, args, 2));
319 if (resultCode == 0 && TryExtractBoolArray(args[2], count, out var values))
320 {
321 return Task.FromResult(PlcResult<bool[]>.Success(values));
322 }
323 }
324 catch (MissingMethodException)
325 {
326 // Fall back to GetDevice below for MX Component variants without block calls.
327 }
328 catch (COMException)
329 {
330 // COM late binding can reject array arguments. Fall back to GetDevice.
331 }
332 catch (InvalidOperationException ex) when (ex.InnerException is COMException)
333 {
334 // ComInvoker wraps COM target invocation failures. Fall back to GetDevice.
335 }
336
337 return ReadBitsOneByOne(component, address, count, cancellationToken);
338 }

다음을 참조함 : _options, Dreamine.PLC.Mitsubishi.MxComponent.Devices.MitsubishiMxDeviceNameFormatter.Format(), ReadBitsOneByOne(), RequireComponent(), TryExtractBoolArray().

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

◆ ReadBitsOneByOne()

Task< PlcResult< bool[]> > Dreamine.PLC.Mitsubishi.MxComponent.Clients.MitsubishiMxComponentPlcClient.ReadBitsOneByOne ( object component,
PlcAddress address,
int count,
CancellationToken cancellationToken )
inlineprivate

지정 범위의 PLC 비트를 단건 COM 호출로 읽습니다.

매개변수
component연결된 MX Component COM 개체입니다.
address시작 PLC 주소입니다.
count읽을 비트 수입니다.
cancellationToken반복 읽기를 취소하는 토큰입니다.
반환값
비트 배열 또는 첫 번째 PLC 오류를 포함하는 결과 작업입니다.
예외
OperationCanceledException취소 토큰이 취소된 경우 발생합니다.
FormatExceptionCOM 값이 정수로 변환될 수 없을 때 발생할 수 있습니다.

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

819 {
820 var values = new bool[count];
821
822 for (var index = 0; index < count; index++)
823 {
824 cancellationToken.ThrowIfCancellationRequested();
825
826 var args = new object?[]
827 {
828 MitsubishiMxDeviceNameFormatter.FormatOffset(address, index),
829 0
830 };
831
832 var resultCode = ComInvoker.ToReturnCode(ComInvoker.InvokeWithByRef(component, _options.ReadDeviceMethodName, args, 1));
833 if (resultCode != 0)
834 {
835 return Task.FromResult(PlcResult<bool[]>.Failure($"MX Component bit read failed. code={resultCode}", resultCode));
836 }
837
838 values[index] = Convert.ToInt32(args[1], CultureInfo.InvariantCulture) != 0;
839 }
840
841 return Task.FromResult(PlcResult<bool[]>.Success(values));
842 }

다음을 참조함 : _options, Dreamine.PLC.Mitsubishi.MxComponent.Devices.MitsubishiMxDeviceNameFormatter.FormatOffset().

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

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

◆ ReadWordsCoreAsync()

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

연속된 PLC 워드 값을 읽으며 블록 호출이 호환되지 않으면 단건 호출로 전환합니다.

매개변수
address읽기를 시작할 PLC 주소입니다.
count읽을 워드 수입니다.
cancellationToken읽기 작업을 취소하는 토큰입니다.
반환값
읽은 워드 배열 또는 PLC 오류를 포함하는 결과 작업입니다.
예외
InvalidOperationException클라이언트가 연결되지 않았거나 폴백 COM 호출이 실패할 때 발생합니다.
OperationCanceledException취소 토큰이 취소된 경우 발생합니다.
OverflowExceptionCOM 값이 short 범위를 벗어날 때 발생할 수 있습니다.

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

408 {
409 var component = RequireComponent();
410 var device = MitsubishiMxDeviceNameFormatter.Format(address);
411 var buffer = new short[count];
412 var args = new object?[] { device, count, buffer };
413
414 try
415 {
416 cancellationToken.ThrowIfCancellationRequested();
417
418 var resultCode = ComInvoker.ToReturnCode(ComInvoker.InvokeWithByRef(component, _options.ReadDeviceBlock2MethodName, args, 2));
419 if (resultCode == 0 && TryExtractShortArray(args[2], count, out var values))
420 {
421 return Task.FromResult(PlcResult<short[]>.Success(values));
422 }
423 }
424 catch (MissingMethodException)
425 {
426 // Fall back to GetDevice below for MX Component variants that do not expose block calls through late binding.
427 }
428 catch (COMException)
429 {
430 // COM late binding can reject array arguments for ReadDeviceBlock2. Fall back to GetDevice.
431 }
432 catch (InvalidOperationException ex) when (ex.InnerException is COMException)
433 {
434 // ComInvoker wraps COM target invocation failures. Fall back to GetDevice for array type mismatches.
435 }
436
437 return ReadWordsOneByOne(component, address, count, cancellationToken);
438 }

다음을 참조함 : _options, Dreamine.PLC.Mitsubishi.MxComponent.Devices.MitsubishiMxDeviceNameFormatter.Format(), ReadWordsOneByOne(), RequireComponent(), TryExtractShortArray().

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

◆ ReadWordsOneByOne()

Task< PlcResult< short[]> > Dreamine.PLC.Mitsubishi.MxComponent.Clients.MitsubishiMxComponentPlcClient.ReadWordsOneByOne ( object component,
PlcAddress address,
int count,
CancellationToken cancellationToken )
inlineprivate

지정 범위의 PLC 워드를 단건 COM 호출로 읽습니다.

매개변수
component연결된 MX Component COM 개체입니다.
address시작 PLC 주소입니다.
count읽을 워드 수입니다.
cancellationToken반복 읽기를 취소하는 토큰입니다.
반환값
워드 배열 또는 첫 번째 PLC 오류를 포함하는 결과 작업입니다.
예외
OperationCanceledException취소 토큰이 취소된 경우 발생합니다.
OverflowExceptionCOM 값이 short 범위를 벗어날 때 발생할 수 있습니다.

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

725 {
726 var values = new short[count];
727
728 for (var index = 0; index < count; index++)
729 {
730 cancellationToken.ThrowIfCancellationRequested();
731
732 var args = new object?[]
733 {
734 MitsubishiMxDeviceNameFormatter.FormatOffset(address, index),
735 0
736 };
737
738 var resultCode = ComInvoker.ToReturnCode(ComInvoker.InvokeWithByRef(component, _options.ReadDeviceMethodName, args, 1));
739 if (resultCode != 0)
740 {
741 return Task.FromResult(PlcResult<short[]>.Failure($"MX Component word read failed. code={resultCode}", resultCode));
742 }
743
744 values[index] = Convert.ToInt16(args[1], CultureInfo.InvariantCulture);
745 }
746
747 return Task.FromResult(PlcResult<short[]>.Success(values));
748 }

다음을 참조함 : _options, Dreamine.PLC.Mitsubishi.MxComponent.Devices.MitsubishiMxDeviceNameFormatter.FormatOffset().

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

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

◆ ReleaseComponent()

void Dreamine.PLC.Mitsubishi.MxComponent.Clients.MitsubishiMxComponentPlcClient.ReleaseComponent ( )
inlineprivate

보유한 MX Component COM 개체의 참조를 최종 해제하고 연결 상태를 초기화합니다.

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

882 {
883 if (_component is null)
884 {
885 return;
886 }
887
888 if (OperatingSystem.IsWindows() && Marshal.IsComObject(_component))
889 {
890 Marshal.FinalReleaseComObject(_component);
891 }
892
893 _component = null;
894 }

다음을 참조함 : _component.

다음에 의해서 참조됨 : DisconnectCoreAsync(), DisposeAsync().

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

◆ RequireComponent()

object Dreamine.PLC.Mitsubishi.MxComponent.Clients.MitsubishiMxComponentPlcClient.RequireComponent ( )
inlineprivate

현재 연결된 MX Component COM 개체를 반환합니다.

반환값
연결된 COM 개체입니다.
예외
InvalidOperationException클라이언트가 연결되지 않았을 때 발생합니다.

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

869 {
870 return _component ?? throw new InvalidOperationException("MX Component is not connected.");
871 }

다음을 참조함 : _component.

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

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

◆ ToResult()

PlcResult Dreamine.PLC.Mitsubishi.MxComponent.Clients.MitsubishiMxComponentPlcClient.ToResult ( int resultCode,
string message )
inlinestaticprivate

MX Component 반환 코드를 표준 PLC 결과로 변환합니다.

매개변수
resultCode0이 성공인 MX Component 반환 코드입니다.
message실패 결과에 포함할 작업 메시지입니다.
반환값
성공 또는 코드와 메시지를 포함한 실패 결과입니다.

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

929 {
930 return resultCode == 0
931 ? PlcResult.Success()
932 : PlcResult.Failure($"{message} code={resultCode}", resultCode);
933 }

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

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

◆ TryExtractBoolArray()

bool Dreamine.PLC.Mitsubishi.MxComponent.Clients.MitsubishiMxComponentPlcClient.TryExtractBoolArray ( object? source,
int count,
out bool[] values )
inlinestaticprivate

COM 배열 값을 지정한 길이의 부울 배열로 추출합니다.

매개변수
sourceCOM 호출이 반환한 배열 값입니다.
count추출할 요소 수입니다.
values변환 성공 시 추출된 비트 배열을 받습니다.
반환값
지원되는 형식과 충분한 길이를 가진 배열이면 true, 아니면 false입니다.
예외
FormatException배열 요소를 정수로 변환할 수 없을 때 발생할 수 있습니다.
OverflowException배열 요소가 int 범위를 벗어날 때 발생할 수 있습니다.

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

1068 {
1069 values = new bool[count];
1070
1071 switch (source)
1072 {
1073 case bool[] booleans when booleans.Length >= count:
1074 Array.Copy(booleans, values, count);
1075 return true;
1076 case short[] shorts when shorts.Length >= count:
1077 for (var index = 0; index < count; index++)
1078 {
1079 values[index] = shorts[index] != 0;
1080 }
1081
1082 return true;
1083 case int[] integers when integers.Length >= count:
1084 for (var index = 0; index < count; index++)
1085 {
1086 values[index] = integers[index] != 0;
1087 }
1088
1089 return true;
1090 case Array array when array.Length >= count:
1091 for (var index = 0; index < count; index++)
1092 {
1093 values[index] = Convert.ToInt32(array.GetValue(index), CultureInfo.InvariantCulture) != 0;
1094 }
1095
1096 return true;
1097 default:
1098 return false;
1099 }
1100 }

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

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

◆ TryExtractShortArray()

bool Dreamine.PLC.Mitsubishi.MxComponent.Clients.MitsubishiMxComponentPlcClient.TryExtractShortArray ( object? source,
int count,
out short[] values )
inlinestaticprivate

COM 배열 값을 지정한 길이의 short 배열로 추출합니다.

매개변수
sourceCOM 호출이 반환한 배열 값입니다.
count추출할 요소 수입니다.
values변환 성공 시 추출된 워드 배열을 받습니다.
반환값
지원되는 형식과 충분한 길이를 가진 배열이면 true, 아니면 false입니다.
예외
OverflowException배열 요소가 short 범위를 벗어날 때 발생할 수 있습니다.

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

984 {
985 values = new short[count];
986
987 switch (source)
988 {
989 case short[] shorts when shorts.Length >= count:
990 Array.Copy(shorts, values, count);
991 return true;
992 case int[] integers when integers.Length >= count:
993 for (var index = 0; index < count; index++)
994 {
995 values[index] = Convert.ToInt16(integers[index], CultureInfo.InvariantCulture);
996 }
997
998 return true;
999 case Array array when array.Length >= count:
1000 for (var index = 0; index < count; index++)
1001 {
1002 values[index] = Convert.ToInt16(array.GetValue(index), CultureInfo.InvariantCulture);
1003 }
1004
1005 return true;
1006 default:
1007 return false;
1008 }
1009 }

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

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

◆ WriteBitsCoreAsync()

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

연속된 PLC 비트 값을 단건 MX Component 호출로 씁니다.

매개변수
address쓰기를 시작할 PLC 주소입니다.
values쓸 비트 값입니다.
cancellationToken쓰기 작업을 취소하는 토큰입니다.
반환값
첫 번째 실패 코드 또는 성공을 포함하는 쓰기 결과 작업입니다.
예외
InvalidOperationException클라이언트가 연결되지 않았거나 COM 호출이 실패할 때 발생합니다.
OperationCanceledException취소 토큰이 취소된 경우 발생합니다.

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

500 {
501 var component = RequireComponent();
502
503 for (var index = 0; index < values.Count; index++)
504 {
505 cancellationToken.ThrowIfCancellationRequested();
506
507 var resultCode = ComInvoker.ToReturnCode(ComInvoker.Invoke(
508 component,
509 _options.WriteDeviceMethodName,
510 MitsubishiMxDeviceNameFormatter.FormatOffset(address, index),
511 values[index] ? 1 : 0));
512
513 if (resultCode != 0)
514 {
515 return Task.FromResult(ToResult(resultCode, "MX Component bit write failed."));
516 }
517 }
518
519 return Task.FromResult(PlcResult.Success());
520 }

다음을 참조함 : _options, Dreamine.PLC.Mitsubishi.MxComponent.Devices.MitsubishiMxDeviceNameFormatter.FormatOffset(), RequireComponent(), ToResult().

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

◆ WriteWordsCoreAsync()

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

연속된 PLC 워드 값을 쓰며 블록 호출이 호환되지 않으면 단건 호출로 전환합니다.

매개변수
address쓰기를 시작할 PLC 주소입니다.
values쓸 워드 값입니다.
cancellationToken쓰기 작업을 취소하는 토큰입니다.
반환값
첫 번째 실패 코드 또는 성공을 포함하는 쓰기 결과 작업입니다.
예외
InvalidOperationException클라이언트가 연결되지 않았거나 폴백 COM 호출이 실패할 때 발생합니다.
OperationCanceledException취소 토큰이 취소된 경우 발생합니다.

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

582 {
583 var component = RequireComponent();
584 var device = MitsubishiMxDeviceNameFormatter.Format(address);
585 var data = values.ToArray();
586
587 try
588 {
589 cancellationToken.ThrowIfCancellationRequested();
590
591 var resultCode = ComInvoker.ToReturnCode(ComInvoker.InvokeWithByRef(
592 component,
593 _options.WriteDeviceBlock2MethodName,
594 [device, values.Count, data],
595 2));
596
597 if (resultCode == 0)
598 {
599 return Task.FromResult(PlcResult.Success());
600 }
601 }
602 catch (MissingMethodException)
603 {
604 // Fall back to SetDevice below.
605 }
606 catch (COMException)
607 {
608 // COM late binding can reject array arguments for WriteDeviceBlock2. Fall back to SetDevice.
609 }
610 catch (InvalidOperationException ex) when (ex.InnerException is COMException)
611 {
612 // ComInvoker wraps COM target invocation failures. Fall back to SetDevice for array type mismatches.
613 }
614
615 for (var index = 0; index < values.Count; index++)
616 {
617 cancellationToken.ThrowIfCancellationRequested();
618
619 var resultCode = ComInvoker.ToReturnCode(ComInvoker.Invoke(
620 component,
621 _options.WriteDeviceMethodName,
622 MitsubishiMxDeviceNameFormatter.FormatOffset(address, index),
623 values[index]));
624
625 if (resultCode != 0)
626 {
627 return Task.FromResult(ToResult(resultCode, "MX Component word write failed."));
628 }
629 }
630
631 return Task.FromResult(PlcResult.Success());
632 }

다음을 참조함 : _options, Dreamine.PLC.Mitsubishi.MxComponent.Devices.MitsubishiMxDeviceNameFormatter.Format(), Dreamine.PLC.Mitsubishi.MxComponent.Devices.MitsubishiMxDeviceNameFormatter.FormatOffset(), RequireComponent(), ToResult().

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

멤버 데이터 문서화

◆ _component

object? Dreamine.PLC.Mitsubishi.MxComponent.Clients.MitsubishiMxComponentPlcClient._component
private

component 값을 보관합니다.

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

다음에 의해서 참조됨 : ConnectCoreAsync(), DisconnectCoreAsync(), ReleaseComponent(), RequireComponent().

◆ _factory

readonly IComObjectFactory Dreamine.PLC.Mitsubishi.MxComponent.Clients.MitsubishiMxComponentPlcClient._factory
private

factory 값을 보관합니다.

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

다음에 의해서 참조됨 : ConnectCoreAsync(), MitsubishiMxComponentPlcClient().

◆ _options

readonly MitsubishiMxComponentOptions Dreamine.PLC.Mitsubishi.MxComponent.Clients.MitsubishiMxComponentPlcClient._options
private

속성 문서화

◆ Options

MitsubishiMxComponentOptions Dreamine.PLC.Mitsubishi.MxComponent.Clients.MitsubishiMxComponentPlcClient.Options
get

이 클라이언트가 사용하는 MX Component 옵션을 가져옵니다.

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


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