Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

AVEVA™ Plant SCADA

Error Handling

  • Last UpdatedJul 13, 2023
  • 2 minute read

Functions, when called from VB, throw an exception on error. The following table lists the possible HRESULT errors that may be encountered:

C++ define

Hex value

Hex codes in VB

Description

S_OK

0

No exception

Successful execution

E_INVALIDARG

80070057

5

One or more arguments are out of range

E_HANDLE

80070006

80070006

No active object (page or graphical object)

E_POINTER

80004003

80004003

Missing or broken link encountered

E_ABORT

80000007

11F

Enumeration terminated or function manually canceled (for example ProjectUpdate)

E_FAIL

80004005

80004005

Every other error

The following VB code can be used to process the error code:

On Error Resume Next

Err.Clear

GraphicsBuilder.LibObjectName Project, File, Page, Type

If Err.Number <> 0 Then

Debug.Print "Error occurred in LibObjectName"

End If

Note the following points:

  • VB sets the Err variable only in the erroneous case. It will not be set to 0 if the function succeeds.

  • When VB handles an exception, it ignores the functions parameters. Hence when a function like ProjectNext does not succeed, the returned string is undefined and not an empty string.

The functions in the groups Page Functions, Options Functions, Object Drawing and Property Functions, Text Property Functions and the individual functions LibSelectionHooksEnabled, SelectionEventEnabled, BrokenLinkCancelEnabled and Visible are treated as variables in VB.

When calling these functions from C++, you need to use a "put_" or "get_" prefix, for example, "put_Visible(TRUE)", "get_Visible(bValue)" to set or fetch the values, except if the Attribute is read-only. In this case the function is the same in C++; for example, PageName.

To evaluate the correct function name for C++ reference the Type library CTDRAW32.TLB, which can be found in Plant SCADA's BIN directory. You can use Microsoft's Visual Studio Tool OLE / COM Object Viewer (select menu File | View Typelib...) to look at a type library.

See Also

Automation Events

TitleResults for “How to create a CRG?”Also Available in