WritePendingValues method

Attempts to perform a synchronous write of all the tags in the specified TagGroup object whose PendingWriteValue property is not vbEmpty. Returns True if all values are successfully written, or False if one or more values fail to be written.
Syntax
Result = Group
.
WritePendingValues
(
TagsInError
)
where
Result
– is the name of a Boolean variable that will be set to True if all values are successfully written, or False if one or more values fail to be written.
Group
– is the name of a TagGroup object or an expression that evaluates to a TagGroup object.
TagsInError
– is a parameter of the type StringList which returns a string list collection containing the names of the tags that fail to be written. If all tags are written successfully, the TagsInError collection is empty. If one or more values fail to write, the TagsInError collection contains the names of the tags for which the write failed.
IMPORTANT:
  • If a tag read (or tag write) is to be called immediately after a Tag object of its parent TagGroup object is set to Active, the tag read (or tag write) should be preceded by a call to the RefreshFromSource method to ensure that the tag has been put on scan. After a tag has successfully been put on scan, calling the RefreshFromSource method is no longer required.
  • Alternatively, for a single tag, you can use the GetTagData method with its RefreshFromSource parameter set to True.
Remarks
  • Each Tag object whose value is successfully written has its PendingWriteValue property set to vbEmpty and its LastErrorNumber property set to 0 (zero).
  • Each Tag object whose value is not successfully written by the data server, retains its PendingWriteValue property value and its LastErrorNumber property is set to the error number returned by the data server. The LastErrorString property returns a text string that describes the error.
  • Each HMI tag in the group for which the current user does not have write access, retains its PendingWriteValue property value and its LastErrorNumber property is set to tagErrorInvalidSecurity.
  • If a Display Client is configured or licensed as Read-only, the error tagErrorReadOnlyAccess is raised and no tags are written.
  • If the method fails for any other reason, the error tagErrorOperationFailed is raised, and the description contains the error code and reason for the failure.
Provide Feedback
Have questions or feedback about this documentation? Please submit your feedback here.
Normal