Description

Learn how to embed templates inside of other templates.

Video recorded using: Ignition 8.1

Transcript

(open in window)

[00:00] In previous lessons we showed how templates can be used to gracefully repeat graphics across vision projects. We covered how to define a template and how to create instances of a template definition. It is also possible to nest templates inside other templates. Here for example, I have a tank template instance that shows me my tank's level and temperature. The LED display showing the temperature looks a bit basic, so I will change it to show its temperature using my gauge template here. To do this, I will double click on my tank template instance to bring up its definition. Once my template definition opens I will make it a bit larger to accommodate for the new gauge I want to put in here. I will simply drag my temperature gauge template in like I would any component from my vision component pallet. I will now resize my template to get rid of any empty space.

[00:59] Since I want my new gauge here to show the same temperature value my LED was displaying, I have to make sure that it's temp property is bound to the same thing my LED display is bound to. In this case, my LED display is bound to a template parameter named temperature. So I will bind my new gauges temp property value to this same template parameter like this. I can then delete my LED display and save my changes. Now if I go back to my vision window you will see my two template instances now showing my tank temperature using my gauge template. Nesting templates like this is common practice in Ignition. Users will often nest templates several layers deep. It is important to note, however, that as templates become more and more nested, they also become more and more complex, which can make working with them difficult. Ignition's ability to nest templates gives users infinite possibilities for custom template creation.

You are editing this transcript.

Make any corrections to improve this transcript. We'll review any changes before posting them.