Dynamic Alias Index with Logix UDT

Home / FactoryTalk Optix / Optix for HMI

Description
Part 4 – Using a Dynamic Alias Index to Create a Faceplate with Logix UDTs

Continuing on from the FactoryTalk Optix Object Oriented HMI concept tutorials, this video shows how to use a Logix UDT as an alias to pass the desired variables into the reusable graphic object using an index as a dynamic link.

In the previous video, we set up a Logix UDT and created an alias to assign each pump faceplate instance to a pump UDT instance. This video shows how to dynamically change the alias index to use just one pump faceplate instance and choose which pump UDT instance to display in the faceplate.

This is considered as resolving at runtime.

  • The video demonstrates using aliases and UDTs from a logic controller to create face plates for pumps.
  • Initially, the setup was resolving at design time, with aliases connecting each face plate to specific pump UDTs.
  • This video now explores resolving at runtime, allowing dynamic selection of which pump to display during operation.
  • To achieve this, modify the alias by enclosing the pump number in curly braces, indicating it will be resolved at runtime.
  • A simple spin box is used to control the alias to dynamically change the pump index during operation, enabling real-time visualization of different pump data.

Transcript
(00:01) so continuing on from the last video the last video I showed how we could use an alias and I was I brought in a UDT from a logic controller and then uh created a face plate I called it pump face plate and then I created multiple inces of the face plate and then just um used the Alias to to bring uh each of the udts for pump one two and three into each face plate and I head said that that was resolving at design time meaning that everything I did was configured in design time and uh just to refresh down here we had our com drivers uh under our
(00:46) Echo emulator CPU I had my uh controller tags which were my three pump udts and then I had these um this variable type called pump UDT that got created when I imported the tags and and then uh back here in my studio 5000 these were my controller tags again I created a UDT and had pump one two and three and I’d G it given it some some data in each of these tags for each pump so what I wanted to show next was kind of one of the methods we could do is resolving at runtime meaning that we could choose um the index so to speak as to
(01:28) which uh motor or I’m sorry which pump we’d want to show um during runtime so it’s actually pretty simple to do since I’ve already set up the structure of the Alias right so let me go back to my um remember I created a uh we go back up to the top here I created a folder under UI called face plates and I had my pump face plate here right so that’s kind of my base object the the face plate and um basically what we have here was I I essentially had uh given it an alias created an alias and then I had the kind pointing to the pump
(02:13) UDT uh type that got imported in from the loges controller so I don’t have to don’t have to change anything in this face plate so I’m going to go back to the main window and this is where I had created three instances of that face plate so I had face plate one two and three and in each case I basically said okay instance one you’re tied to pump one pH uh instance two you’re tied to pump two instance three you’re tied to pump three so I’m going to do now is I’m going to go ahead and delete two of these instances and uh we’re just going to use
(02:53) one instance and I’m going to use an index to basically change dynamically while in runtime what I want to show so to do this is actually pretty simple um all I got to really do up here is come to my pump Alas and I’m going to basically put the curly braces around that number there and hit enter now when that happens you might get a uh little exclamation point in there and it might be saying something like hey this this can’t be resolved until runtime and that’s okay so we’re going to leave this just like it is now
(03:43) for this to work we need to give it some sort of link to choose what the index is so this could be a tag um from a controller or whatever but what I’m going to do is I’m going to just use a little spin box they call it so one of the one of the uh objects base controls is a spin box and this is just a simple little um little box where I can kind of you know toggle up toggle down a numerical value so uh we can set a minimum and a maximum and since I’ve only got three instances I’m going to go ahead and set my Min and Max to three so we don’t seed
(04:31) um our pump instances and then the value of course right now is zero so that’s okay so now back when I come back to here I click on my uh pump face plate and I got my uh my uh pump Alias with the curly braces now I come back to to the um come back to the dynamic link and for this link here I’m going to go ahead and tie it to that spin box I just created so to find that that we need to go back to the main window scroll down a little bit and we will find a spin box I’m going to expand that and the value I’m I’m going to tie it to the
(05:10) value of the spin box and I’m going to say okay so that’s pretty much it so I’m going to go ahead and uh go ahead and save this and I’m going to go ahead and open up the emulator all right so uh here’s the here’s our emulator I’m going to tie it to one so when I when I went to uh index one I got pump 101 and it’s off and zero speed and if I go ahead and bring my uh logic’s Studio 5000 um tags back open again we’ll watch that these will all match so now when I uh choose index 2 it changed it to pump 201-b it changed the
(06:00) speed to 55 and it’s showing it’s running and if I go to pump three it changed the label to 301c uh it’s running and about 25 so that’s just an index pretty simple it did require to do all the pre-work that I did in the previous video and then just simply changing the uh the Alias with the with the curly brace and then of course tying um you know to some sort of Dynamic Linked In order to know what which the index value is