Link Pushbutton to a Logix Tag

Home / FactoryTalk Optix / Optix for HMI

Description
Learn how to create a default FactoryTalk Optix application, and connect it to a Logix controller (Logix Echo in this demonstration). Then how to build basic pushbuttons in FactoryTalk Optix to interact with the Logix controller using the Mouse Click, Mouse Down and Mouse Up button events.


Transcript
(00:02) in this video I want to show how we can get started with Factory talk Optics the new HMI platform from Rockwell Automation how will tie Optics to a Logix controller in this case I’m going to be using Logix Echo the emulator for the 5580 controllers and then show the relationship of the push button object to how it works in logics it’s a little bit different from USC and viewme so we’ll kind of highlight those two um well the differences and how we would set that up so to get started with Optics once we open up our Optics Studio
(00:45) we have kind of two options now for a new project either default or an Optics panel so default will basically be uh like a clean slate project and one that would probably run on a on a Windows platform whereas if we chose Optics panel then that would be kind of specially suited to run on the the new Optics panels which are basically embedded panel Mount integrated display Optics runtime panels ready to go so we hit default we give it a we give it a new name in this case we’ll just call it uh Optics objects test give it your default
(01:33) location where to store it and then as we come down here into our set main window size we can set some preset um resolutions uh 1280 by 800 1280 by 1024 Etc I’m going to do 1280 by 800 I guess probably good enough and I’ll hit create so now we’re inside of the project we’re inside of the optic Studio we can now develop our application so kind of two things we’ll show here one we need to set our com driver to tie it to our Logix controller and then two we’ll go to Just create a simple screen and put some push button objects on there and
(02:24) and watch it the interface just to show you in the background I do have a Logix controller kind of already pre-built with a simple two simple rungs we’ll have like one rung kind of a start one to start a line one and then a start two to start a line two simple latch circuit and this is running in our Logix Echo emulator as well just to show you that this is running inside of a logic simulator at 127.0.
(03:05) 0.1 so let’s first do our com driver so we could do it one of two ways we can either come here to the menu tree that the navigation we can right click on com drivers say new choose Rockwell ethernet IP driver or there’s some pre kind of there’s some Wizards that we can choose to go with and we could say configure Communications to devices so we choose the wizard it does make life a little bit simpler we can say New Station we’ll choose that it is a ra for Rockwell Automation ethernet IP station hit next and then the route basically be
(03:43) our IP address again that’s the IP address of my Logix Echo emulator I can give it a new name here um so I can call it the echoes CPU or something that that makes more sense to me um after I do that I have the choice of browsing for my tags either offline or online if I did offline then I can come to my desktop and find my ACD file and uh and it’ll open it up and find the tags or if I choose online it will actually import the tags right outside of the controller so once again since I’m using the emulator it sees the live controller and
(04:40) sees all the tags so I’m gonna go ahead and just choose them all and hit next so now you can see we have our Old Triangle we explode that out so here’s our ra ethernet IP driver one and our objects our Echo CPU device and then here are our controller tags that we just imported so we have our tags set up we have our communication path set up so we’re now ready to build some build a screen and Link some objects to it so if we come back up here to UI for user interface we have our main window so if I double click on Main window
(05:24) it’ll open up uh the canvas that I can now edit in being that I chose the pre-default resolution of 1280×800 and it’s showing right here but I can of course change this um if I want to now should be said that this is kind of the main window uh when you do the Optics labs and and demos basically what happens is we’ll kind of create this main window and then we’ll create pages and usually those act as containers that would kind of go inside of this main window it’s kind of you know so we can create separate pages as
(06:03) containers and just kind of open up each page as a you know in the container in this case for this demonstration I’m just going to stick with the main window not create any of those pages or containers just to kind of show real quick how the push buttons work so going back to my program I’ve got a simple latch circuit again with a start and a stop so I’m going to create a push button that works to start this and to stop it and want to create another set of push buttons to start and stop the the line two difference is I’m gonna I’m gonna use
(06:38) the the the different ways to um to control the button or different actions on the button so to do a button first off to add a button we are going to go to main window here right click say new say base controls and add a button notice that we do have plenty of other options here we have text boxes labels spin box LED switch checkbox option box linear gauge circular circular gauge Etc so I’m going to choose button and I’m just going to kind of move it down a little bit and make a little bit bigger here for us and I’m going to go ahead and put a I’m
(07:25) going to go right click again I’m going to put a new base control and put a label I’m going to put a label over this button and I’m going to call this um Mouse click toggle now when I do this the properties for this object this label come over here so I can scroll down a little bit I can change the font color I can change the alignments in the word wrapping and the font and size I’m going to go ahead and change the weight to be bold just to kind of bold this a little bit I’m going to click on this button and just like the properties for the
(08:13) label the properties for the button now show up um so we have the appearance we have the size and the text and font so right now the label on the button is button one I’m going to change this to start line one I could also change this font weight to a bowl just to kind of make it stand out a bit more and as far as the action goes or the events we have three to choose from down here we have Mouse click event Mouse down event and a mouse up event so in this first example I want to show you the mouse click event so we’re going to
(08:56) hit the plus symbol here to add a new method we add a new method we’re going to choose commands variable commands and toggle so our choices are increment value set bit value set variable value toggle and toggle bit now toggle bit might seem like that’s the one we want to do but we’re actually going to choose to toggle after I do that down here we have our input arguments and we have our variable to modify so when I choose the variable to modify I get a little select node button I can pick that and this lets me scroll
(09:41) through my throughout my entire project and if I were to scroll down far enough I come to com drivers ra ethernet Echo tags controller tags and here are my tags that I’ve imported earlier I’m going to choose start one and say select now I’m gonna right click I’m going to say copy and then I’ll say paste I’m just going to paste this as a second button I’m going to basically just change this real quick to say stop line one and then I’m going to change my variable to be stop one so I got a push button now to start and
(10:36) to stop the line now to test this out I can start the emulator so to start the emulator right now we have our the we have our method of of deploying this as emulator we could we could deploy it locally or remotely as a runtime I’m going to go with emulator I’m going to hit the start button here and our emulator will open up this will allow me to look at the button and how it behaves so here’s my emulator window I’ve sized it down a little bit just to make it easier to see so I’m going to bring back my my Logix
(11:20) program get the emulator back open again and what I want to show you is what happens here on on this rung zero in the start so this is a mouse click and it’s a toggle so when we choose this option when I press start line one and I’ve taken my mouse off I’ve already clicked it once took my finger off the mouse this bit has toggled and stayed on it is literally toggled um I have to Mouse click it again in order to toggle It Off and if I want to stop the line I click it I’ve moved my mouse off of it I have to click it again
(12:04) to set it back to the way it was so again if I click it then it toggles the bit on click it again toggles a bit off click it click it all right so our other set of buttons that we can choose will be the uh the events of click on the mouse up and mouse down so I want to highlight all this I’m going to say copy and paste this time I’m going to change the label to say Mouse down up toggle just so we can kind of keep up with what each one does I’m going to come to the start line one first thing I’m going to do is I’m going
(12:57) to change this to now be line two I’ll go ahead and uh change my label on this stop Button as well to line two actually what I should probably do is uh go ahead and delete that and we’ll copy once I build this so I’m going to go ahead and come to this mouse click event since I had copied it I’m going to delete the method now I’m going to come to my mouse down and mouse up events I’m going to add a mouse down event command variable toggle and I’m going to link it to the variable and I have to scroll back down again
(13:44) to my com drivers ra ethernet Echo tags controller tags and this I’m going to choose start to but I also need to create a mouse up event because for this to work when I click my mouse down it’s going to toggle but then when I click up or uh then it’s going to also toggle so that way it’ll become a true momentary push button uh when I do this so I’m also going to choose for the mouse up event the method was toggled just like before and I’m going to choose the exact same variable or tag to be controlled here so ethernet Echo
(14:36) tags controller start to now since I’ve already uh did most of that work there I’m going to copy this and paste it this time I got I’m going to just change the the uh the label to stop wanting to and if I come back down here to the mouse down and mouse up events I’m going to change my variable to stop to and change this variable to stop to as well okay so uh so now I have my other one built around this mouse up and down action so I’m going to start the emulator back again I’ll bring the emulator back over here
(15:39) we’ll open up open up the logics so now just like before when I when I click on the mouse click toggle it stays as a as kind of a maintained it’s been toggled but now when I do my mouse up down toggle when I click it’s on but when I took my mouse finger up the mouse it went off so click on Mouse down Mouse up Mouse down Mouse up whereas again here I click it and it’s a maintained toggle here Mouse down I just took my finger off the mouse Mouse down Mouse up so essentially if we want to do a maintained type push button we’re
(16:35) going to use this mouse click and we can toggle it and if we want to do a a true kind of momentary push button and we’re going to have to build this the event around both the mouse down and mouse up toggle in order to do that