Opc data Access Automation Specification



Download 1,93 Mb.
Pdf ko'rish
bet71/107
Sana03.01.2022
Hajmi1,93 Mb.
#317185
1   ...   67   68   69   70   71   72   73   74   ...   107
Bog'liq
OPC DA Auto 2.02 Specification

4.4.4.12

 

OPCItems  

Description 

A collection of OPCItem objects. This is the default property of the OPCGroup object. 

Syntax 


OPCItems As OPCItems 

Example 


VB Syntax Example (getting the property): 

Dim AnOPCItemCollection As OPCItems 

Set MyGroups = AnOPCServer.OPCGroups 

Set OneGroup = MyGroups.ConnectPublicGroup ( “AnOPCGroupName” ) 

  some more code here 

Set AnOPCItemCollection = OneGroup.OPCItems 

 

 

4.4.5



 

OPCGroup Methods 

4.4.5.1

 

SyncRead 

Description 

This function reads the value, quality and timestamp information for one or more items in a group.  

Syntax 


SyncRead(Source As Integer, NumItems As Long, ServerHandles() As Long, ByRef Values() As 

Variant,  ByRef Errors() As Long, Optional ByRef Qualities As Variant, Optional ByRef 

52 

 



OPC Data Access Automation Specification2.02 

TimeStamps As Variant) 

 

Part Description 



Source 

The ‘data source’; OPC_DS_CACHE or OPC_DS_DEVICE  

NumItems 

The number of items to be read. 

ServerHandles 

Array of server item handles for the items to be read 

Values 

Array of values. 

Errors 

Array of Long’s indicating the success of the individual item reads. 

This indicates whether the read succeeded in obtaining a defined 

value, quality and timestamp.  NOTE any FAILED error code 

indicates that the corresponding Value, Quality and Time stamp are 

UNDEFINED. 

Qualities 

Variant containing an Integer Array of Qualities. 

TimeStamps 

Variant containing a Date Array of UTC TimeStamps.  If the device 

cannot provide a timestamp then the server will provide one. 

 

Remarks 



The function runs to completion before returning.  The data can be read from CACHE in which case 

it should be accurate to within the ‘UpdateRate’ and percent deadband of the group. The data can be 

read from the DEVICE in which case an actual read of the physical device is to be performed. The 

exact implementation of CACHE and DEVICE reads is not defined by this specification.  

When reading from CACHE, the data is only valid if both the group and the item are active. If either 

the group or the item is inactive, then  the Quality will indicate out of service 

(OPC_QUALITY_OUT_OF_SERVICE).  Refer to the discussion of the quality bits later in this 

document for further information.  

DEVICE  reads are not affected by the ACTIVE state of the group or item. 

Example 


Private Sub ReadButton_Click() 

Dim Source As Integer 

Dim NumItems As Long  

Dim ServerIndex As Long  

Dim ServerHandles(10) As Long  

Dim Values() As Variant  

Dim Errors() As Long  

Dim Qualities() As Variant  

Dim TimeStamps() As Variant 

Source = OPC_DS_DEVICE 

53 

 



OPC Data Access Automation Specification2.02 

NumItems = 10 

For ServerIndex = 1 to NumItems 

set up which items to be read 

ServerHandles(ServerIndex) = AnOPCItemServerHandles(ServerIndex) 

Next ServerIndex 

OneGroup.SyncRead Source, NumItems, ServerHandles, Values, Errors, Qualities, TimeStamps 

For ServerIndex = 1 to NumItems 

‘ process the values 

TextBox(ServerIndex).Text = Values(ServerIndex) 

Next ServerIndex 

End Sub 



Download 1,93 Mb.

Do'stlaringiz bilan baham:
1   ...   67   68   69   70   71   72   73   74   ...   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