An overview of the basic concepts you will need to understand to work with EtherNet/IP on the Do-more PLC.
In the Explicit Un-Connected primer video we saw that EtherNet/IP is really just a bunch lookup tables the device vendor fills out. The blank table template in each class is called an object and a filled-in table is one specific 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 what we call the Class. Once you have that picture in your mind, getting or setting a parameter of a EtherNet/IP device is easy. Let’s do a few examples with an Allen Bradley Power Flex 40 as the server and a Do-more PLC as the Client. In the Do-more Designer software, that Flex Drive is just another device so as always, we start with system configuration and work our way down this list. There’s nothing to do at the CPU level, It doesn’t affect the I/O of the PLC, It’s not a new module, but it is a new device so we’ll start here. Could we use this one generic EtherNet IP built-in device to talk to all of our EtherNet/IP hardware? Sure. BUT, it’s better to create a new Do-more device for each piece of Ethernet IP hardware because each one needs its own TCP/IP connection. If you run all of those through the one generic EtherNet/IP device, it has to manage all of those which slows things down. If each piece of EtherNet/IP hardware has its own device, then things get real simple and much faster. So we’ll create a new EthernNet/IP device for this Flex Drive. New Device, EtherNet/IP Client, OK. Give it a name, how abut FlexDrive and the rest of this looks fine. That’s it. We just created a device we can talk to. There is no associated I/O mapping and no new structure because there is nothing for us to interact with in this EtherNet/IP client. Notice that there IS a structure for the EtherNet/IP SERVER – some people call that the slave – we’ll see that in action in the video where we use the Do-more as a server to another device. For this video, the Do-more is the Client or Master device. Great, we’ve created our EtherNet/IP device. Let’s talk to it. In this setup we have a Do-more at this IP address, a Stride Ethernet switch here and the Allen Bradley PowerFlex40 drive here on the same subnet at this IP address. To talk to it we just drag the EtherNet/IP instruction from the toolbox in the Protocol section and fill in the blanks. We want to talk to our PowerFlex device. Remember, that device – which is a lot like the drivers you have on your windows pc – manages the hardware for you. It takes care of all the handshaking, error checking, the memory allocation, etc. so you don’t have to mess with any of that. It makes your life easy. We’ll enter the device’s IP address is this. We have a direct connection so the default port number is fine. For the rest of this, we just look up the answers in the PowerFlex 40’s EtherNet/IP 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 Drive Parameters 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 table - or “instance” - 31. 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, attribute 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 – that’s attribute number 1 - so that 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 one here. So that’s all there is to it – you just go to the hardware manual, look up the numbers 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, parameter 31 which is instance 31 – and we want to know the nameplate voltage of that instance which is attribute number 1. We’ll enable this on an edge, set these bits on success and error and put the response here which I happen to know is a 16 bit unsigned result – I’ll show you how I know that in just a minute – which is 2 bytes max. Let’s add a control bit so we can enable this instruction and transfer the project … Let’s bring up a data view and monitor the result which we put in D1 and the result length which we put in D2. Let’s also add the control bit so we can activate the instruction. When I toggle that control bit, I see the request was successful and the name plate voltage is 225 Volts and that two bytes were returned. Perfect. That’s all there is to it. Given these tables, we just look up what we want and fill in the blanks. EtherNet/IP is easy once you understand how to navigate these tables. 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 that instruction and modify it. 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. And let’s put that result in D3 and the length in D4. And let’s use these as our success bits. We see in appendix C, attribute number 5, is an unsigned integer or 8 bits, so we only need one byte for that. Click OK. Let’s trigger this instruction on the success of the previous one. And write it out to the Do-more. And over in the Data view let’s add our new results. Toggle the control bit and sure enough, the device tells us the data type for parameter 31 is 199 which is C7 hex which according to our lookup table is Unsigned 16 bit. So before I started this video, I executed this command so I would know the data type to use 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 almost identical to what we just did, so we’ll just copy this instruction. Same Class – or group of tables. Same Instance – or table number. The only difference is now we want a different row of the table – or attribute of the parameter. We see back in appendix C that the name of the parameter is attribute 7 and that it is a short string. So we put a 7 here, and put the result in a string structure. Change the success bits and we’re Done. Trigger this one on the success of the previous one. Accept everything, and write out to the Do-more. Add the string to the data view, toggle the control bit and we see the name of this parameter is “Motor Name Plate Voltage.” Awesome. Do you notice this little dot here? That’s because the string sent to us from the flex drive has a leading length byte. If I switch this to Hex display this 10 hex which is 16 decimal is a count of the characters in the string. And if we do a short string zero dot length – it agrees – there are a total of 17 characters – which includes the length byte – in this string. Perfect. Ok, this time we’re going to ask the Flex Drive 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. Change the status bits, put the result in short string 1. Great. Let’s enable this instruction on successful completion of the parameter name request. Accept the changes and write the project to the Do-more. And I’ll add the units string to our dataview. Toggle the initial name plate voltage control bit, and sure enough, we see the units are volts. What if we wanted to do all of this for the acceleration parameter? Same thing, Right? Except now we want parameter or “instance” number 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 using these groups of tables – or “Classes” – 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 – you know, all those filled out tables - for your target device. Once you’ve done that, the rest is easy. If you have any questions, please contact AutomationDirect’s FREE award winning tech support during regular business hours – they will The Do-more PLC supports Ethernet/IP messaging, so it can configure and query any EtherNet/IP device out there that supports Ethernet/IP explicit messaging protocol and it can be an EtherNet/IP slave to your existing system. Or it can do both at the same time. There is a lot of terminology you gotta wrap your head around with this Explicit Un-Connected Messaging, so before we do live examples, let’s take a look at the big picture. This video covers all of these concepts. In other videos we have live demos showing you step by step exactly how to use Unconnected Explicit Ethernet/IP messaging to configure, control and monitor Ethernet/IP devices. For the purposes of this video, let’s assume we’ll use a Do-more as the Client and an Allen Bradley PowerFlex-40 Variable Frequency Drive as the Server and the PowerFlex40 drive is equipped with the Ethernet adapter module to make it EtherNet/IP compatible. Appendix C of that Ethernet Adapter manual summarizes everything we need to know about how to access the data in the PowerFlex40 drive via EtherNet/IP. The first table in the Appendix breaks stuff up into these “objects” – an object is just a generic way to describe things that share common features or attributes. We’ll look at the details of these specific objects in the next video where we do a live example with a Power Flex Drive. For now, if we look at objects in general, and we use the example of Drive parameters – the drive parameters all have similar attributes – right? Each parameter has a Name, a value, a min, a max, a data type, etc. – these are all attributes we can use to describe each of the drive parameters. So we can use a template like this to describe each parameter. Here’s Drive parameter 31 for example, with his values filled in. His name, his current value, etc. … Keep in mind I’m just making these numbers up for now – we’ll look at real data in the next video. Here’s another one – Parameter 32: the Motor Name Plate Frequency. Again, uses the exact same template and just fills in the blanks. How about Parameter 39 the acceleration time? Same thing … Parameter 40 - Deceleration – same thing. So we end up with a huge group of tables like this describing every parameter in the drive using this common attribute template which we call an object. Now, what can I do with these attributes? I can get the value, Set the value, reset the value, etc. We call those the services – all the things you can do to this common set of objects. So since all of these instances of this common template or object share a common set of attributes and services, we group them together into a common class of objects called the “Parameter class.” There’s one more template we need – this one describes the attributes of the class itself – it tells us the revision of this class, the total number of parameters in this class, and some other things we might want to know about this group – or class – of objects. So again, the template describes a generic object and a filled in template creates a single instance of the object, like Parameter 31 – that’s an instance of the object, this is another instance .. another instance, another instance. So suppose for a moment we want to get the value of parameter 31. Well, we look up in the manual and we find out that the parameter class is number 15 or 0F hex, the get is code 0x0e, The instance of the object we want is number 31 – parameter 31 - and the attribute we want is number 2 – the value. We simply hand those numbers to the Explicit message instruction and it fetches the value of that parameter for us. The cool thing about this is since every EtherNet/IP drive uses this exact same messaging with this exact same set of templates, you can use this exact same instruction in ANY drive, not just this one. So once you understand how to use this, all the sudden your world just got a whole lot bigger because you don’t have to learn a new way of accessing every new device that comes down the line. You just specify an Ethernet/IP enabled device and code you wrote for one manufacturer’s device will be easily ported over to any other manufacturer’s device. That’s huge and makes you much more productive. Each class has its own set of predefined tables, but you access each one the same way. For example: let’s look at the Identity class. This is used to identify different components in a device. In our device we have the Host drive itself and the EtherNet adapter. You might even have another communications adapter module connected to the drive. How would you get the Vendor ID or the device type or the Revision or the serial number? You would use the identity class. Here’s the predefined template of attributes, now the vendor just fills in the blanks to create an instance of each object. Here’s the drive instance – so now I can look up all these things about the drive - here’s my EtherNet/IP adapter instance. Again, you might have some other communications module. The drive manufacturer will create one of these instances for every option available. And since they all use this standardized template along with a standard list of services and class attributes – anyone that wants to know about the identity of one of these objects knows how to get it. You as a programmer just issue a command that says you want to GET, from the Identity Class – the revision - of the host drive. We’ll see how to get these numbers in the examples in the next video – but given these numbers, we just issue an Explicit message command and the EtherNet/IP messaging retrieves the revision of that hardware for us. If you were super ambitious, you could even write a program to query and fully auto-detect and configure an entire EtherNet/IP system without knowing anything but the IP address of each device on the network because you can ask every device who he is, what type he is and then configure him appropriately. Very cool. What other kinds of classes of objects are there- that is groups of things that behave similarly? We’ll if we look at that Allen-Bradley VFD for example, it looks like there is an assembly object, a register object, and a bunch of others. Do you need to know all of this? No. In fact, most of the time all you are going to care about is the Parameters Object so you can setup and configure the drive. We’ll do several examples of that one and maybe a couple others in the next video. The key thing about this is once you get the hang of using these classes of objects, you’ll be able to use any of them on ANY EtherNet/IP enabled device out there. That includes other manufacturer’s drives, encoders, remote IO, other PLCs and PACs, etc. And of course Do-more enabled controllers make it super easy to do. Well, that oughtta be enough to get you oriented. Check out the other videos in this series to see some live demos of the Do-more using Explicit Unconnected messaging to communicate with devices like the Allen-Bradley PowerFlex Drive and how to setup the Do-more itself as an EtherNet/IP slave. If you need any help, please contact AutomationDirect’s free award winning tech support during regular business hours, they will be happy to help. And don’t forget the forums, there are lots of folks there that love to share their years of experience. Just don’t post any questions for AutomationDirect’s support staff there, they don’t monitor the forums on a regular basis. 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! Just don’t post any questions directed at AutomationDIrect’s support staff there, they don’t monitor the forums on a regular basis. Spend Less, Do More. With AutomationDirect.