UDTs on perspective

Hello!

I'm migrating an existing system currently running in Vision, but there is a necessity to migrate to Perspective.

In Vision is possible to use a UDT as a property and it makes things ways easier, in perspective I saw there is an option to do the same but I'm not sure what I'm missing...

I followed this instructions:

UDT Parameter on Perspective view - Ignition Early Access - Inductive Automation Forum

but in the point:
In the view you just setup, add components you wish to bind the UDT members to.

If you are using Property Bindings (Read Only), you will add a property binding to the parameter you just created in step 3 adding a .<UDT Member Name> to the end. e.g. view.params.<PARAM>.<MEMBER>

If you are using Indirect Bindings to allow for bi-directional writes, you will add a tag binding (Indirect) and set the tag path to use the parameter in step 3 adding a /<UDT Member Name> to the end. e.g. {PARAM}/<UDT Member Name>.

I think I'm missing something because when I try to bind and indirect tag it pop up a window saying "Cannot configure bindings on input parameters".

is there someone that has the same issue?

Thank you.

You can't bind to the view param itself, you'll pass in the view param when you drop that view in a page/other view.

For example, in my IndicatorPanel view I have a view param called rootTagPath which expects a tag path to be passed to the view:

Then you bind that view param to something within the view, like my tooltip text in this example:

When you drop the indicator panel on a screen, you then set the view params in the props section:

1 Like

But has numerous negatives, including reducing the re-usability( and embeddability) of your UI components. Learn to pass a tagpath parameter into your views (and in Vision, into your templates and popup windows) and use indirect binding everywhere.

Since you appear to be just starting your conversion to Perspective, adopt techniques now that will save you much grief and rework later.

4 Likes

Hello!
This video explains step by step

UDTs and Template Views Video at Inductive University

1 Like

I'm afraid to say, but this video demonstrates an extremely poor way to configure your template Views (and should be removed!). Please don't do this!!

TL;DR: You significantly limit your options by using this method.
There are so many issues with this method.. some below:

  • you're passing values into the View and hence don't have a reference back to the UDT itself. E.g. if you want to read UDT parameters, parts of the tagpath, etc.
  • you can't read properties of tags, for example 'Tooltip', 'CanWrite', 'Enabled', 'EngMin', etc. that you may want to use in the display
  • it's more difficult to use these Views within a repeating component like the Flex Repeater
  • you can't use embedded views within this View that reference your UDT instance tags without essentially using the same poor methods within your embedding Views (i.e. passing values to them as well) which would then create a chain of value passing :face_vomiting: leading to slow and clunky value updating as well as tag writes
  • doesn't support tag paths using spaces (some might disagree with using these in the first place)
  • if you choose to bidirectionally bind the UDT instance to the embedded View, then all tags are bidirectionally bound
  • If any tag changes value in the UDT instance, the entire param structure is updated including all tags within it - very inefficient
  • all tags within the UDT instance are bound, regardless if they're actually needed for display or not - very inefficient and will limit your GW scaling
  • I'm sure there are a tonne more...

This is almost as bad as IA's Vision template navigation calling the system.alarm.queryStatus function in the GUI thread... (sorry guys, but this caused major performance issues in my very first Ignition projects)

Pass in a tag path, as Phil has already said, to the UDT instance into the View. You can setup the View's props.dropConfig to pass this automatically when you drag on a UDT instance onto a View.

9 Likes

Thank you very much for the comments, so.. how the tagpath pass thing works? is it like a string thing that passes between views? not sure what or how that should be done.

Thank you again!

Exactly how I showed in my screenshots :slight_smile:

oh I got it now, thank you very much! it will be very useful.

1 Like