This type of writing is realized by specifying the value 1 for the additional, optional parameters:
'VBS131
Dim objTag
Set objTag = HMIRuntime.Tags("Tag1")
objTag.Write 8.1
or
'VBS132
Dim objTag
Set objTag = HMIRuntime.Tags("Tag1")
objTag.Value = 8
objTag.Write ,1
Note
Please note that the call takes longer in comparison to the standard call. The duration is also
dependent on the channel and AS, amongst other things.
The type of writing complies to the SetTagXXXWait() call in C scripting.
Writing with status handling
In order to ensure that a value has been written successfully, it is necessary to execute an
error check or determine the status of the tag, after the writing process.
This is done by checking the value of the "LastError" property after writing. When the test
proves successful, i.e. the job has been placed successfully, the tag status is checked.
In the case of a write job, the current status from the process is not determined. To establish
this,
it is necessary to read the tag. The value specified in the Quality Code property after the
read process provides an indication of the tag status and, if necessary, makes reference to a
failed AS connection.
In the following example, the "Tag1" tag is written. If an error occurs during writing, the error
value and error description appear in the Global Script diagnostics window. Finally, the Quality
Code is checked. If the Quality Code is no OK (0x80), it is displayed in the diagnostics window.
'VBS133
Dim objTag
Set objTag = HMIRuntime.Tags("Tag1")
objTag.Write 9
If 0 <> objTag.LastError Then
HMIRuntime.Trace "Error: " & objTag.LastError & vbCrLf & "ErrorDescription: " &
objTag.ErrorDescription & vbCrLf
Else
objTag.Read
If &H80 <> objTag.QualityCode Then
VBS for Creating Procedures and Actions
1.15 Examples of VBScript
MDM - WinCC: Scripting (VBS, ANSI-C, VBA)
740
System Manual, 11/2008,