|AutomationDirect Live Chat|
Understand the big picture before delving into the details of using EtherNet/IP on the Productivity Series Controllers.
In this video let’s pretend we have a Productivity 3000 running an 8 lane candy bar wrapping machine with 4 lanes operational and another 4 lanes set aside for future use. The Productivty 3000 keeps track of the number of rejects on each lane, controls each lane and has an Ethernet connection. We want this Productivity 3000 to monitor the number of rejects on each lane and have the ability to control each lane from a remote location. And we don’t want to have to explicitly ask for that information – we just want it to appear here on this Productivity 3000 so we can watch and control it in real time without any hassle. Well, that’s just the Implicit or IO messaging of the EtherNet/IP standard – right? Where data is simply exchanged between these two automatically in the background. All we have to do is set this guy up as an Ethernet IP Adapter like we did in the Adapter video and set this guy up as a Scanner – which is the focus of this video. Let’s get started. Go ahead and launch the Productivity Suite Software. Make sure the software version is at least the 184.108.40.206. Also make sure your firmware is up to date. Go to PAC, check upgrade firmware and verify that your CPU firmware is at least this 220.127.116.11. Let’s see, we’ve already started a new project and connected with and configured the Productivity 3000 using the autodetect under hardware configuration. We’re on-line, we’re running, and we are ready to go. Since we are setting this Productivity 3000 up as a Scanner to monitor external hardware, you would expect to find the scanner setup under hardware configuration – and sure enough there it is right there under the EtherNet/IP tab. This is where we setup the scanner. To get started, we just grab a generic client and drop it over here on the screen. It’s a generic client at this point because we haven’t set it up to talk to a specific device yet. Well, to setup the scanner, we just fill in the blanks. We need to give it a name. We’re talking to our Candy Bar Wrapping machine so I’ll call it CBW Scanner. Here we insert the IP address of that machine. Not our current local machine, but of that candy bar wrapping machine, which I happen to know is that number right there. Let’s create some tags so we can monitor the status of the connection with the Adapter. We’ll call these Candy Bar Wrapper Connected, Candy Bar Wrapper _Name, Candy Bar Wrapper _VendorID, and Candy Bar Wrapper TCP Error. For this video, the Candy Bar Wrapper Productivity 3000 is very similar to the one we setup in the adapter video. Here is the dialog from that unit. I’m going to keep it on the screen so we can keep an eye on it. But just as a refresher, we had one data block, with an input and an output data, we had an array to keep track of the lane rejects, and an array that would allow us to control each individual lane. On the previous video these arrays were like – oh I don’t know – 32 elements large. In this video we set both arrays to be eight elements one for each lane of the eight lanes of the candy bar wrapping machine. And since only four of the lanes are active, instead of sending that whole array back and forth, we limited the amount of data to send back and forth to just four lanes to save bandwidth. Again, that was the Adapter. Our job in this video is to setup the scanner. Ok, I’ve rearranged the screen a little bit so we can see the adapter and the scanner dialog at the same time, because we are going to need some of these parameters over here in the scanner dialog. Ok, so far we have given it a name and IP Address, and created some tags so we can monitor the status of the connection with the Adapter. This plus sign is where we choose the type of connected messaging we want. In the overview video we said we could do connected messaging via Explicit TCP/IP or Implicit UDP. In this video we are setting up a scanner to do Implicit UDP, so we’ll choose that one and now we have a few more blanks to fill in to setup the connection. The Enable – this is a bit you’ll set in your ladder logic to enable the scanner. So we’ll call that CBW_Enable. I’m going to go ahead and fill in these TAGs over here so we can monitor the status of the Scanner. And once that’s done, all we have to do is configure the messaging from the Target to the Originator – that’s from the candy bar wrapper machine TO us – so that’s OUR input. And from the originator to the Target. That’s us to the candy bar wrapping machine which is our output. For the data coming to us, we want that to be delivered by the adapter in a unicast - just to us. The interval between messages is currently set to 250 milli-seconds – that’s four times a second – that’s plenty, I’ll leave that alone. This connection point – we take that straight from the adapter. Again, this is the input data, so we go to the input block, and we see that our connection point is a 101. So that’s the number we put right here. We need to create a data array for the results to be put in. I like to use the same name as the data array that’s down on the adapter so there is no confusion. So this would be my Lane_Rejects. Well, as soon as I click away from that, the software comes up with a dialog that says “Hey, you haven’t defined that Lane_Rejects array yet, what do you want to do with that? Well, I want that to be identical to the array down here on the adapter. That was an unsigned integer 16, so I grab unsigned integer 16. I remember that he was 8 elements large. So I make my columns 8. Easy. So again, Unicast, 4 messages per second, connection point came straight from the adapter, I created a new array which looks just like the array down on the adapter, and all I have to do now is say how many elements do I expect? Well, I know the adapter is sending 4, so I put a 4 here. And you can see the dialog is telling me that means 8 bytes will be sent because those were 16 bit elements. Again, this was the data going from the adapter – the candy bar wrapping machine – to us. To get the data in the other direction, we click on this tab and do the same thing. The timing between messages is four per second – every 250 milli-seconds. Note that this is completely independent from the input data. I could change this rate to anything I want. The connection point for the output data, is this guy right here – 102 – so I put that in here. I need to create a new data array. Again, I’ll call it the same thing I called it down on the adapter. And when I click away, the software reminds me I haven’t created that array yet and says “what do you want?” Well, it looks like I want an 8 bit unsigned. Let’s go grab one of those. And we know we have 8 lanes so we’ll put an 8 right there. Great, the array is defined, its 8 bit unsigned, 8 bit unsigned. Perfect. Now again, only four of the lanes are operational, so let’s put a 4 right here so that it matches the number of elements the adapter is expecting. Since these were a byte wide that means we are only sending 4 bytes. Here’s a key point. This little checkbox that says include status header. Some Adapters require a status header, some don’t. The Productivity 3000 Adapter DOES so we need to check that box. Now, here’s a trick. Suppose you are setting up a scanner with some other hardware and it doesn’t have this header box. How would you tell it to send the extra four bytes for the productivity 3000 Adapter? Well, that’s easy, you just add 4 to this. Now we’re sending a total of 8 bytes down to the adapter which is what it expects. We don’t need to do that here, so let me change it back and add my header in. So this number plus 4 bytes here is the actual size of the data that is being set down to the Productivity 3000 Adapter. The Productivity 3000 adapter doesn’t require configuration data so I’m going to turn that off. But beware that a lot of devices do. Some of them will require configuration data even if it is zero length so take a look at the data sheet of the device you are talking to before you set that up. When we hit OK, the software says “Hey, you haven’t defined all these tags yet would you like to do that now?” I love that because I don’t have to pre-define all my tags when I’m setting these things up. These all look great with one exception. The Strings default to 15 characters. I prefer to make those strings long. That way I can handle pretty much anything that comes down the line. So give me just a second here while I modify these. And we are good to go. Let’s do one more thing. I want to drop back down into this candy bar scanner, and hit this Monitor button. What that will do is take all of these status tags and create a new tab in the data view for me. We’ll label that tab “Candy Bar Wrapper Scanner.” Excellent. Could I add more scanners to talk to other devices? Sure. I just grab more generic clients, drop ‘em in here and fill in the blanks. I could add one for an encoder. I could add one for remote IO. I could add one to control a VFD. You can have up to 32 of these. We don’t need any right now, so I am just going to cancel out of this. Well, that’ all there is to it. Go to the Ethernet/IP tab, drop a generic client in, fill in the blanks so that it matches the adapter you have setup, and you are ready to go. All we have to do now is transfer this down to the PLC. Great. The Transfer is done. I’m on line and I’m running. Notice I have no ladder code yet – this is all being done in the background. Let’s take a look at those tags we created with the dataview. Go to our candy bar wrapper scanner. There’s all those tags we created and there’s our lane rejects and our lane control. So if I open Lane Rejects I can see them right here. That’s my dataview for my Scanner. Here’s the dataview for my Adapter. The Scanner isn’t running until you enable it. Remember – we created that Tag that said Candy Bar Wrapper Enable. If I click on that and write it out, then sure enough, my candy bar wrapper is connected to the scanner, and I was successful at establishing communications with that Adapter. So right now data is being transferred between the adapter and the scanner in the background without me doing anything! If I bring up the dataview from the Adapter from the candy bar wrapping machine, and I change Lane Rejects to some other number and write that out, then that result is reflected all the way over here in the scanner automatically in the background. Let me do that again. Keep an eye on this number right here. If I change this number to something else – let’s say our rejects went down today … boom … that number gets automatically transferred to the scanner in the background. How sweet is that? We don’t have to do anything. The Scanner can simply watch that number and react to it accordingly. It doesn’t have to explicitly request it from the adapter. Lane Control is the exact same thing, except now that goes in the other directions, right? In lane control we would put a new number in here. Write that out. And when we do that, it automatically appears down here at the adapter. Again, we didn’t have to do anything. That’s the beauty of using this I/O – or Implicit – Ethernet/IP messaging. This is great for real time monitoring Ethernet/IP encoders, Ethernet/IP VFDs, EtherNet/IP remote IO, and other controllers that adhere to the Ethernet/IP standard. And the Productivity 3000 makes it so easy. All we did was configure the hardware by dragging a generic client in here, and fill in the blanks. Then in our ladder code all we have to do is enable our scanner by toggling this Boolean value right here. And then we can go check that we actually are connected and that the connection was successful. Given that, we just drop that into the arrays and it gets transferred between the scanner and the adapter in the background automatically. How about that? Check out the other videos for specific examples of Ethernet IP encoders, VFDs, and remote IO to see more tips and tricks for using Ethernet IP on the Productivity Series Controllers. If you need help, contact AutomationDirect’s FREE award winning tech support during regular business hours – they will be happy to help you. Also, check out the forums – there are lots of folks there that love to share their years of experience – just don’t post any questions directed at AutomationDirects tech support there – they may not see it. Performance plus Value – that’s productivity. From Automation Direct