본문으로 건너뛰기

GE SRTP 드라이버

개요

GE SRTP (Service Request Transport Protocol) — GE Fanuc Series 90 / RX3i / RX7i / VersaMax PLC 의 이더넷 통신 프로토콜. PlantPulse Edge 는 외부 native client (GEClient) 를 자식 프로세스로 띄우고 표준출력 라인을 파싱해 값을 누적하는 NativeProcessDriver 패턴으로 구현.

항목
opc_typeGE
구현 클래스plantpulse.driver.protocol.ge.GEDriver
통신 라이브러리외부 네이티브 바이너리 (./GEClient, uGESRTP 기반)
상속NativeProcessDriver
read✅ (캐시 폴링)
write
보안없음
기본 포트18245 (SRTP TCP) — opc_agent_port 로 지정

클래스 구조 / 동작

GEDriver
└── ProcessTask (Thread) — ProcessBuilder 로 ./GEClient ip port addresses timecycle
└── Binder (Thread) — 자식의 stdout 한 라인씩 파싱
↳ "VAL:<dev>:<idx>:<type>:<format>:<value>" → current_value_map
↳ "START:" / "READ_FAIL:" / "ERROR:" / "LOG:" → 로그
  • connect()NetUtils.isReachable(ip) ICMP ping → 실패 즉시 종료. 옵션 use-multi=true + channel-thread 가 1보다 크면 주소 list 를 partition 해 여러 자식 프로세스를 동시 기동.
  • 자식 실행 디렉토리: /opt/kopens/plantpulse-edge/plc/ge. 실행 파일: ./GEClient.
  • read()current_value_map.get(addr + ":" + format) 으로 마지막 값 반환 (자식이 timecycle 마다 업데이트).
  • close() — 모든 ProcessTask 의 process.destroyForcibly().

OPC 등록 옵션

필드의미디폴트
opc_agent_ip / opc_agent_portPLC IP / SRTP 포트 (보통 18245)
timecycle폴링 주기 (ms) — 자식 프로세스에 인자로 전달
options.use-multi멀티 프로세스 모드true
options.channel-threadpartition 개수 (1=단일 프로세스)1

내부 상수: GE_DEFAULT_CONNECTION_DELAY_MS = 1500 — 첫 connect 후 대기. 10 초 동안 모든 태그가 read 안 되면 START-ADDRESS-SCAN-SLOW warn.


태그 plc_address 형식

자식 프로세스에 넘기는 형식 (commaIOAddress): <dev>:<idx>:<data_type>:<format> 콤마 join.

표기의미 (GE Fanuc 표준)
R00001Register %R 1 (16-bit signed)
R00500Register %R 500
I00001Input bit %I 1
Q00001Output bit %Q 1
T00001Temporary memory %T
M00001Internal coil %M
AI00001Analog input
AQ00001Analog output

format 매핑 (afterFormat):

format동작
BIN[N]워드 read 후 N 비트 추출 (N = 0..F hex 가능)
STR워드 → 16-bit binary → ASCII text 변환
(그 외)자식이 보낸 문자열 그대로

미지원 영역

  • Writewrite() 가 항상 false. SRTP write 가 native client 에 노출돼야 가능.
  • 순수 자바 SRTP 구현 — 현재는 외부 바이너리 의존. uGESRTP / iot-communication 라이브러리로 in-process 전환은 LS 드라이버 (구버전 .NET → 자바) 와 같은 방향의 후속 과제.
  • Symbolic Tag — 좌표 (영역+index) 만 지원, named tag 미지원.
  • Programming/Service Request 모드 — 단순 read 쿼리만.

테스트 커버리지

test/java/plantpulse/driver/protocol/ge/GEDriverTest — 주소 변환 (commaIOAddress), afterFormat 의 BIN/STR 분기 검증. wire-level 은 외부 바이너리에 위임이라 mock 자식 프로세스 단위 테스트는 별도.


참고

  • GE Fanuc SRTP — public reverse-engineering: uGESRTP, Wireshark dissector.
  • 코드: plantpulse-edge-driver/src/plantpulse/driver/protocol/ge/GEDriver.java.
  • 운영: 자식 바이너리 부재 시 connect 단계에서 PROCESS-SLOW warn + ERROR: 로그 — /opt/kopens/plantpulse-edge/plc/ge/GEClient 가 실행 가능 (+x) 인지 우선 확인.