ChangeBrowsePosition Method

http://advosol.com/manuals/opcdanet/topic891.html

Change the current browse position. Move up, down or to in the hierarchical address space. ( IOPCBrowseServerAddressSpace:: ChangeBrowsePosition )
The function will return E_FAIL if called for a FLAT space. An error is returned if the passed string does not represent a 'branch'. Moving UP from the 'root' will return E_FAIL.
Note OPC_BROWSE_TO is new for version 2.0. Clients should be prepared to handle E_INVALIDARG if they pass this to a 1.0 server.

collapse.gifSyntax

Visual Basic (Usage)
copycode.gifCopy Code

Dim instance As OpcServer
Dim direction As OPCBROWSEDIRECTION
Dim name As String
Dim value As Integer   value = instance.ChangeBrowsePosition(direction, name)

C#

public int ChangeBrowsePosition(    OPCBROWSEDIRECTION direction,    string name
)
Parameters
direction
IN: direction, up, down or to
name
IN: branch name to move to
Return Value

HRESULTS
Description

S_OK
Successful Read.

E_FAIL
The call failed with an unspecific error.

E_OUTOFMEMORY
Not enough memory.

OPC_E_INVALIDARG
An argument of the call was invalid.

collapse.gifExample

C#
copycode.gifCopy Code

Srv.ChangeBrowsePosition( OPCBROWSEDIRECTION.OPC_BROWSE_UP, "" );  // to parent
Srv.ChangeBrowsePosition( OPCBROWSEDIRECTION.OPC_BROWSE_DOWN, "Device1" );
Srv.ChangeBrowsePosition( OPCBROWSEDIRECTION.OPC_BROWSE_TO, "" ); // to root
Srv.ChangeBrowsePosition( OPCBROWSEDIRECTION.OPC_BROWSE_TO, "Plant3.Section5.Device2" );

Visual Basic
copycode.gifCopy Code

Srv.ChangeBrowsePosition( OPCBROWSEDIRECTION.OPC_BROWSE_UP, "" )  ' to parent
Srv.ChangeBrowsePosition( OPCBROWSEDIRECTION.OPC_BROWSE_DOWN, "Device1" )
Srv.ChangeBrowsePosition( OPCBROWSEDIRECTION.OPC_BROWSE_TO, "" )  ' to root
Srv.ChangeBrowsePosition( OPCBROWSEDIRECTION.OPC_BROWSE_TO, "Plant3.Section5.Device2" )

collapse.gifRequirements

OPC DA Server Version: V2

collapse.gifSee Also

Reference
OpcServer Class
OpcServer Members

转载于:https://www.cnblogs.com/cppss/p/4078559.html

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值