Can you tell me why i would be getting he “no viable input” error on this script?
You are missing the closing )
on line 2 for the system.tag.writeAsync()
call.
yep sorry guys
In the above when I read the tag data im getting: [[0038014279, Good, Tue Jul 19 13:58:37 CDT 2022 (1658257117678)]]]
how can I only get this: 0038014279 out?
I get the same output when i read the .value of the tag also
You’re requesting the tag values for a list, which is returned as a list of Qualified Values. A Qualified Value has all sorts of info including quality and the timestamp of the most recent change.
You should modify your read to store only the value of the Qualified Value:
ID = tag[0].value
Edit: updated to reflect that you’re also getting a list of Qualified Values.
Relevant code:
def runAction(self, event):
tags = system.tag.readBlocking(["[default]CylinderTag"])
system.perspective.print("All tags: {0}".format(tags))
system.perspective.print("QV: {0}".format(tags[0]))
system.perspective.print("value: {0}".format(tags[0].value))
Relevant output:
12:45:25.068 [Browser Thread: 60614] INFO Perspective.Designer.Workspace - All tags: [[2, Good, Thu Jul 07 18:42:50 PDT 2022 (1657244570333)]]
12:45:25.068 [Browser Thread: 60614] INFO Perspective.Designer.Workspace - QV: [2, Good, Thu Jul 07 18:42:50 PDT 2022 (1657244570333)]
12:45:25.069 [Browser Thread: 60614] INFO Perspective.Designer.Workspace - value: 2
Thanks that helped!