I have a opc string tag that may contain “BC0”, “BC1”, “BC2”, “TQ0”, “TQ1”, “TQ2”… etc. depending on the instructions that was selected by the user.
I want to script something on Ignition when the tag says “BC”, TQ, or UC.
an example of my script would be: if({tag} = “BC(wildcard?)” , 1,0)
I am just trying to minimize my scripting and avoiding writing the script like:
if({tag} = “BC0” , 1,0 &&
if({tag} = “BC1” , 1,0) &&
if({tag} = “BC2” , 1,0)))
Yeah, the like operator is very situational but very useful. It's also worth noting - you don't actually need an if statement if your only return is 1/0 (ie, true/false) - you can just use chain boolean operators directly: {tag} like 'BC%' || {tag} like 'TQ%' will return a true value if either condition is met.