Description

Learn how to change the template path of an instance on a window dynamically.

Video recorded using: Ignition 8.1

Transcript

(open in window)

[00:00] Whenever you drag a template onto a window you are dragging a template holder or a template instance onto the window. My vision window here has various template instances. I can select any of them and I will see a property named template path in the property editor. The template path property allows us to point this template instance to any template this project has access to from the designer. It is possible to make this path dynamic, meaning that you can bind it to something to change this template path on the fly. My dropdown menu here on the right has three selections associated with it, motor, scale, and valve. Putting my designer in preview mode using the F5 shortcut, I can click on my dropdown and see my same list. Every time I select something different, the dropdown menu exposes my selection in the form of the selected string value property. I have chosen these options in my dropdown for a reason.

[01:01] These are actually the paths to all three templates here. If I select one of my template instances I'm binding this path property to my dropdown selected string value property like this. Any template I select from my dropdown will be displayed for this template instance. You have to be careful when doing this. Generally, different template definitions will have different parameter names. Changing between templates like we are doing here can and will change the template parameters exposed in your template instances properties. As we saw here, a template instance can be used as a template container to display any template you want using its template path property. This functionality adds even further versatility to templates in ignition.

You are editing this transcript.

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