Home store site map
Bookmark and Share
Video - EtherNet/IP Explicit Unconnected Messaging with PowerFlex40 Drive


Video Transcript:

In the Explicit Un-Connected primer video we saw that when using EtherNet/IP every parameter is described by a table the device vendor fills out. The blank table template is called an object and a fill-in table is called an instance of that object. There was also a table of services – things you can do with these tables like get and set the values and another table that listed the attributes of the whole group – things like how many total instances are there in the group. All these things taken together are referred to as the Class. Once you have that picture in your mind, getting or setting a parameter value is easy. Let’s do a few examples. For this video, we’ll use an Allen Bradley Power Flex 40 as the server and a Productivity 3000 as the Client. In the Productivity Suite software, we setup the Client under hardware configuration. EtherNet/IP tab, drag a generic client over here and fill in the blanks. Let’s call this client the PF40_UnConnected client. I’m using the CPU’s EtherNet port. This is the IP Address of the Server we want to talk to – the PowerFlex 40 in our example. And we’ll setup some tags so we can keep an eye on things. We’re doing Un-Connected messaging in this video, so we don’t need any of the Connected messaging stuff down here. Hit ok. Yes we want to create these tags but we’ll change the string lengths first. Good. That’s it. Now that our Productivity 3000 Client is setup to talk to the Power Flex 40. All we do now is issue whatever instructions we want. Let’s start with the motor name plate voltage. Just drop an explicit message instruction on the screen and fill in the blanks. We want to use our PF40 Unconnected client we just created. This will use unconnected messaging and we are going to issue a generic command so we have control over all of these fields down here. Now we just fill in these blanks from the tables of data that the Vendor provides. In the PowerFlex 40’s Ethernet Adapter Manual in Appendix C we see all the different classes available. We want the Parameter Class so we’ll scroll down to page C-9. Here’s everything we need to know about how the parameter information is organized. The Class number is 15. That goes here. This chart is telling me that the Parameter Numbers ARE the Instance numbers. That means these instance tables we need have the same numbers as the drive’s parameters – that’s really convenient. In this example we want the nameplate voltage which is drive parameter 31, so that’s also instance 31 which goes here. It’s also telling us that instance zero is the class attribute table – this guy – and here’s the format of that table. So if we wanted to know how many parameters are in this Class, we would just specify Instance zero, ID 2. Here’s the object template – the table format for these instances - the parameter value, name, units, data type, min value, max value – everything we could want to know about each drive parameter. We want the value of the name plate voltage for this first example so this number 1 goes here. This is the format for the services table format for this class. We want to get a single attribute which is a 0E hex or 14 decimal, so we put that here. So that’s all there is to it – you just go to the devices manual, look up the IDs for the service, Class, Instance, and the attribute of that instance that you want and you’re done. In this example we want to get from the parameter class, instance 31 – the nameplate voltage value. We need to create a place to put the result and I happen to know that is a 16 bit unsigned – I’ll show you how I know that in just a minute. Let’s create the tags we need to monitor the request – we’ll use the structure version to make our lives easy. And let’s add those tags to the data view. Let’s add a control bit so we can enable this instruction and transfer the project. Let’s bring up the data view for our PF40 Unconnected, expand the value array and the control bit. When I toggle the control bit, I see the request was successful and the name plate voltage is 225 Volts. Perfect. That’s all there is to it. Given these tables, we just look up what we want and fill in the blanks. How did I know that the nameplate voltage was an unsigned 16 bit integer? I ask asked for it! You can see back in appendix C that the data type is attribute number 5. Let’s try that. And since it’s almost the exact same thing as we just did, let’s just copy and modify that. The only thing we need to change is the attribute we want – instead of the parameter value we want the data type which is number 5. We’ll also change the names of the TAGs so we can monitor this instruction separately. And let’s create a new place to put that result which we see in appendix C, attribute number 5, is an unsigned integer or 8 bits. Click OK. Yes we want to monitor these new tags, but with longer strings. And now that the TAGs are defined, let’s go back in and add them to the data view. Add a control bit for this request and transfer the project. Let’s bring up the Data view again and add the new control bit. Toggle the control bit and sure enough, the device tells us the data type for parameter 31 is C7 hex which is Unsigned 16 bit. So before I started this video, I executed this command so I would know the data type for that first example we did. Again, everything you need to know is in these tables and once you understand how to use them you will be in total control of your device. Let’s do another one. Let’s get the name of this parameter. Again, it’s very similar to what we just did, so we’ll just copy this instruction. We see back in appendix C that the name of the parameter is attribute 7 so we put that here. Change the tag name, create a new place for the result to go. We’ll set aside 32 characters for that and we want all 32. Hit OK. Yes we do want to define these tags but with longer strings. And now that the TAGs are defined, let’s go back into the instruction and add all of this to the data view. Let’s enable this instruction ONLY if the name plate voltage is successful. This name data is going to come to us as bytes in an array. So let’s convert that to a string using a copy character instruction. We’re going to copy from an array to a string. In particular, our Name array into a new string called Name_String. We do want to define this string and let’s make it 32 characters like our array. Let’s enable this instruction on the nameplate voltage success too. Transfer the project to the controller. Open the data view and add the Name String. Let’s toggle that initial enable bit. And sure enough, we get the name of the parameter. You can see the original data before we converted it to a string here. Ok, this time we’re going to ask the device what the units of the Name Plate Voltage are. It’s exactly what we just did so we’ll copy that instruction and change the attribute we want to the Units Attribute, attribute number 8. We need a place to put the result, let’s set aside half a dozen characters for that, and let’s use all 6 characters. Create a new set of tags to monitor this request. Hit ok and yes we want to create all of these new tags, and this time the string length is ok. Now that the tags are created, let’s drop back into the instruction and add them to the same dataview. Let’s enable this instruction on successful completion of the parameter name request. And just like the last example, this is going to come back as an array of data, so let’s convert it to a string using the copy character instruction. We want to convert an array to a string using this array and this new string. We do want to create this new string and we’ll make it the same length as the array. Let’s also enable this instruction also using the successful completion of the parameter name request. Transfer the project. Open the dataview and add the units string. Toggle the initial control bit, and sure enough, we see the units are volts. Let’s do one more thing – let’s combine these into a single string using the PACK instruction. We’ll display the name string, and then convert the value to a string, and then we’ll display the units string. And let’s have this enabled on the success of the previous instruction. Transfer it to the controller, open up the data view, add the new string, toggle that initial bit, and now we have a nice clean easy to read string where ALL of this came from the Flex Drive. Side note – I have to confess, I did cheat here a little bit – the strings coming back from the FlexDrive actually have a length byte at the beginning. You can see that here – this is the length, this is the letter V. Back here on the parameter name this is the length of the string, this is the first character. When I converted them to a string the length was a non-printable character so it came out as white space. If this was a real project I would have stripped that off before using it. But it didn’t really impact this example so I skipped that step. If you noticed that then you get bonus points. What if we wanted to do this for the acceleration parameter? Same thing, Right? Except now we want parameter or “instance” 39. What if you wanted to set a parameter instead of get one? Well, the SET service code is 10 hex or 16 decimal. Everything else is pretty much the same. As you can see, once you get the hang of these tables – or “Instances” – it’s easy to get or set anything you want using just the one explicit message instruction. And keep in mind – we only messed with the Parameter class of this device – there are a bunch of others you can explore simply by changing the class number here. The only hard part of all of this is finding the documents that have the EtherNet/IP class information for your target device. Hopefully now you have a better idea of how to use the Explicit Un-Connected messaging of the EtherNet/IP standard with the Productivity Series controllers. If you have any questions, please contact AutomationDirect’s FREE award winning tech support during regular business hours – they will be happy to help you with any AutomationDirect parts. The PowerFlex drive isn’t an AutomationDirect part so don’t ask them about that, but you can ask folks on the forums – they love to share their years of experience! 

Performance Plus Value – That’s Productivity.  From Automation Direct.