Opc data Access Automation Specification



Download 1,93 Mb.
Pdf ko'rish
bet101/107
Sana03.01.2022
Hajmi1,93 Mb.
#317185
1   ...   97   98   99   100   101   102   103   104   ...   107
Bog'liq
OPC DA Auto 2.02 Specification

6

 

Appendix A - OPC Automation Error Handling 

When a run-time error occurs, the properties of the Visual Basic 



Err

 object are filled with information that 

uniquely identifies the error.   

If your Visual Basic code is not set up to handle the error using the On Error mechanism, an exception will be 

generated, and depending on the context (Visual Basic in Debug Mode, or an executable), a message box 

will be invoked with the following information: 

  Runtime Error: decimal error number (hex error number) 



  Method “X” of Object “Y” Failed.  (Note when your application is an executable, no value for X and Y are 

displayed) 

Therefore, it is highly recommended by the OPC Foundation, that your application take appropriate steps to 

catch any OPC Automation errors that may occur as a result of setting properties or invoking methods on the 

OPC Data Access Automation Objects. 

An 

error handler

 is a routine for trapping and responding to errors in your application. An OPC Automation 

client should add error handlers for any application functionality that involves setting a property or calling a 

method of OPC Data Access Automation Objects. The process of designing an error handler involves three 

steps:

 

1.



 

Set, or 


enable

, an error trap by telling the application where to branch to (which error-handling routine to 

execute) when an error occurs.

 

The On Error statement enables the trap and directs the application to the label marking the beginning of 



the error-handling routine. 

 

2.

 

Write an error-handling routine that will handle errors from setting properties or from method invocation on 



OPC Data Access Automation objects.

 

3.

 

Exit the error-handling routine.



 

Decide what action your application should take as a result of the error.  For example, if you attempted to 

add a group with a duplicate name(provided from the end user), you could advise the end user that the 

group was not added, and to enter a different name.  Your application could also take the approach of 

adding the group again(with a “”), letting the server generate the name.

 


Download 1,93 Mb.

Do'stlaringiz bilan baham:
1   ...   97   98   99   100   101   102   103   104   ...   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