ignition.ninja
← All pages
ScriptLevel 2 · Basic

Read tags and check quality

A tag read gives you a qualified value: the value, its quality and a timestamp. Here's how you can check quality before you trust the value.

pythonDownload
paths = ["[default]Line1/Motor/Speed", "[default]Line1/Motor/Current"]
values = system.tag.readBlocking(paths)
for path, qv in zip(paths, values):
    if qv.quality.isGood():
        print "%s = %s" % (path, qv.value)
    else:
        print "%s is bad: %s" % (path, qv.quality)