iconDreamine
← 목록

Dreamine.PLC.Mitsubishi.MxComponent

stablev1.0.1

미쓰비시 MX Component COM 기반 드라이버.

#communication#dreamine#industrial-automation#mitsubishi#mxcomponent#plc
TFM net8.0Package Dreamine.PLC.Mitsubishi.MxComponent참조 Dreamine.PLC.Abstractions, Dreamine.PLC.Core

Dreamine.PLC.Mitsubishi.MxComponent

English documentation

Dreamine PLC 통신을 위한 Mitsubishi MX Component 어댑터 경계 패키지입니다.

중요 벤더 런타임 안내

이 패키지는 Mitsubishi MX Component DLL, 설치 파일, 샘플, 라이선스가 필요한 Runtime 파일을 재배포하면 안 됩니다.

사용자는 Mitsubishi Electric의 라이선스 조건에 따라 MX Component를 별도로 설치하고 정식 라이선스를 보유해야 합니다.

이 패키지는 사용자 PC에 설치된 벤더 Runtime과 연동하기 위한 어댑터 코드만 포함할 수 있습니다.

현재 상태

이 패키지는 벤더 Runtime을 직접 참조하지 않는 late-bound COM 어댑터를 제공합니다.

주요 클래스:

  • MitsubishiMxComponentPlcClient
  • MitsubishiMxComponentOptions
  • MitsubishiMxDeviceNameFormatter

기본 ProgID는 현재 프로세스 비트 수에 따라 달라집니다.

  • x86: ActUtlType.ActUtlType
  • x64: ActUtlType64.ActUtlWrap

어댑터는 MX Component에서 설정한 LogicalStationNumberOpen/Close를 호출합니다. Word 블록 접근은 먼저 ReadDeviceBlock2/WriteDeviceBlock2를 시도하고, COM late-binding에서 배열 인자가 거부되면 GetDevice/SetDevice를 반복 호출하는 방식으로 fallback합니다.

샘플:

  • SampleSmart의 PLC Monitor 화면에서 MxComponent 모드를 선택합니다.
  • MX ProgID, MX LS 값을 확인한 뒤 Use Client -> Connect 순서로 실행합니다.
  • MX Component 정석 경로는 SampleSmart를 x86으로 실행하고 ActUtlType.ActUtlType를 사용합니다.
  • Mitsubishi DotUtlType64 wrapper는 구형 .NET Framework WCF 타입을 요구할 수 있습니다. net8.0-windows x64에서 실패하면 x86 경로를 사용하거나 별도 .NET Framework 브리지 프로세스로 중계합니다.

권장 운영 경로:

  • 직접 MC TCP/UDP 통신은 Dreamine.PLC.Mitsubishi.MC를 사용합니다.
  • 프로젝트에서 명시적으로 MX Component 연동이 필요한 경우에만 이 패키지를 사용합니다.

라이선스

Dreamine 어댑터 코드: MIT License.

Mitsubishi MX Component: 이 패키지에 포함되지 않으며, 이 패키지의 라이선스 대상도 아닙니다.

구조 다이어그램

classDiagram
    class MxComponentClient {
        -ActUtlType _actUtl
        +StationNumber int
        +IsConnected bool
        +ConnectAsync() Task
        +DisconnectAsync() Task
        +ReadBitAsync(string) Task~bool~
        +ReadWordAsync(string) Task~short~
        +ReadDWordAsync(string) Task~int~
        +WriteBitAsync(string, bool) Task
        +WriteWordAsync(string, short) Task
        +WriteDWordAsync(string, int) Task
        +ReadWordsAsync(string, int) Task~short[]~
    }
    class MxComponentOptions {
        +int StationNumber
        +string ActType
        +int CpuType
        +string ComDevice
        +int BaudRate
    }
    class PlcClientBase {
        <<abstract>>
    }
    PlcClientBase <|-- MxComponentClient
    MxComponentClient --> MxComponentOptions

API 문서

타입

ComInvoker

\if KO 후기 바인딩으로 MX Component COM 멤버를 호출하는 도우미를 제공합니다. \endif \if EN Provides helpers for invoking late-bound MX Component COM members. \endif

DefaultComObjectFactory

\if KO 설치된 COM 개체를 ProgID로 생성합니다. \endif \if EN Creates installed COM objects through their ProgID. \endif

IComObjectFactory

\if KO 후기 바인딩 COM 개체를 생성하는 팩터리 계약을 정의합니다. \endif \if EN Defines a factory contract for creating late-bound COM objects. \endif

MitsubishiMxComponentOptions

\if KO Mitsubishi MX Component 연결 옵션을 제공합니다. \endif \if EN Provides Mitsubishi MX Component connection options. \endif

MitsubishiMxComponentPlcClient

\if KO Mitsubishi MX Component COM 인터페이스를 사용하는 PLC 클라이언트를 제공합니다. \endif \if EN Provides a PLC client that uses the Mitsubishi MX Component COM interface. \endif

MitsubishiMxDeviceNameFormatter

\if KO Dreamine PLC 주소를 MX Component 장치 문자열로 변환합니다. \endif \if EN Formats Dreamine PLC addresses as MX Component device strings. \endif

ComInvoker

CreateDetailedException Method

\if KO 중첩된 COM 호출 예외 메시지를 보존하는 상세 예외를 만듭니다. \endif \if EN Creates a detailed exception that preserves nested COM invocation messages. \endif

operation— \if KO 실패한 작업을 설명하는 문자열입니다. \endif \if EN A description of the failed operation. \endif
exception— \if KO COM 호출에서 발생한 래퍼 예외입니다. \endif \if EN The wrapper exception raised by the COM invocation. \endif

반환: \if KO 원본 내부 예외와 상세 메시지를 포함한 예외입니다. \endif \if EN An exception containing the original inner exception and a detailed message. \endif

Invoke Method

\if KO 후기 바인딩을 사용해 COM 대상의 메서드를 호출합니다. \endif \if EN Invokes a method on a COM target by using late binding. \endif

target— \if KO 메서드를 소유한 COM 대상입니다. \endif \if EN The COM target that owns the method. \endif
name— \if KO 호출할 메서드 이름입니다. \endif \if EN The name of the method to invoke. \endif
args— \if KO 메서드에 전달할 인수입니다. \endif \if EN The arguments to pass to the method. \endif

반환: \if KO COM 메서드가 반환한 값이며 반환값이 없으면 입니다. \endif \if EN The value returned by the COM method, or when it returns no value. \endif

InvokeWithByRef Method

\if KO 참조 전달 인수를 지정해 COM 대상의 메서드를 호출합니다. \endif \if EN Invokes a COM method while marking selected arguments as passed by reference. \endif

target— \if KO 메서드를 소유한 COM 대상입니다. \endif \if EN The COM target that owns the method. \endif
name— \if KO 호출할 메서드 이름입니다. \endif \if EN The name of the method to invoke. \endif
args— \if KO 호출 인수 배열이며 참조 인수의 결과가 이 배열에 반영됩니다. \endif \if EN The invocation argument array; results for by-reference arguments are written back to this array. \endif
byRefIndexes— \if KO 참조 전달로 표시할 인수의 0부터 시작하는 인덱스입니다. \endif \if EN The zero-based indexes of arguments to mark as passed by reference. \endif

반환: \if KO COM 메서드가 반환한 값이며 반환값이 없으면 입니다. \endif \if EN The value returned by the COM method, or when it returns no value. \endif

SetProperty Method

\if KO 후기 바인딩을 사용해 COM 대상의 속성 값을 설정합니다. \endif \if EN Sets a property value on a COM target by using late binding. \endif

target— \if KO 속성을 소유한 COM 대상입니다. \endif \if EN The COM target that owns the property. \endif
name— \if KO 설정할 속성 이름입니다. \endif \if EN The name of the property to set. \endif
value— \if KO 설정할 값입니다. \endif \if EN The value to assign. \endif
ToReturnCode Method

\if KO COM 호출 결과를 정수 반환 코드로 변환합니다. \endif \if EN Converts a COM invocation result to an integer return code. \endif

value— \if KO 변환할 COM 반환값이며 은 성공 코드 0으로 처리됩니다. \endif \if EN The COM return value to convert; is treated as success code zero. \endif

반환: \if KO 변환된 반환 코드입니다. \endif \if EN The converted return code. \endif

DefaultComObjectFactory

Create Method

\if KO 지정한 ProgID에서 MX Component COM 개체를 생성합니다. \endif \if EN Creates an MX Component COM object from the specified ProgID. \endif

progId— \if KO 생성할 COM 클래스의 ProgID입니다. 64비트 프로세스에서는 32비트 기본 ProgID가 64비트 래퍼로 치환됩니다. \endif \if EN The ProgID of the COM class to create. In a 64-bit process, the 32-bit default ProgID is mapped to the 64-bit wrapper. \endif

반환: \if KO 생성된 후기 바인딩 COM 개체입니다. \endif \if EN The created late-bound COM object. \endif

CreateDotUtlType64Wrapper Method

\if KO 설치된 DotUtlType64 래퍼 어셈블리에서 64비트 MX Component 개체를 생성합니다. \endif \if EN Creates a 64-bit MX Component object from the installed DotUtlType64 wrapper assembly. \endif

반환: \if KO 생성된 DotUtlType64 래퍼 개체입니다. \endif \if EN The created DotUtlType64 wrapper object. \endif

CreateFriendlyException Method

\if KO COM 등록 또는 생성 실패를 프로세스 비트 수 안내가 포함된 예외로 변환합니다. \endif \if EN Converts a COM registration or creation failure into an exception with process-bitness guidance. \endif

progId— \if KO 생성에 실패한 COM ProgID입니다. \endif \if EN The COM ProgID that could not be created. \endif
innerException— \if KO 원래 발생한 예외이며 없으면 입니다. \endif \if EN The original exception, or when none is available. \endif

반환: \if KO 진단 안내와 원본 예외를 포함한 예외입니다. \endif \if EN An exception containing diagnostic guidance and the original exception. \endif

FindDotUtlType64AssemblyPath Method

\if KO 일반적인 MELSOFT 설치 경로에서 DotUtlType64 래퍼 어셈블리를 찾습니다. \endif \if EN Locates the DotUtlType64 wrapper assembly in common MELSOFT installation paths. \endif

반환: \if KO 처음 발견된 어셈블리 경로이며 파일이 없으면 입니다. \endif \if EN The first assembly path found, or when no candidate exists. \endif

IComObjectFactory

Create Method

\if KO ProgID에서 COM 개체를 생성합니다. \endif \if EN Creates a COM object from a ProgID. \endif

progId— \if KO 생성할 COM 클래스의 ProgID입니다. \endif \if EN The ProgID of the COM class to create. \endif

반환: \if KO 생성된 COM 개체입니다. \endif \if EN The created COM object. \endif

MitsubishiMxComponentOptions

CloseMethodName Property

\if KO 연결 닫기 COM 메서드 이름을 가져오거나 설정합니다. \endif \if EN Gets or sets the COM method name used to close the connection. \endif

DefaultProgId Property

\if KO 현재 프로세스 비트 수에 맞는 기본 MX Component ProgID를 가져옵니다. \endif \if EN Gets the default MX Component ProgID for the current process bitness. \endif

LogicalStationNumber Property

\if KO MX Component에 구성된 논리 스테이션 번호를 가져오거나 설정합니다. \endif \if EN Gets or sets the logical station number configured in MX Component. \endif

OpenMethodName Property

\if KO 연결 열기 COM 메서드 이름을 가져오거나 설정합니다. \endif \if EN Gets or sets the COM method name used to open the connection. \endif

ProgId Property

\if KO MX Component COM ProgID를 가져오거나 설정합니다. \endif \if EN Gets or sets the MX Component COM ProgID. \endif

ReadDeviceBlock2MethodName Property

\if KO 워드 블록 읽기 COM 메서드 이름을 가져오거나 설정합니다. \endif \if EN Gets or sets the block-word read COM method name. \endif

ReadDeviceMethodName Property

\if KO 단일 장치 읽기 COM 메서드 이름을 가져오거나 설정합니다. \endif \if EN Gets or sets the single-device read COM method name. \endif

WriteDeviceBlock2MethodName Property

\if KO 워드 블록 쓰기 COM 메서드 이름을 가져오거나 설정합니다. \endif \if EN Gets or sets the block-word write COM method name. \endif

WriteDeviceMethodName Property

\if KO 단일 장치 쓰기 COM 메서드 이름을 가져오거나 설정합니다. \endif \if EN Gets or sets the single-device write COM method name. \endif

MitsubishiMxComponentPlcClient

#ctor Method

\if KO 기본 COM 개체 팩터리를 사용해 클래스의 새 인스턴스를 초기화합니다. \endif \if EN Initializes a new instance of using the default COM object factory. \endif

options— \if KO MX Component 연결 및 메서드 설정입니다. \endif \if EN The MX Component connection and method settings. \endif
#ctor Method

\if KO 지정한 COM 개체 팩터리를 사용해 클래스의 새 인스턴스를 초기화합니다. \endif \if EN Initializes a new instance of using the specified COM object factory. \endif

options— \if KO MX Component 연결 및 메서드 설정입니다. \endif \if EN The MX Component connection and method settings. \endif
factory— \if KO 후기 바인딩 COM 개체를 생성할 팩터리입니다. \endif \if EN The factory used to create the late-bound COM object. \endif
ConnectCoreAsync Method

\if KO COM 개체를 생성하고 논리 스테이션을 설정한 뒤 MX Component 연결을 엽니다. \endif \if EN Creates the COM object, configures the logical station, and opens the MX Component connection. \endif

cancellationToken— \if KO 연결 작업을 취소하는 토큰입니다. \endif \if EN A token that cancels the connection operation. \endif

반환: \if KO MX Component 반환 코드를 포함하는 연결 결과 작업입니다. \endif \if EN A task containing the connection result and MX Component return code. \endif

DisconnectCoreAsync Method

\if KO MX Component 연결을 닫고 보유한 COM 개체를 해제합니다. \endif \if EN Closes the MX Component connection and releases the owned COM object. \endif

cancellationToken— \if KO 연결 해제 작업을 취소하는 토큰입니다. \endif \if EN A token that cancels the disconnection operation. \endif

반환: \if KO MX Component 반환 코드를 포함하는 연결 해제 결과 작업입니다. \endif \if EN A task containing the disconnection result and MX Component return code. \endif

DisposeAsync Method

\if KO 기본 PLC 클라이언트 자원을 비동기로 정리하고 MX Component COM 개체를 해제합니다. \endif \if EN Asynchronously disposes the base PLC client resources and releases the MX Component COM object. \endif

반환: \if KO 비동기 정리 작업을 나타내는 값 작업입니다. \endif \if EN A value task representing the asynchronous disposal operation. \endif

ReadBitsCoreAsync Method

\if KO 연속된 PLC 비트 값을 읽으며 블록 호출이 호환되지 않으면 단건 호출로 전환합니다. \endif \if EN Reads consecutive PLC bit values and falls back to single-device calls when the block call is incompatible. \endif

address— \if KO 읽기를 시작할 PLC 주소입니다. \endif \if EN The PLC address at which to begin reading. \endif
count— \if KO 읽을 비트 수입니다. \endif \if EN The number of bits to read. \endif
cancellationToken— \if KO 읽기 작업을 취소하는 토큰입니다. \endif \if EN A token that cancels the read operation. \endif

반환: \if KO 읽은 비트 배열 또는 PLC 오류를 포함하는 결과 작업입니다. \endif \if EN A task containing the bit array or a PLC error. \endif

ReadBitsOneByOne Method

\if KO 지정 범위의 PLC 비트를 단건 COM 호출로 읽습니다. \endif \if EN Reads the specified range of PLC bits using individual COM calls. \endif

component— \if KO 연결된 MX Component COM 개체입니다. \endif \if EN The connected MX Component COM object. \endif
address— \if KO 시작 PLC 주소입니다. \endif \if EN The starting PLC address. \endif
count— \if KO 읽을 비트 수입니다. \endif \if EN The number of bits to read. \endif
cancellationToken— \if KO 반복 읽기를 취소하는 토큰입니다. \endif \if EN A token that cancels the repeated reads. \endif

반환: \if KO 비트 배열 또는 첫 번째 PLC 오류를 포함하는 결과 작업입니다. \endif \if EN A task containing the bit array or the first PLC error. \endif

ReadWordsCoreAsync Method

\if KO 연속된 PLC 워드 값을 읽으며 블록 호출이 호환되지 않으면 단건 호출로 전환합니다. \endif \if EN Reads consecutive PLC word values and falls back to single-device calls when the block call is incompatible. \endif

address— \if KO 읽기를 시작할 PLC 주소입니다. \endif \if EN The PLC address at which to begin reading. \endif
count— \if KO 읽을 워드 수입니다. \endif \if EN The number of words to read. \endif
cancellationToken— \if KO 읽기 작업을 취소하는 토큰입니다. \endif \if EN A token that cancels the read operation. \endif

반환: \if KO 읽은 워드 배열 또는 PLC 오류를 포함하는 결과 작업입니다. \endif \if EN A task containing the word array or a PLC error. \endif

ReadWordsOneByOne Method

\if KO 지정 범위의 PLC 워드를 단건 COM 호출로 읽습니다. \endif \if EN Reads the specified range of PLC words using individual COM calls. \endif

component— \if KO 연결된 MX Component COM 개체입니다. \endif \if EN The connected MX Component COM object. \endif
address— \if KO 시작 PLC 주소입니다. \endif \if EN The starting PLC address. \endif
count— \if KO 읽을 워드 수입니다. \endif \if EN The number of words to read. \endif
cancellationToken— \if KO 반복 읽기를 취소하는 토큰입니다. \endif \if EN A token that cancels the repeated reads. \endif

반환: \if KO 워드 배열 또는 첫 번째 PLC 오류를 포함하는 결과 작업입니다. \endif \if EN A task containing the word array or the first PLC error. \endif

ReleaseComponent Method

\if KO 보유한 MX Component COM 개체의 참조를 최종 해제하고 연결 상태를 초기화합니다. \endif \if EN Finally releases the owned MX Component COM reference and clears the connection state. \endif

RequireComponent Method

\if KO 현재 연결된 MX Component COM 개체를 반환합니다. \endif \if EN Returns the currently connected MX Component COM object. \endif

반환: \if KO 연결된 COM 개체입니다. \endif \if EN The connected COM object. \endif

ToResult Method

\if KO MX Component 반환 코드를 표준 PLC 결과로 변환합니다. \endif \if EN Converts an MX Component return code to a standard PLC result. \endif

resultCode— \if KO 0이 성공인 MX Component 반환 코드입니다. \endif \if EN The MX Component return code, where zero indicates success. \endif
message— \if KO 실패 결과에 포함할 작업 메시지입니다. \endif \if EN The operation message to include in a failure result. \endif

반환: \if KO 성공 또는 코드와 메시지를 포함한 실패 결과입니다. \endif \if EN A success result or a failure result containing the code and message. \endif

TryExtractBoolArray Method

\if KO COM 배열 값을 지정한 길이의 부울 배열로 추출합니다. \endif \if EN Extracts a COM array value into a Boolean array of the requested length. \endif

source— \if KO COM 호출이 반환한 배열 값입니다. \endif \if EN The array value returned by the COM invocation. \endif
count— \if KO 추출할 요소 수입니다. \endif \if EN The number of elements to extract. \endif
values— \if KO 변환 성공 시 추출된 비트 배열을 받습니다. \endif \if EN Receives the extracted bit array when conversion succeeds. \endif

반환: \if KO 지원되는 형식과 충분한 길이를 가진 배열이면 , 아니면 입니다. \endif \if EN when the source has a supported type and sufficient length; otherwise, . \endif

TryExtractShortArray Method

\if KO COM 배열 값을 지정한 길이의 배열로 추출합니다. \endif \if EN Extracts a COM array value into a array of the requested length. \endif

source— \if KO COM 호출이 반환한 배열 값입니다. \endif \if EN The array value returned by the COM invocation. \endif
count— \if KO 추출할 요소 수입니다. \endif \if EN The number of elements to extract. \endif
values— \if KO 변환 성공 시 추출된 워드 배열을 받습니다. \endif \if EN Receives the extracted word array when conversion succeeds. \endif

반환: \if KO 지원되는 형식과 충분한 길이를 가진 배열이면 , 아니면 입니다. \endif \if EN when the source has a supported type and sufficient length; otherwise, . \endif

WriteBitsCoreAsync Method

\if KO 연속된 PLC 비트 값을 단건 MX Component 호출로 씁니다. \endif \if EN Writes consecutive PLC bit values using individual MX Component calls. \endif

address— \if KO 쓰기를 시작할 PLC 주소입니다. \endif \if EN The PLC address at which to begin writing. \endif
values— \if KO 쓸 비트 값입니다. \endif \if EN The bit values to write. \endif
cancellationToken— \if KO 쓰기 작업을 취소하는 토큰입니다. \endif \if EN A token that cancels the write operation. \endif

반환: \if KO 첫 번째 실패 코드 또는 성공을 포함하는 쓰기 결과 작업입니다. \endif \if EN A task containing the first failure code or a successful write result. \endif

WriteWordsCoreAsync Method

\if KO 연속된 PLC 워드 값을 쓰며 블록 호출이 호환되지 않으면 단건 호출로 전환합니다. \endif \if EN Writes consecutive PLC word values and falls back to single-device calls when the block call is incompatible. \endif

address— \if KO 쓰기를 시작할 PLC 주소입니다. \endif \if EN The PLC address at which to begin writing. \endif
values— \if KO 쓸 워드 값입니다. \endif \if EN The word values to write. \endif
cancellationToken— \if KO 쓰기 작업을 취소하는 토큰입니다. \endif \if EN A token that cancels the write operation. \endif

반환: \if KO 첫 번째 실패 코드 또는 성공을 포함하는 쓰기 결과 작업입니다. \endif \if EN A task containing the first failure code or a successful write result. \endif

Options Property

\if KO 이 클라이언트가 사용하는 MX Component 옵션을 가져옵니다. \endif \if EN Gets the MX Component options used by this client. \endif

_component Field

\if KO component 값을 보관합니다. \endif \if EN Stores the component value. \endif

_factory Field

\if KO factory 값을 보관합니다. \endif \if EN Stores the factory value. \endif

_options Field

\if KO options 값을 보관합니다. \endif \if EN Stores the options value. \endif

MitsubishiMxDeviceNameFormatter

Format Method

\if KO PLC 주소를 MX Component 장치 문자열로 변환합니다. \endif \if EN Formats a PLC address as an MX Component device string. \endif

address— \if KO 변환할 PLC 주소입니다. 은 정규화된 숫자 오프셋이며 X/Y/B/W 오프셋은 16진수로 표시됩니다. \endif \if EN The PLC address to format. is the normalized numeric offset; X/Y/B/W offsets are rendered in hexadecimal. \endif

반환: \if KO MX Component 장치 문자열입니다. \endif \if EN The MX Component device string. \endif

FormatOffset Method

\if KO 오프셋 증분을 적용한 PLC 주소를 MX Component 장치 문자열로 변환합니다. \endif \if EN Formats a PLC address as an MX Component device string after applying an offset delta. \endif

address— \if KO 시작 PLC 주소입니다. \endif \if EN The starting PLC address. \endif
delta— \if KO 주소에 더할 증분입니다. \endif \if EN The delta to add to the address offset. \endif

반환: \if KO 증분이 적용된 MX Component 장치 문자열입니다. \endif \if EN The MX Component device string with the delta applied. \endif