If OPC Tag is True, Then Visibility is False

On Vision Module:
I have the Tag below bound to the Visibility property of an Image.
Question:
Is there a way to FLIP the logic directly on this window or do I need to use a Python script?
If OPC Tag is True, Then Visibility is False
I already tried these:
!
NOT

Change it from an indirect tag binding to an expression binding. Then you can handle both the indirection and the inversion in one shot.

This Image is part of a TEMPLATE, and I need to use INDIRECT tag binding.

Set up a custom property to hold the "raw value" of the tag. Generally do this on the template root, to help with paths not changing when you potentially move components in and out of groups.

Then use an expression binding on the visibility with the custom property to do the inversion.

!{Tray_Collect.Image 1.traySlots}
5 Likes

I don't quite follow. Can you elaborate a little more?

That would require using the tag() expression function in your UI. Don't do it.

4 Likes

On your template or widget, right click, select custom property, give it a name, type boolean.

In the custom property, bind it to the tag you want to invert.

In the visibility, use an expression of ! CustomPropertyName you created.

Steps 1 and 3 done. I need more data for Step 2 where is this (custom property) located at?



For two, if you click on the template, your custom property should now appear at the bottom of the property list in the property browser.

For your step 3, you have done this incorrectly.

  1. Expressions do not assign values, they return a result.
    The binding should literally be:
!{Tray_Collects.IsVisible}
2 Likes

Thanks for fixing Step 3
For step 2 the new properties do show up at the bottom, but I cannot click on it to bind it to the OPC tag. How or where is the actual binding done?

You created a template parameter, which you may want to do with a "Tag Path" parameter, but that's a different issue.

Instead, in this instance you want to create an Internal Property. Then you will be able to bind it.

Parameters are expected to get their values from outside of the template.

Grateful for your help—that was exactly what I needed