Build a Faceplate

Home / FactoryTalk Optix / Optix for HMI

Description
This video walks you through the steps to create a reusable faceplate in FactoryTalk Optix using an alias to a Logix User-Defined Data Type (UDT). This walk through starts from an empty Optix Studio application to show all of the steps to create the communications driver, import the controller tags, create the faceplate, add an alias, link the alias to the UDT type, and then create multiple instances of the faceplate for each UDT.


Transcript
(00:02) so this video I want to show how we can take a logic’s UDT bring it into Optics and then kind of assign it to a reusable graphic like a face plate or widget um over and over again or use the same face plate and then assign multiple uh udts to that pH plate so we can reuse the pH plate over over again but then give it a different UDT each time and we’ll do that by creating an alias and then um assigning the um the UDT type to that Alias so um so in the previous video I kind of created the reusable object um and just showed how we could build a
(00:51) reusable object and then use multiple instances of that object and if I made a change to the base object it would permeate to all the instances that were created what I didn’t show in that video was how would you go about assigning um a tag perhaps as an alias to those objects so first off what we’ll do is we’ll come back to Studio 5000 and I’ve gone ahead and created a userdefined data type and the example we’ll use here is we’re going to make a pump kind of face plate or pump widget whatever you want to call it and we’re going to
(01:29) basically have have the same tag structure for each of the pumps that we we have in our system and then when we make our little pump face plate and Optics these common tags will get sent into to each instance of that uh face plate so to keep it simple as an example um our pump UDT that I’ve created has three tags in it uh one called label which is a string one called Running which is a bull or Boolean and one called speed which is a real uh data type so since I’ve already created this ahead of time I’ve created three UDT
(02:13) instances in the in the Logics controller basically pumps one pump two pump three each one has the label running in speed and I’ve gone ahead and put some values in each of these just so that we could see those numbers come into um into Optics now I also have this running I got it connected to my factor to Logics Echo emulated controller I have I have a CPU called Echo CPU and it’s tied to the loopback IP address 127.0.
(02:51) 0.1 so when we go to Optics now we’ll be able to actually pull live data from a emulated running control objects CPU so we’re in our project it’s a it’s a blank pro project nothing’s been uh preconfigured here in Optics um so the first thing we’re going to do is we want to configure our Communications to that logic controller I’ve got two ways to do that I can come to Comm drivers right click say new and then I can choose ra for Rockwell Automation ethern IP driver or if I’m at my dashboard I can choose the wizard to configure Communications to a device we’ll say New
(03:36) Station make sure we choose our a ethernet IP station let’s say next the route will be the IP address which is the IP address of my logic Echo emulator and for name I can rename it I’m going to go ahead and name it Echo CPU just to kind of shorten it and make it uh something that is more recognizable say next now I have the choices to import my tags I can either do them offline by connecting to the ACD file or I could choose online and actually connect to the real running controller and pull the the tags out of the controller so we are
(04:23) connected it found the controller tags the pump one UDT pump two and pump 3 and if I were to expand these we see that all the uh sub tags are all there I’m going to go ahead and choose select all and say next so that has successfully been uh imported so I’m going to go ahead and choose exit now once that is done we now have uh our structure underneath the com drivers there’s our driver there’s our station and here are our tags so we have controller tags pumps one two and three and each one of these has label running in speed also
(05:10) imported but then I want to show that if we go to the types folder we now have two folders here called data types and variable types data types we see pump UDT but if I go to variable types I see pump UDT and I see in parentheses the word type and then if I expand that I see label running in speed so the UDT already came in as a type in Optics and we’ll be able to use that uh in our Alias that we create to be uh to use in our face PL so next is we’re going to come up here to UI and right now all we have is a main window and the main window is a
(05:53) blank screen but what I want to do is I want to create an object that I can reuse a reusable object um so I’m going to create a folder under UI to kind of store that that object so I’m going to go ahead and say I’m going to right click and say new and folder now in a previous video I called this base objects I could call it widgets I can call it face plates um call it whatever you want um since I’ve been using the term face plates and that’s consistent with some other Rockwell HMI um tools I’ll I’ll go ahead and use the word face plates here
(06:41) doesn’t really matter what we call this folder so now under face plates I’m going to say I’m going to right click and say new I’m going to say containers and I’m going to say panel and it’s called panel one I’m going to go ahead and rename this to um pump uh face plate could probably come with something short of that but we’ll just use that I’m going to double click on this because now this opens up the the pump face plate itself so it defaults a 300×300 uh height and width I can stretch this and make it a little
(07:24) skinnier or whatever we’re going to uh maybe I’ll go with about uh well we’ll stick with this size I think so if we recall we have three things we want to show on our on our um pump face plate essentially one is the label one is the if it’s running and one is the speed so right click on my uh pump face plate type here and we’ll say new base controls and a label and we’ll kind of put that here at the top right click click new base controls uh I’ll use an LED to indicate if it’s running or not and one more will be rightclick new
(08:12) base controls and let’s use a circular gauge this time and at the moment um I can rearrange all this however I want um just kind of get it maybe put the LED go ahead and put this to the back so I can do that all right so what we’ll do now is we have our click on the pump face plate kind of the top part here itself and I’m going to go ahead and hit this plus symbol here this is the properties of the uh of the whole face plate itself or the object I’m going to say new Alias so it come it creates an alias here called Alias one now I’m going to
(09:17) rename this to uh to pump Alias node ID will leave alone and the kind we will assign to the com drivers Echo CPU types variable types pump UDT type so now we can come to each of these actual elements that I put inside of the um inside of the face plate and first is the label so the label right now the text is saying label one we’re going to go ahead and assign this text to label now what I uh what I didn’t explain is when I said kind that kind of acted as a filter so so when I did this
(10:24) um when I when I put it to the pump UDT uh type it now let’s it kind of filters down on aliases and it sees pump UDT and then here are the three variables are for three tags that are in that UDT so I’m going to assign it to label for my uh gauge I’m going to come to value and I’m going to go to aliases pump Alias I’m going to assign it the speed and for my LED or my uh onoff indicator I’m going to um come here to active and come to Alias and choose running okay so I created an alias and now I’ve created and I’ve now linked the
(11:24) the uh the three objects that I put on this face plate to the Alias uh tags the structure so now I got to do is um we come back to our main window and now I can right click and say new and now I have a folder here called face plates or or a menu item called face plates and I could say pump face plate so there’s the my first face plate I can right click say new face plate and there is a second face plate and I’m going to do one more face plates pump face plate so now I got my pumps one two and three and it looks like I probably should have made
(12:20) my uh face plates a little skinnier but we can stretch the window out that way so all we got to do next is we have pumps one two and three so now we come here to pump Alias so I’m at the properties of this pump face plate one come the pump Alias set the Alias and this time I’m going to set it to the com driver tags controller tags and just going to choose the pump one that the uh kind of the root level there I’m going to come to pump face plate 2 I’m going do the same thing come down to com drivers tags controller tags pump
(13:18) two and then for this one pump three of course we come down do the same thing com drivers tags pump three and that’s it I’m going to go ahead and save this that’s all I got to do I’m going to go ahead and start the emulator the emulator opens in the other window so here we are face plates one two and three so if we recall if we come back to our studio 5000 application we’ll see that um I had pump one label as pump 101-a and pump two was 201-b and pump 3 was 301- C and then um pump one was off and had zero speed pump uh 2011 was like
(14:19) 41.3 and and on and pump 3 was on and about 72.4 now if I go ahead and change this value here on the screen we see the number actually changed back here in the controller so same thing with pump two if I were to actually type a value in here like 25 you can see now that it it updated on the face plate as well so so I could actually write from here down to the controller or I of course can read from the controller dynamically so that’s all that we had to do we created U you we created udts we brought those into optic
(14:59) then I created a face plate then I created an alias linking back to that UDT type and then I was quickly able to um to reuse this object and just assign it to to the uh to the right UDT for the each pump now this is what is kind of called U resolving that design time meaning that everything I’ve done as you just saw I can configured in Optics while designing and then once we go into the Run mode you know all that configuration um gets used in the runtime so pretty much was pre-planned and preconfigured that’s what we mean by
(15:44) resolving at design time so the the the other method we can do here is what we’ll call resolve it at run time where I will be able to use the index or an index to choose which set of pump data would I want to bring into the face flate each time so so that’ll be um resolving at runtime so to speak and that’ll be done with the index so we’ll show that in a in another video