Opc data Access Automation Specification



Download 1,93 Mb.
Pdf ko'rish
bet40/107
Sana03.01.2022
Hajmi1,93 Mb.
#317185
1   ...   36   37   38   39   40   41   42   43   ...   107
Bog'liq
OPC DA Auto 2.02 Specification

4.2

 

OPCBrowser Object 

Description 

The OPCBrowser object is a collection of branch or item names that exist in the server. Browsing 

is optional. If the server does not support browsing, CreateBrowser will not create this object.  

Syntax OPCBrowser 

Remarks 


The properties Filter, DataType, and AccessRights affect the collection at the time a method such 

as ShowLeafs is called. These properties let the client request a subset of the address space.  

If the user is browsing names of items to write data to, then the AccessRights property should be 

set to OPCWritable before calling ShowLeafs.  

Servers can have either a flat or hierarchical name space. When the namespace is flat, calling the 

method ShowLeafs fills the collection with the entire set of names in the server.  

Hierarchical browsing is a two step process. First, the browse position is set using a Move method, 

then the names are put into the collection using the Show methods. Calling ShowBranches fills the 

collection with the branches below the current position. Calling MoveDown with one of these 

branch names moves the position to that branch. Calling MoveUp moves up one level. Calling 

MoveToRoot moves all the way to the top level. From any position, branches and leafs can be 

browsed.  

ShowBranches and ShowLeafs should not be called from inside a For Each loop. 

The reason for this restriction is when in a For Each loop or a loop to Count the items, basically 

you would be changing the contents of the collection, and the next item has no meaning. 

Basically, you should not call ShowBranches and ShowLeafs while looping through the Browse 

object's collection. It is legal to call ShowLeafs while in a loop on some other collection. 

 

Example 



Dim WithEvents AnOPCServer As OPCServer 

Dim ARealOPCServer As String 

Dim ARealOPCNodeName As String 

Dim AnOPCServerBrowser As OPCBrowser 

Dim SomeName As Variant 

Set AnOPCServer = New OPCServer 

ARealOPCServer = “VendorX.DataAccessCustomServer” 

ARealOPCNodeName = “SomeComputerNodeName” 

AnOPCServer.Connect(ARealOPCServer, ARealOPCNodeName) 

Set browser = AnOPCServer.CreateBrowser 

AnOPCServerBrowser.ShowBranches 

 

AnOPCServerBrowser.MoveDown(AnOPCServerBrowser.Item(1) ) 



AnOPCServerBrowser.DataType = vbInteger 

AnOPCServerBrowser.ShowLeafs 

’ 1

st

 method for getting all names 



For I = 1 To AnOPCServerBrowser.Count 

30 


 


OPC Data Access Automation Specification2.02 

 

name = AnOPCServerBrowser.Item( I )   



’ Or… 

 

name = AnOPCServerBrowser ( I ) 



 listBox.Add 

name 


Next I 

’ 2


nd

 method for getting all names 

For Each name In AnOPCServerBrowser 

 listBox.Add 

name 

Next name 




Download 1,93 Mb.

Do'stlaringiz bilan baham:
1   ...   36   37   38   39   40   41   42   43   ...   107




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish