Skip to content

incendium.exceptions.TagError

César Román edited this page Aug 11, 2021 · 9 revisions

Description

TagError inherits from Exception. This type of exception is to be raised whenever a read or write operation upon a tag fails.

Code Examples

import incendium.tag
from incendium.exceptions import TagError


def write_tags():
    """Perform bulk write."""
    tags = [
        "[tagProvider]Tags/T2",
        "[tagProvider]Tags/T3",
        "[tagProvider]Tags/T5",
        "[tagProvider]Tags/T7",
    ]
    values = [2, 3, 5, 7]

    ret = incendium.tag.write(tags, values)
    if 0 in ret:
        raise TagError("Error writing to one or more tags.")
Clone this wiki locally