Dreamine.PLC.Abstractions
Dreamine PLC 패키지군에서 공통으로 사용하는 PLC 통신 계약 레이어입니다.
이 패키지는 PLC Client, Simulator Client, WPF 진단 UI, 프로토콜 어댑터가 공통으로 사용하는 벤더 중립 인터페이스와 모델을 정의합니다.
목적
Dreamine.PLC.Abstractions는 PLC 계층의 최하위 계약 레이어입니다. 특정 PLC 벤더, 전송 구현, WPF UI, 시뮬레이터 런타임에 의존하면 안 됩니다.
Application / Sample
↓
Dreamine.PLC.Wpf
↓
Dreamine.PLC.Abstractions
↑
Vendor Adapters / Core / Simulators
포함 계약
- PLC Client 추상화
- PLC 연결 상태 모델
- PLC 디바이스 주소 모델
- Bit / Word Read/Write 요청 모델
- 동작 결과 모델
- 공통 PLC Client 옵션
설계 규칙
- 이 패키지는 벤더 중립으로 유지합니다.
- Mitsubishi, Omron, Siemens, LS, MX Component, CX-Compolet 전용 타입을 참조하지 않습니다.
- WPF를 참조하지 않습니다.
- 시뮬레이터 전용 동작을 Abstraction 계층에 넣지 않습니다.
- 모든 PLC 어댑터가 의존하는 안정적인 경계로 사용합니다.
검증 상태
현재 Dreamine PLC 샘플 흐름에서 다음 항목으로 검증되었습니다.
- InMemory PLC Client
- Dreamine TCP Simulator
- Mitsubishi MC TCP Simulator
- Mitsubishi MC UDP Simulator
- Omron FINS TCP Simulator
- Omron FINS UDP Simulator
- WPF PLC Monitor 바인딩
- 1PC 및 2PC 시뮬레이터 기반 Read/Write, Handshake 테스트
실제 PLC 연동은 각 프로토콜 패키지에서 별도 실기 테스트가 필요합니다.
벤더 런타임 정책
이 패키지는 Mitsubishi MX Component, Omron CX-Compolet, SYSMAC Gateway 또는 기타 벤더 런타임 DLL을 포함하지 않습니다.
벤더 런타임 어댑터는 별도 패키지로 분리해야 하며, 사용자가 벤더 소프트웨어를 직접 설치하고 정식 라이선스를 보유해야 합니다.
라이선스
MIT License.
구조 다이어그램
classDiagram
class IPlcClient {
<<interface>>
+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
}
class IPlcBatchReader {
<<interface>>
+ReadBitsAsync(string, int) Task~bool[]~
+ReadWordsAsync(string, int) Task~short[]~
}
class IPlcAddressParser {
<<interface>>
+Parse(string) PlcAddress
+Format(PlcAddress) string
}
class PlcAddress {
+string Device
+int Number
+PlcDataType DataType
}
class PlcDataType {
<<enumeration>>
Bit
Word
DWord
Float
String
}
IPlcClient <|-- IPlcBatchReader
IPlcClient --> IPlcAddressParser
IPlcAddressParser --> PlcAddress
PlcAddress --> PlcDataTypeAPI 문서
타입
\if KO PLC 주소 텍스트를 구조화된 주소로 변환하는 파서를 정의합니다. \endif \if EN Defines a parser that converts PLC address text into a structured address. \endif
\if KO 공급업체에 독립적인 PLC 클라이언트를 정의합니다. \endif \if EN Defines a vendor-neutral PLC client. \endif
\if KO PLC 디바이스 주소를 나타냅니다. \endif \if EN Represents a PLC device address. \endif
\if KO 공통 PLC 연결 옵션을 나타냅니다. \endif \if EN Represents common PLC connection options. \endif
\if KO PLC 클라이언트의 연결 상태를 정의합니다. \endif \if EN Defines the connection state of a PLC client. \endif
\if KO 공통 PLC 디바이스 메모리 영역을 정의합니다. \endif \if EN Defines common PLC device memory areas. \endif
\if KO PLC 읽기 요청을 나타냅니다. \endif \if EN Represents a PLC read request. \endif
\if KO PLC 작업 결과를 나타냅니다. \endif \if EN Represents the result of a PLC operation. \endif
\if KO 값을 포함한 PLC 작업 결과를 나타냅니다. \endif \if EN Represents the result of a PLC operation with a value. \endif
\if KO PLC 비트 쓰기 요청을 나타냅니다. \endif \if EN Represents a PLC bit-write request. \endif
\if KO PLC 워드 쓰기 요청을 나타냅니다. \endif \if EN Represents a PLC word-write request. \endif
IPlcAddressParser
\if KO PLC 주소 텍스트를 구문 분석합니다. \endif \if EN Parses PLC address text. \endif
text— \if KO PLC 주소 텍스트입니다. \endif \if EN The PLC address text. \endif반환: \if KO 구문 분석된 주소 결과입니다. \endif \if EN The parsed PLC address result. \endif
\if KO PLC 주소 텍스트의 구문 분석을 시도합니다. \endif \if EN Attempts to parse PLC address text. \endif
text— \if KO PLC 주소 텍스트입니다. \endif \if EN The PLC address text. \endifaddress— \if KO 성공 시 구문 분석된 PLC 주소입니다. \endif \if EN The parsed PLC address on success. \endif반환: \if KO 성공하면 입니다. \endif \if EN when parsing succeeds. \endif
IPlcClient
\if KO PLC에 연결합니다. \endif \if EN Connects to the PLC. \endif
cancellationToken— \if KO 연결 취소 토큰입니다. \endif \if EN The connection cancellation token. \endif반환: \if KO PLC 연결 결과입니다. \endif \if EN The PLC connection result. \endif
\if KO PLC 연결을 해제합니다. \endif \if EN Disconnects from the PLC. \endif
cancellationToken— \if KO 연결 해제 취소 토큰입니다. \endif \if EN The disconnection cancellation token. \endif반환: \if KO PLC 연결 해제 결과입니다. \endif \if EN The PLC disconnection result. \endif
\if KO PLC에서 비트 값을 읽습니다. \endif \if EN Reads bit values from the PLC. \endif
address— \if KO 시작 PLC 주소입니다. \endif \if EN The start PLC address. \endifcount— \if KO 읽을 비트 수입니다. \endif \if EN The number of bits to read. \endifcancellationToken— \if KO 읽기 취소 토큰입니다. \endif \if EN The read cancellation token. \endif반환: \if KO 비트 배열을 포함한 PLC 결과입니다. \endif \if EN The PLC result containing the bit array. \endif
\if KO PLC에서 워드 값을 읽습니다. \endif \if EN Reads word values from the PLC. \endif
address— \if KO 시작 PLC 주소입니다. \endif \if EN The start PLC address. \endifcount— \if KO 읽을 워드 수입니다. \endif \if EN The number of words to read. \endifcancellationToken— \if KO 읽기 취소 토큰입니다. \endif \if EN The read cancellation token. \endif반환: \if KO 워드 배열을 포함한 PLC 결과입니다. \endif \if EN The PLC result containing the word array. \endif
\if KO PLC에 비트 값을 씁니다. \endif \if EN Writes bit values to the PLC. \endif
address— \if KO 시작 PLC 주소입니다. \endif \if EN The start PLC address. \endifvalues— \if KO 쓸 비트 값입니다. \endif \if EN The bit values to write. \endifcancellationToken— \if KO 쓰기 취소 토큰입니다. \endif \if EN The write cancellation token. \endif반환: \if KO PLC 쓰기 결과입니다. \endif \if EN The PLC write result. \endif
\if KO PLC에 워드 값을 씁니다. \endif \if EN Writes word values to the PLC. \endif
address— \if KO 시작 PLC 주소입니다. \endif \if EN The start PLC address. \endifvalues— \if KO 쓸 워드 값입니다. \endif \if EN The word values to write. \endifcancellationToken— \if KO 쓰기 취소 토큰입니다. \endif \if EN The write cancellation token. \endif반환: \if KO PLC 쓰기 결과입니다. \endif \if EN The PLC write result. \endif
\if KO 현재 PLC 연결 상태를 가져옵니다. \endif \if EN Gets the current PLC connection state. \endif
\if KO PLC 연결 상태가 변경될 때 발생합니다. \endif \if EN Occurs when the PLC connection state changes. \endif
PlcAddress
\if KO PLC 디바이스 주소를 나타냅니다. \endif \if EN Represents a PLC device address. \endif
DeviceType— \if KO PLC 디바이스 메모리 타입입니다. \endif \if EN The PLC device memory type. \endifOffset— \if KO 디바이스 오프셋입니다. \endif \if EN The device offset. \endifBitOffset— \if KO 비트 접근용 선택적 오프셋입니다. \endif \if EN The optional bit offset for bit-level access. \endif\if KO 주소를 읽기 쉬운 문자열로 반환합니다. \endif \if EN Returns the address as a readable string. \endif
반환: \if KO 서식이 적용된 PLC 주소입니다. \endif \if EN The formatted PLC address. \endif
\if KO 비트 접근용 선택적 오프셋입니다. \endif \if EN The optional bit offset for bit-level access. \endif
\if KO PLC 디바이스 메모리 타입입니다. \endif \if EN The PLC device memory type. \endif
\if KO 이 주소가 비트 수준 주소인지 여부를 가져옵니다. \endif \if EN Gets whether this address points to a bit-level device. \endif
\if KO 디바이스 오프셋입니다. \endif \if EN The device offset. \endif
PlcConnectionOptions
\if KO 밀리초 단위 연결 제한 시간을 가져오거나 설정합니다. \endif \if EN Gets or sets the connection timeout in milliseconds. \endif
\if KO PLC 호스트 주소를 가져오거나 설정합니다. \endif \if EN Gets or sets the PLC host address. \endif
\if KO PLC 포트를 가져오거나 설정합니다. \endif \if EN Gets or sets the PLC port. \endif
\if KO 밀리초 단위 읽기 제한 시간을 가져오거나 설정합니다. \endif \if EN Gets or sets the read timeout in milliseconds. \endif
\if KO 논리 스테이션 번호를 가져오거나 설정합니다. \endif \if EN Gets or sets the logical station number. \endif
\if KO 밀리초 단위 쓰기 제한 시간을 가져오거나 설정합니다. \endif \if EN Gets or sets the write timeout in milliseconds. \endif
PlcConnectionState
\if KO 연결되었습니다. \endif \if EN The client is connected. \endif
\if KO 연결 중입니다. \endif \if EN The client is connecting. \endif
\if KO 연결이 해제되었습니다. \endif \if EN The client is disconnected. \endif
\if KO 연결 해제 중입니다. \endif \if EN The client is disconnecting. \endif
\if KO 오류 상태입니다. \endif \if EN The client is in a faulted state. \endif
PlcDeviceType
\if KO 링크 릴레이 영역입니다. \endif \if EN The link relay area. \endif
\if KO Mitsubishi 또는 일반 데이터 레지스터 영역입니다. \endif \if EN The Mitsubishi or general data-register area. \endif
\if KO 내부 릴레이 영역입니다. \endif \if EN The internal relay area. \endif
\if KO 유지 레지스터 영역입니다. \endif \if EN The retentive-register area. \endif
\if KO 알 수 없거나 지원되지 않는 디바이스입니다. \endif \if EN An unknown or unsupported device type. \endif
\if KO 링크 레지스터 영역입니다. \endif \if EN The link-register area. \endif
\if KO 입력 릴레이 영역입니다. \endif \if EN The input relay area. \endif
\if KO 출력 릴레이 영역입니다. \endif \if EN The output relay area. \endif
\if KO 파일 레지스터 영역입니다. \endif \if EN The file-register area. \endif
PlcReadRequest
\if KO PLC 읽기 요청을 나타냅니다. \endif \if EN Represents a PLC read request. \endif
Address— \if KO 시작 PLC 주소입니다. \endif \if EN The start PLC address. \endifCount— \if KO 읽을 값 수입니다. \endif \if EN The number of values to read. \endif\if KO 시작 PLC 주소입니다. \endif \if EN The start PLC address. \endif
\if KO 읽을 값 수입니다. \endif \if EN The number of values to read. \endif
PlcResult
\if KO 성공 여부, 오류 코드 및 메시지로 를 초기화합니다. \endif \if EN Initializes with success state, error code, and message. \endif
isSuccess— \if KO 작업 성공 여부입니다. \endif \if EN Whether the operation succeeded. \endiferrorCode— \if KO 선택적 오류 코드입니다. \endif \if EN The optional error code. \endifmessage— \if KO 선택적 결과 메시지입니다. \endif \if EN The optional result message. \endif\if KO 실패 PLC 결과를 만듭니다. \endif \if EN Creates a failed PLC result. \endif
message— \if KO 실패 메시지입니다. \endif \if EN The failure message. \endiferrorCode— \if KO 선택적 오류 코드입니다. \endif \if EN The optional error code. \endif반환: \if KO 실패 PLC 결과입니다. \endif \if EN A failed PLC result. \endif
\if KO 성공 PLC 결과를 만듭니다. \endif \if EN Creates a successful PLC result. \endif
반환: \if KO 성공 PLC 결과입니다. \endif \if EN A successful PLC result. \endif
\if KO 선택적 PLC 또는 어댑터 오류 코드를 가져옵니다. \endif \if EN Gets the optional PLC or adapter error code. \endif
\if KO 작업 성공 여부를 가져옵니다. \endif \if EN Gets whether the operation succeeded. \endif
\if KO 선택적 결과 메시지를 가져옵니다. \endif \if EN Gets the optional result message. \endif
PlcResult`1
\if KO 성공 상태, 값, 오류 코드 및 메시지로 결과를 초기화합니다. \endif \if EN Initializes the result with success state, value, error code, and message. \endif
isSuccess— \if KO 성공 여부입니다. \endif \if EN Whether the operation succeeded. \endifvalue— \if KO 결과 값입니다. \endif \if EN The result value. \endiferrorCode— \if KO 선택적 오류 코드입니다. \endif \if EN The optional error code. \endifmessage— \if KO 선택적 메시지입니다. \endif \if EN The optional message. \endif\if KO 실패 PLC 결과를 만듭니다. \endif \if EN Creates a failed PLC result. \endif
message— \if KO 실패 메시지입니다. \endif \if EN The failure message. \endiferrorCode— \if KO 선택적 오류 코드입니다. \endif \if EN The optional error code. \endif반환: \if KO 실패 PLC 결과입니다. \endif \if EN A failed PLC result. \endif
\if KO 값을 포함한 성공 PLC 결과를 만듭니다. \endif \if EN Creates a successful PLC result with a value. \endif
value— \if KO 결과 값입니다. \endif \if EN The result value. \endif반환: \if KO 성공 PLC 결과입니다. \endif \if EN A successful PLC result. \endif
\if KO 결과 값을 가져옵니다. \endif \if EN Gets the result value. \endif
PlcWriteBitRequest
\if KO 주소와 비트 값으로 를 초기화합니다. \endif \if EN Initializes with an address and bit values. \endif
address— \if KO 시작 PLC 주소입니다. \endif \if EN The start PLC address. \endifvalues— \if KO 쓸 비트 값입니다. \endif \if EN The bit values to write. \endif\if KO 시작 PLC 주소를 가져옵니다. \endif \if EN Gets the start PLC address. \endif
\if KO 쓸 비트 값을 가져옵니다. \endif \if EN Gets the bit values to write. \endif
PlcWriteWordRequest
\if KO 주소와 워드 값으로 를 초기화합니다. \endif \if EN Initializes with an address and word values. \endif
address— \if KO 시작 PLC 주소입니다. \endif \if EN The start PLC address. \endifvalues— \if KO 쓸 워드 값입니다. \endif \if EN The word values to write. \endif\if KO 시작 PLC 주소를 가져옵니다. \endif \if EN Gets the start PLC address. \endif
\if KO 쓸 워드 값을 가져옵니다. \endif \if EN Gets the word values to write. \endif