AB-EtherNet (PLC-5 / SLC-500) 드라이버
개요
AB-EtherNet — Allen-Bradley 의 레거시 PLC-5 / SLC-500 PLC 가 사용하는 CSP(Client/Server Protocol) over EtherNet + PCCC 명령. ControlLogix 의 EtherNet/IP(CIP)와는 별개로, 파일/엘리먼트 기반의 logical addressing(N7:0)을 씁니다. 2026-07 네이티브 재작성 — 옛 Apache PLC4j ab-eth 위임은 제거되었습니다(그 드라이버가 CSP 연결 직후 요청을 보내지 않고 소켓을 끊어 수집 불가였음). 지금은 plantpulse-plc-protocol 의 자체 CSP/PCCC 구현(AbEthPLC)을 사용 — FINS / MELSEC 와 동일한 네이티브 패턴.
| 항목 | 값 |
|---|---|
opc_type | AB-ETH |
| 구현 클래스 | plantpulse.driver.protocol.ab_eth.ABEthDriver |
| 라이브러리 | 자체 네이티브 (plantpulse-plc-protocol 의 abeth — CSP/PCCC socket 직접) |
| 상속 | BaseProtocolDriver (PLC4j 아님) |
| 기본 포트 | 2222 (CSP — EtherNet/IP 44818 아님) |
| 상태 | 안정 (구형 장비 대응) |
| read | OK (Protected Typed Logical Read) |
| write | ❌ (읽기 전용 — Protected Typed Logical Write 미구현) |
| 보안 | 없음 |
AB-ETH 는 CSP over TCP/2222 를 씁니다. EtherNet/IP(CIP)의 44818 이 아닙니다 — 옛 문서/폼의 44818 은 오기였습니다. ControlLogix(L8x / L7x)는 EtherNet/IP 드라이버(opc_type=EIP, 44818)를 사용합니다.
AB-ETH 드라이버는 PLC-5 / SLC-500 전용 — 심볼릭 태그(MyTag)가 아니라 N7:0 같은 레거시 logical address 를 씁니다.
클래스 구조
BaseProtocolDriver
└── ABEthDriver — connect() 에서 AbEthPLC(host, port, station) 생성 후 CSP register handshake
connect() 는 AbEthPLC 소켓을 열고 CSP register 를 수행합니다. read 실패 시 소켓을 무효화(connected=false)해 엣지가 재연결하도록 유도합니다.
wire 포맷 요약 (자체 구현)
- CSP encapsulation(register session) 위에 PCCC 명령.
- PCCC: PLC-5 / SLC-500 Protected Typed Logical Read (word range).
- Logical address:
N<file>:<element>[/<bit>].
OPC 등록 옵션
| 필드 | 의미 | 기본 |
|---|---|---|
opc_agent_ip | PLC IP | 192.168.0.80 |
opc_agent_port | TCP 포트 | 2222 (CSP) |
options.station | DF1 목적지 스테이션 번호 | 1 |
options.read-timeout | 응답 타임아웃 (ms) | 3000 |
태그 plc_address 형식
N<file>:<element>[/<bit>]:<TYPE>[[size]]
파일 문자는 항상 N(Integer). TYPE 은 필수:
| 표기 | 의미 |
|---|---|
N7:0:WORD | Integer file 7, element 0 — 16-bit |
N7:0:INTEGER | 동일 (WORD 의 별칭, signed 16-bit) |
N7:3:DWORD | element 3 — 32-bit |
N7:5:FLOAT | element 5 — 32-bit float |
N7:10/0:SINGLEBIT | element 10 의 비트 0 (Boolean) |
지원 TYPE: WORD(16-bit) / INTEGER(=WORD) / DWORD(32-bit) / FLOAT(32-bit) / SINGLEBIT(단일 비트). TYPE 을 생략하거나 다른 값을 쓰면 read 가 빈 문자열을 반환합니다.
.PRE / .ACC 등) 미지원타이머/카운터의 .PRE / .ACC 서브필드나 F8:(Float file) prefix 표기는 네이티브 파서가 받지 않습니다. Float 값은 N<file>:<elem>:FLOAT 로 읽습니다.
support / 미지원
- read: Protected Typed Logical Read (word range) — OK.
- write: 미지원 —
isWriteSupported() = false,write()는 항상false. (Protected Typed Logical Write 는 후속 구현.) - ControlLogix 심볼릭 태그(
MyController:Tag1): 본 드라이버 대상 아님 — EIP 드라이버 사용. - DH+ / DH-485 게이트웨이 라우팅: 미지원 — 직접 EtherNet 인터페이스가 필요.
curl 등록 예시
curl -X POST http://<edge-host>/api/v1/opc \
-H "Content-Type: application/json" \
-d '{
"opc_id": "OPC_ABETH_L1",
"opc_type": "AB-ETH",
"opc_name": "SLC-500 Line 1",
"opc_agent_ip": "192.168.0.80",
"opc_agent_port": "2222",
"site_id": "SITE_00001",
"auto_collect": true,
"timecycle": 1000,
"options": { "station": "1", "read-timeout": "3000" },
"tag_list": [
{"tag_id":"OPC_ABETH_L1_T01","tag_name":"Count","plc_address":"N7:0:WORD","data_type":"Integer"},
{"tag_id":"OPC_ABETH_L1_T02","tag_name":"Temp","plc_address":"N7:5:FLOAT","data_type":"Float"},
{"tag_id":"OPC_ABETH_L1_T03","tag_name":"Run","plc_address":"N7:10/0:SINGLEBIT","data_type":"Boolean"}
]
}'
참고
- Allen-Bradley DF1 / PCCC Programming Reference (1770-6.5.16).
- 코드:
plantpulse-edge-driver/src/plantpulse/driver/protocol/ab_eth/ABEthDriver.java+plantpulse-plc-protocol의abeth패키지. - 운영: PLC-5 / SLC-500 은 단종(2017)으로 부품 가용성이 떨어짐 — 신규 설계는 ControlLogix + EtherNet/IP 권장. 본 드라이버는 기설치 PLC 데이터 수집용.