OPC Ua如何修改服务器名字,OPC UA服务器-字符串节点ID创建

我正在尝试创建一个包含某些方法的OPC UA服务器,并且需要为每个要公开的方法创建一个NodeId。

使用Integer标识符是可行的,但是使用String标识符,我无法使用OPC UA客户端调用该方法。

尝试使用第3部分客户端仍然无法正常工作,但是错误缺少NodeId,这似乎是预期的数字节点ID。

我不确定这是一个错误还是只是逃避了我。有人可以澄清我的疑问吗?

谢谢

使用(Prj:Opc.Ua.Core,文件:Node.cs)创建的NodeId整数:

#region public NodeId(uint value, ushort namespaceIndex)

///

/// Initializes a guid node identifier with a namespace index.

///

///

/// Creates a new NodeId that will use a numeric (unsigned int) for its Id, but also

/// specifies which namespace this node should belong to.

///

/// The new (numeric) Id for the node being created

/// The index of the namespace that this node should belong to

///

public NodeId(uint value, ushort namespaceIndex)

{

m_namespaceIndex = namespaceIndex;

m_identifierType = IdType.Numeric;

m_identifier = value;

}

#endregion

使用(Prj:Opc.Ua.Core,文件:Node.cs)创建的NodeId字符串:

#region public NodeId(string value, ushort namespaceIndex)

///

/// Initializes a string node identifier with a namespace index.

///

///

/// Creates a new NodeId that will use a string for its Id, but also

/// specifies if the Id is a URI, and which namespace this node belongs to.

///

/// The new (string) Id for the node being created

/// The index of the namespace that this node belongs to

public NodeId(string value, ushort namespaceIndex)

{

m_namespaceIndex = namespaceIndex;

m_identifierType = IdType.String;

m_identifier = value;

}

#endregion

示例客户端返回此错误:

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值