Hello! I am trying to get a text to change what it says based on if 2 tags are true or false. For example, if the RDY (ready) tag is on and the RNG (running) tag is on, the text should say ‘RUNNING’. I have a tag path property on the popup window (in vision) and want this to work indirectly so that the expression on the text will find the RDY and RNG tag of any tag path given. I have tried a few different chunks of code and I can’t get around some errors. If anyone has any advice, it would be greatly appreciated. Here are the two pieces of code I have been experimenting with:
ready = system.tag.writeToTag((event.source.parent.TagPath)+"/RDY", value)
running = system.tag.writeToTag((event.source.parent.TagPath)+"/RNG", value)
if (ready=1 && running=1, "RUNNING",
if (ready=1 && running=0, "READY",
if (ready=0, "NOT READY")))
and…
if ({[default]Root Container.TagPath/RDY}=1 && {[default]Root Container.TagPath/RNG}=1, "RUNNING",
if ({[default]Root Container.TagPath/RDY}=1 && {[default]Root Container.TagPath/RNG}=0, "READY",
if ({[default]Root Container.TagPath/RDY}=0, "NOT READY")))
Thanks for this! When I try this I get an error that says “Invalid tag path: ‘[default]Root Container.TagPath/RDY’. Token PATH_SEPARATOR found after property name.”
if (tag("sometagpath"+"/RDY")=1 && tag("sometagpath"+"/RNG")=1, "RUNNING",
if (tag("sometagpath"+"/RDY")=1 && tag("sometagpath"+"/RNG")=0, "READY",
if (tag("sometagpath"+"/RNG")=0, "NOT READY")))
This seems to solve some of my problems but when I use the code below, I get this error:
“Syntax Error on Token: ‘COMMA’ (Line 1 , Char 86)”
I’ve tried a few different variations and can’t get them to work. Do you know what I am doing wrong? Thank you!!
if (tag("Root Container.TagPath"+"/RDY")=1 && tag("Root Container.TagPath"+"/RNG")=1, "RUNNING",
if (tag("Root Container.TagPath"+"/RDY")=1 && tag("Root Container.TagPath"+"/RNG")=0, "READY",
if (tag("Root Container.TagPath"+"/RDY")=0, "NOT READY")))
you are missing a second value here if the if is false somehting like this? if(tag("Root Container.TagPath"+"/RDY")=0, "NOT READY","NOT READY?")
this does not give me parsing errors: if (tag("Root Container.TagPath"+"/RDY")=1 && tag("Root Container.TagPath"+"/RNG")=1, "RUNNING", if(tag("Root Container.TagPath"+"/RDY")=1 && tag("Root Container.TagPath"+"/RNG")=0, "READY",if(tag("Root Container.TagPath"+"/RDY")=0, "NOT READY","NOT READY?")))