Perspective - Bidirectional tag binding not working

I have a simple UDT for a button with a few boolean sub-tags:
image

I’m trying to make a custom button which binds to this UDT in the dropConfig:
image

The binding to the tag parameter is bidirectional:
image

All sub-tags feed through to the view just fine but when I try write back to them via scripting, e.g.:
self.view.params.tag.Value = True

…it only gets as far as writing to the view parameter, and doesn’t get through to the tag to which it is bound. I know this isn’t the “proper” way of writing a tag via scripting but I can’t get the path from this parameter either, as far as I can tell.

I know the alternative is to bind to the path instead but this becomes very clumsy with indirect bindings as you have to do a lot of additional string formatting by hand, which is made even more clumsy by the weird offset between the mouse pointer and the cursor in the text editor.

Thanks in advance for the help!

Version: 8.1.0 (b2020110211)

Hello Mark,
Did you get this resolved? I’m having an issue with the bidirectionality not working. If I change the a tag value in the tag editor it shows up in the view. However, if I change the value in the view (with say a slider component), the view value changes but not the tag value.
Thanks,
Ted.

I’m having the same issue. It’s an indirect tag binding with bidirectional binding. I’m wondering if it might be more efficient than system.tag.writeBlocking since the tag connection is already made.

I've got the same issue - did you resolve it??

I am also having this issue. It does appear that the parameter is updating, but the bi-directional binding to the tag is not writing the new value back to the tag.

Long time since this post was started, but I wouldn't expect trying to write back to a tag via the bidirectional prop when it's bound this way to work. Don't bind to the UDT instance, bind to the individual tags and bidirectionally bind those

How do you templatize anything only using direct bindings? Genuinely curious to know if there's a better way than what I'm doing

I didn't mean use direct bindings, still use indirect bindings but to individual tags in the UDT instance.

1 Like

No real point binding a parameter as the UDT itself, just bind the path to the UDT, then everything is relative to that path. No issues with parameter directions, and also you get access to the metadata of the tags themselves, which is essential for clean use of things like permissions and engineering units.
As soon as you bind the UDT data to a parameter it strips off all the accompanying data.
With all my UDTs, for example a sensor UDT, you might have:

  • Value
  • High Setpoint
  • Low Setpoint

The Value tag will be quantified in some sort of Engineering Units, so you would represent that in the display with a binding to UDTPath/Value.EngUnit

The High/Low Setpoint would normally be locked out to users without permissions, but you normally want to show this to a user to indicate a control is not available, so you would bind the control for this visual feedback to UDTPath/High Setpoint.CanWrite with True meaning enabled.

If you bind the UDT data structure itself, you get none of this functionality.

1 Like