FANUC to Rockwell PLC Ethernet Setup and Program Calls

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
all right hello everybody this is Adam with Fanuc robotics again I'm going to do just a quick little video here on talking a little bit about calling programs from a PLC I'm gonna cruise through real quick about getting your your fanuc robot into an Allen Bradley PLC that's not the core of this video but it's something that I want to talk about just in case that's your first step some people are using hardwired 24 volt DC signals some people are using Ethernet signals but in your PLC your compact logics are control logics this is not for the slick 500s or the micro logics but if you have the ethernet capabilities for compact logics and if your robot has the ethernet/ip adapter option you'll cruise right through so what you're gonna do on the PLC side is you're gonna add a generic Ethernet module I have one here called LR mate let me show you when you create one you know I just named it LR mate you put in the address of the robot which I'll show you how to set and then here's the magic the input/output and configuration of the assembly instance for all fanuc it's 101 151 and 100 then this is arbitrary this is whatever you need or want however many words of 16 bits do you want so on the robot side pretty straightforward menu setup post comm tcp/ip on this line here you'll type in the IP address that you want your robot to live on then you'll hit the next key and you'll initialize when you click initialize you'll get a little love note that says port has been initialized successfully then you'll be able to ping the robot ping the controller so that's for the IP again just cruising through this because it's not the topic of this video but then in your i/o and your Ethernet IP you'll see this connection right here going to be true and online if you need to change the size of this you go to your configuration make sure that your words are four and four they should just match whatever you want if you want to and - or you need six or eight or however many you need just make sure that those match and turn that back to true and when it's true you'll see this go on to a running status so that's that's real quick just getting ip's set instances size set what you'll see then is logics will build controller tags for you automatically with the name that you gave it so mine will say LR may input data and it'll have words zero one two three and then within each word there's zero to fifteen so sixteen bits of boolean so one or zero value so I'll have all these you know sixteen times for all its 64 bits of input and you'll see them here 64 bits of output and that's what we'll be using for handshaking program calls passing integer values because in integers right here you see an integer is just a sum of bits so once you have this set up it's all just mapping and it's pretty easy and straightforward the next important thing to note also is when you're setting up your i/o for example my digital inputs you've got digital inputs and outputs user inputs and outputs things like that the one thing that is important here to note is that your config the magic number for Ethernet for Ethernet IPC Ethernet rack 89 slot 1 when you map things to rack 89 it tells the robot to look at either net for the IO some of your robots from the factory will have like maybe it'll say rack 48 that's the onboard IO that's built into LR mates and Skara and things like that so we use different racks for different things in this example I have 8 bits of inputs a track 89 I could have made that 64 since the PLC set to 64 but doesn't really matter um 89 is the magic number for Ethernet if you're not using Ethernet ignore everything I just said so some other general housekeeping things just to really let you know you'll notice in the you op user operator panel screen for our user inputs and user outputs some basic things the robot is trying to tell you am i faulted is the teach pendant enabled or not in my low on battery am i busy but things you need to tell the robot if you're running a robot from a PLC there are four bits that you will always need to hold on it's because they're active low so the immediate stop the hold the safe speed and the enable these UI one two three and eight always have to be on if you want this robot to run if you want to pause your robot from the PLC then you're going to drop the hold signal if you know you make that go low then the robot will pause you make it go high then you got to resend a start signal so always hold those four on then when you want it to run you just pop that start signal for a handful of milliseconds the robot scans at 8 millisecond ITP so you know if you hold it for a quarter second that's way more than long enough so some other things to look at just just so we know how they work and what mean especially as it as it correlates to the user inputs in our system config screen you'll see line 7 enable UI signals this is what I was just talking about the user input signals for hold start/stop reset if you want those to work this better be it true and then if you scroll down in this screen scroll down quite a ways down to the remote and local setup right here remote I'm gonna actually put that at remote remote means hey I'm looking for a PLC to give me my signals local means hey I'm looking at the buttons on my controller cabinet so if you want to start and stop and pause your robot from the controller cabinet you op you use local if you want to use a PLC you use remote so we'll leave that here for now that's something that you want and it does correlate directly to these UI signals and to the mapping that we just said so that's important moving forward a little bit let's let's start jumping into how we're gonna call programs ok so at this point in the game I'm going to just assume that you have set up your d eyes and do s and u eyes and uoz you've got IP addresses talking life is good I'm also gonna assume that maybe you have some programs for me I made some quick dummy little programs that don't do much I made a circle path a horizontal path and a vertical path just some dummy points that I taught so let's assume that you have some programs let's assume you've got your eye peas working now we want to call these programs from your PLC which is the meat and potatoes of this video I'll put the asterisk on this that what I'm about to show is not the end-all perfect golden way to do it it's just a way that I have been really successful in the past customers have been successful in the past people seem to like it what I like to do is go into my setup program select and from the factory you'll probably see these set up as pns the program number select or the RS are run service request I like to set this one as other and the start method you might have seen as you op waiting for someone to hit the green button on the panel I like to set it as other so other and other in order for these changes to take effect you'll have to cycle power on the robot same as when you were configuring your iOS in these configs whenever you change these you have to cycle power to save the changes menu setup program set these to other another cycle power and then we'll come back in here in a minute now I'll show you two good ways that I like to call these programs so let's create a program and I'm gonna call it main ok here's what I like to do and and again if you've got a better way that's totally fine this is just what I like let me put a few lines of code in here a few blank lines of code we're going to first create a loop an infinite loop I can name this something like that and I'm gonna make a jump ok so now we know that when the main program starts is just gonna keep jumping to label one goes to label 1 so so we've got a forever loop right here okay so here's method number one of the two methods I'm going to show you for calling programs let's take a if statement and I'm going to use this very top on this pre-built one and I'm gonna say if digital input number one comes on I want you to call this program horizontal so if you just take a look real quick at what this program is doing its just looping over and over and over and over and over waiting for digital input 1 to come on if digital input 1 never comes on then we never call horizontal and it just keeps waiting and waiting and waiting and waiting in this forever loop so it just sits there and waits let's take that let's copy this logic and let's say paste paste let's expand on our idea here perfect so now we're in this infinite loop waiting for the plc to give me one of three signals and just say hey as soon as I get one of these signals go do that thing so let's test this real quick I'm going to split my display so that we can see the i/os you notice that over here I'm simulating the inputs from the factory they're unstimulated which means they're waiting for a plc well I don't have a plc here in my office so I'm just gonna simulate these and fake it you know you can you can even do some things here too as far as detail you could you can name these you know program 1 you know next point program 2 next point program and you can see now that as I added the comments for program 1 2 & 3 it went right into my code so now my code is self document if digital input one program one comes on tall horizontal now the way fanuc works it's you know like stack programming so if digital input one comes on the robots gonna jump in to horizontal it's gonna run my horizontal path and then it's gonna jump back to where it was so it'll go in do its thing and then come back and then so it's always going to be in this loop or it's gonna be in one of these programs so let's let's test this theory real quick okay so I'm gonna start my my program so right now this is this is what I want you to notice and this is this is kind of nice the robot is ready to pounce it's busy it's running it's in the main program and it's you don't see it looping but it's busy and running it's just waiting for something to happen so if I come in here and just pulse that bit you saw it just pulsed it just went on and then off and it runs the horizontal program let me pull some bit too there's the vertical program pulse it again you can even see on the left of the screen it jumps into the vertical program and jumps back out let's run the circle there it goes run it again now the reason I'm pulsing these is because when you're in an infinite loop it'll just keep running if you maintain the signal from your PLC so on the PLC side if I turn that on and just leave it on it's just gonna keep running that program over and over and over until that signal is gone same here I just leave it on now it's just running vertical off but you can see how when it's called if I just turn it on and off just a little blip of a signal steps right through the program and does its thing so that's pretty easy pretty straightforward that is the first method that I wanted to show you so really really easy right there take a screenshot take it to heart because I'm about to delete it and show you another method so let me delete let me turn on my teach pennant I'm gonna delete all these okay so the next method it's very similar to the first but I'm gonna call it slightly more efficient because in this first way that I showed you it's one digital input per program that you need to run so if you have ten programs you would be chewing up ten digital inputs that's fine if you run an Ethernet because you can set up thousands but if you're running hardwired you can run out real fast so what sometimes I like to do if I have limited numbers of digital inputs available as we start using binary because with binary you know I can use two bits to call up to one two three programs three bits we'll call seven programs and four bits would call up to fifteen programs so I can call a lot more programs by generating combinations of bits but fanuc makes it even easier than that it makes it one step easier let me go get this all on the screen here so if I go to my iOS you'll see one in here called glue a group IO this is group oh I'm gonna go to input group input let's look at the configure this I've mapped group input number one to be rack 89 which you'll remember is Ethernet slot one start one and how many bits do I want all right now I only have it set to two because I only have three programs it's like I can even have a 0 1 a 1 0 or a 1 1 so I'd call it those you know three different programs with just two bits but I set up my group input like this cycle power to save it and again hey right now I gotta have it lady because I don't have a PLC running but I can set my value now let's take a look at what we can do with that in the program I'm gonna make a new miracle register called program r1 and in my main program instead of using the if I'm gonna use the select which is right here select R so I'm gonna say select r1 program and I'm gonna say if the program equals 1 tall horizontal okay then select over here I'm going to use this one the one right below the the main because I'm gonna amend to that I'm gonna say else if it equals to call vertical else if it's a 3 call circle so now I've got this this nice little set up that says hey select based on the R value if it's a 1 call horizontal if it's a to call vertical if it's a 3 called circle the one part that we have to adhere the secret sauce to making this work is a line of code that says register 1 equals because we got to know what register 1 is it's coming from group input number 1 so it's just that simple and I can do some housekeeping here and clean that up a little bit maybe you can even put a space here too so it's easier to read so here's our infinite loop every time our loop starts it's gonna take whatever is in group input 1 and dump it to R 1 so it's gonna update every scan so every scan it's gonna say hey what's the plc sending me put one and then the select statement is going to look at our one and it's going to call the appropriate program so if we go like this I'm going to do a triple screen we're gonna look at our group inputs right here we're gonna look at our registers and what should happen is while this is running I'm gonna simulate a number coming in to GI one we should see it auto populate into r1 and then we should see the robot run the appropriate program should so here we go let's call our main program run it okay so the main program is busy and running it's sitting there there's no value in GI one so the robot doesn't know what to do but let's put a 1 in here and there goes so as it's got a 1 in a one is going to r1 and it's calling that program as soon as I put that back to zero it quits running remember how it's sustained so if I do it too there's my vertical zero put in a three program three zero so again if I was a PLC and I could do it fast I'd pulse it so let me do like a one zero there so I can just pulse it real quick to zero so you send that number just as a quick little quarter second pulse to the robot and it's just gonna take off and run whatever it needs to run so right there that's method number two I'll go ahead and stop the robot now um the the final trick I think I did in fact skip over this so hopefully you you're still watching the video under the program select where you changed these to other and other you remember inside this other there's a detail shall work custom name if I choose main right there then that means whenever the robot sends us the you op4 start the main program will automatically start so remember the plc is already holding on these four important ones whenever it pulses UI six you just have to pulse it UI six is going to send the start signal to this which is defined as detail as main which means it's going to run the main program which puts in the infinite loop which looks at our inputs so hopefully that helps everybody and if you have any more questions feel free to contact fanuc at eight eight eight sanic us or hate but put some notes in the comments section of this video and maybe you'll inspire my next tutorial thanks guys
Info
Channel: Adam Willea
Views: 18,174
Rating: undefined out of 5
Keywords: FANUC Program Call, FANUC PLC, Call Robot Programs, FANUC Call a program, FANUC Ethernet, FANUC Ethernet IP, FANUC Allen Bradley, FANUC Rockwell, FANUC Studio 5000
Id: bkGQ0kCXv8E
Channel Id: undefined
Length: 23min 13sec (1393 seconds)
Published: Tue Jan 28 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.