
HMIRuntime.Language = 1031
See also
HMIRuntime Object (Page 125)
LastError Property
Description
Returns an error code regarding the success of the last operation, e.g. information on a tag
write or read process. The "QualityCode" property can provide information on the quality of
the returned value. A description of the error can be called in using the "ErrorDescription"
property.
LONG (read only)
The following error codes are defined:
Code in hexadecimal notation Description
0x00000000 OK
0x80040001 Execution error
0x80040002 Tag error
0x80040003 Server not available.
0x80040004 Multi Tag Error (Error in one or several tags)
In order that LastError returns a value, a read must be executed beforehand.
If an error occurs during read or write of several tags using the TagSet object, the error is set
to "Multi Tag Error". In order to determine at which tag the error occurred and what type of
error it was, the LastError property of each tag must be analyzed.
Example:
The following example displays the error code for "Tag1":
'VBS77
Dim objTag
Set objTag = HMIRuntime.Tags("Tag1")
objTag.Read
MsgBox objTag.LastError
The following example adds two tags to the TagSet list and outputs the LastError property as
Trace.
'VBS178
VBS for Creating Procedures and Actions
1.14 VBS Reference
MDM - WinCC: Scripting (VBS, ANSI-C, VBA)
System Manual, 11/2008,
407