|AutomationDirect Live Chat|
Learn how to control a GS4 Variable Frequency Drive via EtherNet/IP using a free app you can find on the internet! This video also takes a look behind the scenes and shows you how EtherNet/IP works.
The beauty of EtherNet/IP is it is just a bunch of lookup tables that are defined by a standard. A manufacturer just fills in the table with their products information. The standard calls the first level of tables “Classes.” All of this information we saw here in the previous video came from the Identity class. The vendor of this GS4 drive filled the Identity Class table in with this data to create an object our system can talk to. Because this is all pre-defined in the standard, the app knew where to go look for it and automatically retrieve it for us. Let’s manually go in and look at the Identity Class so you can see how it is structured. This video assumes you have EtherNet/IP setup from the previous videos and are in remote mode on the drive. If left click on the object and then right click we can add a class to the tree below. The Identity Class is always class number 1. Each Class can have one or more pre-defined instances or tables of information. This Identify class has only one. If I left click con this instance of the Identity class, the app goes out and pulls in all of the data – which we call attributes – and shows them to us. Again, this table is well defined and is the same for every device, so the app knew how to go retrieve it and decode it. To do it manually, we just left click on the Instance, and right click to add which ever attribute we want. The first attribute is always two bytes which represent the Vendor ID. This is the lower byte so it counts from 0 to 255. This is the upper byte so it counts by 256’s. So, this says two 256’s and 148 ones which is 660 decimal. Sure enough If I click on the original object, we see that is in fact the Vendor ID. The sixth attribute is always the serial number. So that’s 69 ones, 19 256’s, 18 256 squareds and 35 256’s cubes which is this, which is exactly what we saw back here. So again, when we clicked up here, this EtherNet/IP Explorer app automatically pulled all of these attributes, did the numerical conversions and displayed it here. So this is a nice neat presentation of what’s actually in the Identity class. What if we want to see the drives frequency, current draw or bus voltage? Or what if we want to control the drive – tell it to run, stop, change speed? That’s in the assembly class which is class number 4. Assembly classes are device specific so the EtherNet/IP Explorer app can’t automatically pull the data in like it did for the Identify Class. So let’s build it out manually and see what it looks like. Left click on the class, then right click to add an instance. I know the input buffer is instance 101. Which attribute do we want? Turns out there is only one input buffer and its attribute number is 3. If I left click on that attribute the EtherNet/IP Explorer app goes out and reads the entire buffer and shows it to me. I know this is the bus voltage and if I hit F3 to refresh the screen I can see the bus voltage fluctuate. What is that bus voltage? Well, it’s this many 256’s and this many 1’s which is this. Exactly what we expect if we add in the implied decimal. You’re probably wondering about now how I know those two bytes are the bus voltage. Or. For that matter, how did I know which class was the Identity class or which class was the assembly class and how did I know the input buffer was instance 101? How DID I know all of this stuff? It’s easy. There’s a cheat sheet in appendix B of the user manual. In my copy of the manual, the EtherNet/IP section starts on page B-17 - where we see general specs, all the EtherNet/IP Card identifiers, Pin out, LED Indicator descriptions, Error codes and the Drive Parameters you need to setup EtherNet/IP which we did in the previous video. Here’s the EtherNet/IP implicit messaging details, the format of the input and output buffers and finally the explicit messaging which we are using in this video. That is, we are explicitly opening up a TCP connection to the drive and requesting exactly what we want. Look, here is a list of the classes. And sure enough we see the identity class is number 1 and the assembly class is number 4 – exactly what we did a minute ago. If I scroll down to the identity class, I see there is one instance and its number is 1 and it has these attributes. We used attribute 6 – the serial number – in our example just a minute ago. This table is the services – this says we can only read and reset – there is no write ability for the Identity class – which makes sense. We wouldn’t want to over write to the serial number or the Vendor ID – right? In some apps you will have to tell them which service to use. This EtherNet/IP Explorer app we are using right now – it does it automatically for us. Let’s scroll down to the Assembly class. He is class #4 and has three instances. We used Instance 101 before which was the input buffer – that is data INTO us, which is out of the GS4 drive. Instance 100 is the Output Buffer – which is the data out of us, into the drive. Input and output in EtherNet/IP is always relative to the originator which in our case is the PC we are originating the messages from. How did I know earlier that bytes 10 and 11 of the input buffer were the DC Bus voltage? That was back here in the buffer definition chart. Sure enough the DC bus voltage is word 5 which is byes 10 and 11. We can view any of these attributes. Drive frequency, Output current, run status, etc. Let’s go ahead and open up instance 100 of the Assembly class – which we know from appendix B is the output buffer so we can CONTROL the drive. Left Click on the Instance, then right click to tell it we want attribute 3 – which we know from the chart gets/sets an array of bytes. Click on that and we see the output buffer. The buffer table says the second word – which is bytes 2 and 3 set the drive frequency. Suppose we want 45 Hz. There are two implied decimal places so we need a 4500 decimal. That’s 17 256’s and 148 ones. Sure enough, the drive is set to run at 45 Hz. The buffer definition table also says if we set this bit in the first word, which is a decimal 2, the drive should start running. Sure enough … it does. If we set bit 5 which is a decimal 32 the drive should reverse direction and it does. Set bit 4 which is a 16 decimal and the drive goes back to forward. Set bit 1 and the drive stops. Perfect. Would you normally enter a 2 to get the drive running like I did here? No, because you don’t know which direction the motor is going to rotate. It’s much better to say I want the drive to run and go in the forward direction so we would enter an 18 here instead of a 2. Or to run in reverse, we would enter a 34. Well, that should be enough to get you started with EtherNet/IP on the GS4 Drive. A couple side notes about using this EtherNet/IP Explorer app. First, if you see a little red exclamation point here, it means It went off line, so just click on the object to refresh it and then go back and click on the attribute again. The reason it went off line is there is a 100 second time out which you can change under settings. For this video, I changed that timeout to 10,000 seconds so it wouldn’t timeout. Also, When I initially created this Interface – that doesn’t always seem work for me. When it doesn’t, I just kill the app, re-start the appt and try again. It usually works then. Click here to learn more about GS4 Drives. Click here to learn about AutomationDirect’s free support options. And click here to subscribe to our YouTube channel so you are notified when we publish new videos.