Note
"Tags"
is a list with a restricted functional scope. The tags in the list cannot be accessed via
the index but only by using the tag names. The standard methods get_Count and
get_NewEnum cannot be used in the Tags list.
Usage
Tags in the list are accessed via:
HMIRuntime.Tags("Tagname")
The Tags list is used to declare tags (tag objects) for read and write access. In order that the
read and write access can be executed without any errors, the corresponding tags must be
available in the WinCC Tag Management.
Using VBScript in WinCC it is possible to address tags directly by their name to define and
read
values. If you wish to inquire about additional tag properties, such as quality code or time
stamp, or wish to execute error processing, you must address the tag through tags list. The
tag object returned enables access to all tag properties and methods.
Using the "CreateTagSet" method, you may generate a TagSet object which allows
simultaneous access to several tags.
Example:
There are two options when creating tags:
● With specification of the server prefix: For tags in multi-user systems which are not stored
locally.
● Direct use of the tag name: For tags stored locally on the computer.
Specification of the server prefix
'VBS15
Dim objTag
Set objTag = HMIRuntime.Tags("Serverprefix::Tagname")
If the server prefix is entered directly, the "ServerPrefix" property is assigned the
corresponding value.
Specification of the tag name
'VBS16
Dim objTag
VBS for Creating Procedures and Actions
1.14 VBS Reference
MDM - WinCC: Scripting (VBS, ANSI-C, VBA)
150
System Manual, 11/2008,