GE SRTP ドライバ
概要
GE SRTP (Service Request Transport Protocol) — GE Fanuc Series 90 / RX3i / RX7i / VersaMax PLC の
イーサネット通信プロトコル。PlantPulse Edge は外部 native client (GEClient) を子プロセスとして起動し、
標準出力の行をパースして値を蓄積する NativeProcessDriver パターンで実装している。
| 項目 | 値 |
|---|---|
opc_type | GE |
| 実装クラス | 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_port | PLC IP / SRTP ポート (通常 18245) | — |
timecycle | ポーリング周期 (ms) — 子プロセスに引数として渡される | — |
options.use-multi | マルチプロセスモード | true |
options.channel-thread | partition 数 (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 標準) |
|---|---|
R00001 | Register %R 1 (16-bit signed) |
R00500 | Register %R 500 |
I00001 | Input bit %I 1 |
Q00001 | Output bit %Q 1 |
T00001 | Temporary memory %T |
M00001 | Internal coil %M |
AI00001 | Analog input |
AQ00001 | Analog output |
format マッピング (afterFormat):
format | 動作 |
|---|---|
BIN[N] | ワード read 後に N ビットを抽出 (N = 0..F の hex 可) |
STR | ワード → 16-bit binary → ASCII text 変換 |
| (それ以外) | 子プロセスが送信した文字列をそのまま |
未対応領域
- Write —
write()が常に 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-SLOWwarn +ERROR:ログ —/opt/kopens/plantpulse-edge/plc/ge/GEClientが実行可能 (+x) かをまず確認すること。