erikwang2013/industrial-protocols-opc-ua

There is no license information available for the latest version (v1.1.2) of this package.

OPC UA Binary 协议包 — 完整 UA Binary 协议栈,支持 CreateSession/Read/Write/Browse

Maintainers

Package info

github.com/erikwang2013/industrial-protocols-opcua

Type:industrial-protocol

pkg:composer/erikwang2013/industrial-protocols-opc-ua

Transparency log

Statistics

Installs: 0

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.1.2 2026-07-26 14:27 UTC

This package is auto-updated.

Last update: 2026-07-26 14:53:36 UTC


README

English

OPC UA (Unified Architecture) Binary 协议栈,TCP 端口 4840。实现 Hello/Acknowledge 握手、SecureChannel 安全通道、SessionManager 会话管理、Read/Write/Browse 服务。

安装

composer require erikwang2013/industrial-protocols-opcua

架构

OpcUaDriver(TCP)→ UaTcpMessage(Hello/Ack)→ SecureChannel(安全通道)→ SessionManager(CreateSession/ActivateSession)→ Read/Write/Browse 服务。BinaryEncoder/Decoder 二进制编解码。NodeId/StatusCode/Variant 类型系统。

功能

TCP Hello/Acknowledge 握手、SecureChannel Open/Close、CreateSession/ActivateSession、Read/Write/Browse 服务、NodeId 多种格式(ns=0;i=2258 / ns=2;s=Temp / i=2258 / 原始数值)、Variant 类型(Int32/Double/String/Bool/NodeId)、StatusCode 状态码

使用说明

$conn = $kernel->getConnectionManager()->connect('opcua-server');
$result = $conn->read('ns=0;i=2258');          // CurrentTime
$result = $conn->read('ns=2;s=Temperature');   // 字符串标识
$conn->write(['ns=2;s=SetPoint' => 100.0]);    // 写入
$children = $conn->browse('i=85');             // 浏览 Objects

配置示例

'devices' => [
    'opcua-server' => [
        'protocol' => 'opc-ua', 'variant' => 'binary',
        'host' => '192.168.1.100', 'port' => 4840,
        'timeout' => 5000,
        'application_uri' => 'urn:myapp:industrial-protocols',
        'session_name' => 'PHP-OPCUA-Client',
    ],
],

兼容框架

Laravel / Webman / Hyperf / ThinkPHP / Yii2 / Plain PHP

系统要求

  • PHP >= 8.1
  • Composer
  • erikwang2013/industrial-protocols-kernel

License

MIT — Copyright (c) 2026 erik erik@erik.xyzhttps://erik.xyz