メインコンテンツまでスキップ

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
通信ライブラリ外部ネイティブバイナリ (./GEClientuGESRTP ベース)
継承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 に公開されて初めて可能となる。
  • 純粋な Java による SRTP 実装 — 現在は外部バイナリに依存。uGESRTP / iot-communication ライブラリによる in-process 化は、LS ドライバ (旧バージョン .NET → Java) と同じ方向性の後続課題。
  • 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) かをまず確認すること。