opcua

package
v0.28.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 28, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	//OPC UA Server Endpoint, eg. opc.tcp://localhost:4840
	Server string
	//Security Policy URL or one of None, Basic128Rsa15, Basic256, Basic256Sha256
	Policy string
	//Security Mode: one of None, Sign, SignAndEncrypt
	Mode string
	//Authentication Mode: one of Anonymous, UserName, Certificate
	Auth     string
	Username string
	Password string
	//OPC UA Server CertFile Path
	CertFile string
	//OPC UA Server CertKeyFile Path
	CertKeyFile string
}

Configuration 节点配置

func (Configuration) GetAuth

func (c Configuration) GetAuth() string

func (Configuration) GetCertFile

func (c Configuration) GetCertFile() string

func (Configuration) GetCertKeyFile

func (c Configuration) GetCertKeyFile() string

func (Configuration) GetMode

func (c Configuration) GetMode() string

func (Configuration) GetPassword

func (c Configuration) GetPassword() string

func (Configuration) GetPolicy

func (c Configuration) GetPolicy() string

func (Configuration) GetServer

func (c Configuration) GetServer() string

func (Configuration) GetUsername

func (c Configuration) GetUsername() string

type ReadNode

type ReadNode struct {
	base.SharedNode[*opcua.Client]
	//节点配置
	Config WriteNodeConfiguration
	// contains filtered or unexported fields
}

ReadNode opcua读取节点 查询消息负荷 msg.Data 中节点列表点位数据 节点列表格式:["ns=3;i=1003","ns=3;i=1005"] 查询结果会重新赋值到msg.Data,通过`Success`链传给下一个节点 结果格式: [

 {
   "displayName": "ns=3;i=1003",
   "floatValue": 0,
   "nodeId": "ns=3;i=1003",
   "quality": 0,
   "recordTime": "0001-01-01T00:00:00Z",
   "sourceTime": "0001-01-01T00:00:00Z",
   "timestamp": "0001-01-01T00:00:00Z",
}

]

func (*ReadNode) Destroy

func (x *ReadNode) Destroy()

Destroy 清理资源

func (*ReadNode) Init

func (x *ReadNode) Init(ruleConfig types.Config, configuration types.Configuration) error

func (*ReadNode) New

func (x *ReadNode) New() types.Node

func (*ReadNode) OnMsg

func (x *ReadNode) OnMsg(ctx types.RuleContext, msg types.RuleMsg)

OnMsg 实现 Node 接口,处理消息

func (*ReadNode) Type

func (x *ReadNode) Type() string

Type 返回组件类型

type WriteNode

type WriteNode struct {
	base.SharedNode[*opcua.Client]
	//节点配置
	Config WriteNodeConfiguration
	// contains filtered or unexported fields
}

WriteNode opcua写入节点 把消息负荷 msg.Data 点位数据写入到opcua服务器,格式为:

[
  {
    "nodeId": "ns=3;i=1009",
    "value": 1
  },
  {
    "nodeId": "ns=3;i=1010",
    "value": 2
  }
]

写入成功,流转到`Success`链 否则流程转到`Failure`链

func (*WriteNode) Destroy

func (x *WriteNode) Destroy()

Destroy 清理资源

func (*WriteNode) Init

func (x *WriteNode) Init(ruleConfig types.Config, configuration types.Configuration) error

func (*WriteNode) New

func (x *WriteNode) New() types.Node

func (*WriteNode) OnMsg

func (x *WriteNode) OnMsg(ctx types.RuleContext, msg types.RuleMsg)

OnMsg 实现 Node 接口,处理消息

func (*WriteNode) Type

func (x *WriteNode) Type() string

Type 返回组件类型

type WriteNodeConfiguration

type WriteNodeConfiguration struct {
	//OPC UA Server Endpoint, eg. opc.tcp://localhost:4840
	Server string
	//Security Policy URL or one of None, Basic128Rsa15, Basic256, Basic256Sha256
	Policy string
	//Security Mode: one of None, Sign, SignAndEncrypt
	Mode string
	//Authentication Mode: one of Anonymous, UserName, Certificate
	Auth     string
	Username string
	Password string
	//OPC UA Server CertFile Path
	CertFile string
	//OPC UA Server CertKeyFile Path
	CertKeyFile string
}

WriteNodeConfiguration 节点配置

func (WriteNodeConfiguration) GetAuth

func (c WriteNodeConfiguration) GetAuth() string

func (WriteNodeConfiguration) GetCertFile

func (c WriteNodeConfiguration) GetCertFile() string

func (WriteNodeConfiguration) GetCertKeyFile

func (c WriteNodeConfiguration) GetCertKeyFile() string

func (WriteNodeConfiguration) GetMode

func (c WriteNodeConfiguration) GetMode() string

func (WriteNodeConfiguration) GetPassword

func (c WriteNodeConfiguration) GetPassword() string

func (WriteNodeConfiguration) GetPolicy

func (c WriteNodeConfiguration) GetPolicy() string

func (WriteNodeConfiguration) GetServer

func (c WriteNodeConfiguration) GetServer() string

func (WriteNodeConfiguration) GetUsername

func (c WriteNodeConfiguration) GetUsername() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL