Alias with a Logix UDT

Home / FactoryTalk Optix / Optix for HMI

Description
Part 3 – Reusable Graphics with an Alias to 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.

This example a Pump UDT consisting of the variables Label, Running, and Speed. are created in the Logix controller. The Logix controller variable are imported into Optix Studio. The Pump_UDT (Type) is then connected to the “PumpInfo” graphic that was originally built in the FactoryTalk Optix Object-Oriented HMI Concepts video.

This is considered as resolving at design time since the reusable graphics are preconfigured in FactoryTalk Optix Studio.

  • Continuation from a previous video where alias resolution at design time was demonstrated in FactoryTalk Optix.
  • The concept of aliases in Optix, which are variable types pointing to a source node, allowing instances of an object to display different values.
  • In this video, UDTs (User Defined Types) from a ControlLogix application are used for aliasing.
  • Demonstrates creating a UDT called “pump UDT” in Studio 5000, mimicking the model for a pump with label, running, and speed parameters.
  • Import the ControlLogix tags and UDTs into Optix and demonstrates updating aliases to point to the UDTs, showcasing how values update dynamically based on the controller’s input.

Contributed by Wayne Welk – YouTubeLinkedInGitHub


Transcript
(00:01) I’m going to pick up from the last video in the last video I showed how to do what I was saying resolving at design time and um to to be able to um to do an alias and I used the model uh objects inside of Optics and that was over here so I’m going to go ahead and close the uh emulator down I created a my pump um object and we converted it to a type and then we were able to uh to reuse that object multiple times and then on each one of these my pumps basically we had uh you know three variables in there label
(00:46) running in speed and then pump one I was able to Define what I want it to be pump two and pump three and then we just uh deployed uh the um the face plate or the base object the widget uh three times and we linked it to the Alias my pump one two and three so um show that in the last video uh what I didn’t show just to kind of um if you haven’t seen this before in the optic Studio be at the desktop or the cloudbased if you hit this question mark here at the top uh brings us to the help file and uh there was a section on Al is and just to the
(01:32) better Define an alias um per the Optics help file an alias is a variable type that points to a source node with a node ID property and this allows you to have instances of an object display different values and if you uh recall we had there was a node ID um you know uh basically there on the Alias we created the Alias the other thing I I would like to show you know since we’re here in the help file is that there is actually actually an alias tutorial which talks about building a motor management dashboard which is kind of similar to
(02:05) what I’m doing here uh but this tutorial basically shows uh doing the the U the model objects like I did in the previous video so what I do this time though is I want to use a logic’s UDT or user defined uh or user data type so back in studio 5000 I went ahead and made a UDT and I just called it pump UDT and I basically mimicked exactly what I did there in the model for for the pump I had a label which is a string I have the running which is a buol and I have a speed which is a reel and then I went ahead and uh
(02:50) created three instances of that UDT and I called it pump one pump two and pump three now this is Studio 5000 and I am connected to uh my logic’s echo emulator so this is actually a running controller right now you can see that I am connected and I am running and I went ahead and put some values in for label running in speed for each one of the pumps so pump one I gave it a label of pump 101a uh right now it’s off and zero speed uh pump two I go called it pump 201-b it’s running at a speed of 75 and pump three is pump
(03:40) 301c uh running at a speed of 45 so I can change these values on the Fly here once once we once we um go into the emulator and and see how it works on Optics so going back to Optics first thing I going to do is I’m not going to actually delete all these instances of the pump info that I’ve already created what I’m want to do is I’m going to um at some point I’m going to change the Alias over from my pump one which was these model objects to the UDT that that we’ll import here in a second so what I’m going to do is being
(04:18) that we’re going to now use a live controller I’m going to come here to com drivers I can also come back here to dashboard and uh do it here in the widget or the wizard I think I’ll go ahead do this this route the other object object uh option is I can right click on Comm drivers and say new ra ethern IP driver but I’ll I’ll use this so I’m going to say New Station going to choose ra ethernet IP the route is the IP address which happens to be the the loot back for the emulator which is the 127.0.
(04:55) 0.1 that’s what’s uh defined here in my object Echo emulated controller and I’m going to hit next now it gives it a name ra ethernet IP station one I’m going to go ahead and call it Echo CPU just to kind of make it a little bit shorter and more um in line with what it actually is so this is where we can import our tags so I’m going to go ahead and do an online import it went out and read the controller tags so these are all that I’ve created so far here so those are those are our uh udts pump one two and three go ahead and select all and say
(05:38) next and then everything’s been successful so we say exit so what I want to show is now that we’ve imported our tags we now have the echo CPU and then under the tags controller tags there’s pump one two and three so there’s label running speed label running speed label running speed but if I come to types also underneath that Echo CPU I I see data types pump UDT and variable types pump UDT and it is actually a type already so I didn’t have to convert it to a type like I did up here when I had to uh do that with my my pump model now
(06:27) I’m going to go ahead I’m going to go ahead and delete uh um this model out just to just so that we don’t have any um just so we don’t uh have any doubt that it’s still reading the old data that I had I’ve already created I’m going to go ahead and create the uh the data type Al together so two things we got to do now um we’re going to come back to our our pump info so this was our base uh widget or face plate that we created and if I click on this I had already made an alias right I I had hit the add new in the previous
(07:13) video and I said add an alias and I called the Alias my pump Alias so that that I’m not changing oops that I’m not going to change so the Alias has already created and it’s called my pump Alias and that’s good when I’m going to change is the the kind so it got unresolved since I deleted the model uh here a second ago so when I say kind I’m going to come down now to com drivers the ra ethernet IP Echo CPU types and the pump UDT type and then since I kind of set this up uh nicely I don’t have to actually change change the um any of the the definitions
(08:04) down here for the three things that we were doing we had a label we had the Speed and we had the pump running indicator and we didn’t we weren’t using these two um onoff switches for this example so for the label uh it’s still my pump Alias and it’s just tied to the label uh for the speed it’s my pump Alias and it’s tied to the speed and for the running it’s tied to my pump Alias running so when I created my UDT in the logixs controller I kept all those names the same now coming back to our pump one screen so here’s where I had the three
(08:43) instances pump one pump two and pump three so since I deleted the the model there now this shows us unresolved so for my pump Alias I’m going to just bring this down to uh my controller com drivers once again and choose pump one for pump two we’ll do the same thing go down here to uh com drivers tags controller tags pump two and last ly for pump 3 instance we will do the same thing now remember that in this example
(09:47) we’re doing what’s called resolving at design time meaning that I’m I’m hard setting this in the configuration here in design time um still need to show how we can do this dynamically by indexing but I’m going to just do it this way uh for this video so that’s that’s it um again I I set a lot of the pre-work up in the previous video as far as you know defining all these um you know objects that are on the U each on the widget and and kind of linking them so that was kind of done already but I just had to reink these to these um to the new
(10:30) uh to the new udts that were that were imported in so go ahead and save this and now we just we’ll go to the emulator so here we are emulator is up and we’re we passed in from the udts just like uh just like we set up so uh the label is reading the label from the UDT uh it’s not running to the speed is zero the uh pump 2 201-b 75 and running and pump 3 is 301- C it’s about 45 and running now being that I am now connected to my uh logic controller if I change this value we see that it changed right there in the
(11:23) controller and if I change this value we see a change in the controller so so definitely UDT uh bringing that in and porting and then we can we can uh pass those into each one of these widgets face plates like this so pretty easy way to go so again uh like I said this was resolving at design time meaning that I obviously set all this up in the in the application itself and then once it’s deployed it’s kind of set um our our next video in this sequence will be how can we actually index those udts and maybe use one widget and just
(12:10) say okay and this this time we open up the widget let’s choose pump one let’s index at the pump one uh next time you know we could maybe choose what’s index at the pump two and Etc so we’ll dynamically change that and that will be what we’ll call resolving at runtime