I have an Expression tag that is a boolean tag I want to link that to an OPCUA tag but cant think how to do it

I have an expression tag that is a boolean - it looks at 3 states and returns a true or false (is component correct, is recipe loaded & has work order started - this then indicates if the process is valid to run.

I want to link this to my machine so that I can display (igintion work order not started etc) on the machines local HMI via a boolean flag at the PLC.

if I link the opcua to this tag - the expression side is lost as it becomes an opcuia tag not an expression tag.

I have also tried looking at using a reference tag - but again this can only be a reference tag and not an opcua tag…

im probably (as normal) missing something that is right in front of me, but after searching the forum, google and tiral and error I am at a loss and need to reach out for help again.

Thanks

Please see example of the expression within the expression tag below

{[.]DataVerification/ComponentCorrect} && {[.]DataVerification/RecipeExist} && {[.]DataVerification/WOStarted}

You would need a change script on that tag to write the result to an OPC tag, which would in turn write it don’t to the PLC.

You might be able to construct something with a derived tag using a runScript() in its setter that sends something down using system.opc.write*.

That being said, I could also use the functionality of an expression tag writing somewhere else. Maybe log a feature request.

Maybe you can write to an opcua tag with a derived tag pointing to it ? You could then use the read and write expression fields of the derived tag to add some logic to it.

warning: No idea if that’s actually possible, or if it’s a good solution.

I vaguely remember writing the value of an opc tag to a different opc tag with an expression tag… I had to make a script in here that would use the current value from the expression , this box should be in your expression

then I used this underlined value and wrote that to the opc tag , which in your case would be the true and false part of the expression I believe

system.tag.writeBlocking - Ignition User Manual 8.0 - Ignition Documentation the script had one of these in it so it would send the currentvalue of the expression to the other tag

system.opc.writeValues - Ignition User Manual 8.0 - Ignition Documentation but there is also this, I didnt try this one but its the same effect

I’d go the tag change event script route if you really want to use Ignition. Or can you replicate the same logic in the hmi?

But I’m curious if you couldn’t just add this into the plc itself? This would be the most logical place for it.

In a tag change event, you can use relative referencing to point to the OPC tag for example

system.tag.writeBlocking('[.]opcTagName', currentValue) 

v7.9 natively supported this. It was dropped in v8, but gateway upgrades would convert those into a legacy tag change event.

I recommend putting all such regular computations into a gateway timer event script that uses writeBlocking to set all the results into OPC tags (and memory tags). Such a script can skip writes to unchanged tags for efficiency.