https://www.automationdirect.com/productivity (VID-P3-0048)
Watch this live demo to see how easy it is to use a Productivity Series controller with an EtherNet/IP enabled encoder. While this video uses and AMCI Encoder, the same idea applies to any EtherNet/IP enabled encoder.
Our FREE Practical Guide to Programmable Logic Controllers eBook: https://www.automationdirect.com/ebooks/plc-handbook
setting up an amci ethernet ip encoder on the productivity 3000 is easy our goal is to have all the data transferred between the encoder and the productivity 3000 in the background so our ladder code doesn't have to fool with controlling all the transfer details well that's exactly what the implicit or io messaging of the ethernet protocol does right once you set it up it automatically maintains the data transfer for you so your ladder code can just deal with local data arrays here we go here we have an open project the hardware has been auto detected and we're online with the productivity 3000 controller to set up communications with the amci ethernet ip encoder we just double click on hardware configuration and drag a new generic client onto the screen it's generic because we haven't told it what we're connecting to yet right and now we just fill in the blanks here we give it a name over here we create some tags to collect device info and monitor connection status and over here we provide the ip address of the device we want to talk to the encoder in this case down here we select the implicit or i o messaging and we create a tag that we use to enable the data transfer over here we create some more tags so we can monitor the health of the connection from our ladder code down here we set up the input output and configuration of the encoder we want the encoder to deliver data just to us so let's change this to unicast and let's ask it to send that data 4 times a second which is every 250 milliseconds we like that the connection point for the input to the encoder which they call the assembly instance in the amci documentation can be a one or a three depending if you want the encoder to send just position data or both position and velocity we'll make it a 1 and get only position data in this example we need to create an array to put that position data in and the software reminds us that we haven't actually created that array yet and gives us an opportunity to do so i love this because it means i don't have to create all my tags ahead of time i can just create them on the fly let's see according to the documentation we need 16 bit unsigned integers here and we'll need two of them we want the encoder to send both of those elements to us so we put a 2 right here now this was the data from the encoder to us our input data now let's do the output data here we set how often we're going to send data to the encoder note that it doesn't have to be the same as the input for our purposes we'll go ahead and leave it at the 250 milliseconds the connection point or assembly instance is 101 for this encoder and we need to create an array of data to send to the encoder again the software reminds me i haven't created that yet i know from the documentation that needs to be 16 bit integers and that we'll need three of those and of course we want to send all three down to the encoder again i found all of those numbers in the amci documentation now some devices require a four byte status header to go down with this output data this amci encoder is one of those devices so we need to make sure that this little check box is checked right here now to be honest i found that by trial and error without the header the output data i sent to the encoder wasn't recognized with the header everything worked as expected configuration data is required for the encoder so we check this box and there's a couple ways you can configure this encoder which you select with the connection point or assembly instance in our case we're going to use assembly instance or connection point number 102 which requires 8 bytes well that's it we're done so we hit ok the software reminds us that we haven't defined all these status tags yet and it even recommends what we might want to use for those these all look great except i usually like to make my strings kind of large just so we don't miss any messages that we might get perfect now let's do one more thing let's go back into that scanner and hit this monitor button right here that automatically creates a data view for me is populated with all of this stuff we just created i love that i don't have to do that manually great let's go ahead and download the program to the controller we're online we're running let's bring up that data view we created which was this one right here i'm going to expand my output array my configuration around my input array and with this particular device you need to have all the configuration parameters set up before you enable it but just for the heck of it let's not do that let's go ahead and try and enable and see what happens well look it looks like we got an error of some kind right we got error 21 which is invalid segment and path so the amci encoder didn't understand something we sent it now i did this on purpose just to show you how these error messages work you can go look up this error message online there's a great chart here under ethernet ip error codes where it lists the details of all these errors it's fantastic but i know what happened here if i go back to hardware configuration bring up my encoder and look under configuration data while i told it the connection point and i created an array i didn't specify how many bytes should be sent there were eight bytes in that array so let's put an eight there and say okay we do need to send that back down to the controller so let's do that now we are running we're online here's our data view now if i try and enable the encoder what happens we got a new error we are connected to the encoder but the connection is unconfigured the encoder is telling me we didn't set up the configuration parameters right and sure enough look down here we didn't set up any configuration parameters well this particular device requires that these be set up so let's go ahead and do that if you look at the documentation it'll tell you that this byte has to be a 1f this byte sets up the format of some of the data that's returned and we'll put a four there that selects the format of the velocity data that comes back it specifies it'll be in pulses per second i think the next four bytes specify how many counts per revolution it defaults to 65 000 let's go ahead and change it to like 100 counts per revolution this byte enables that scaling and this byte if it's a 1 we'll say count up when it goes counterclockwise if it's a 0 count up when it goes clockwise so we'll leave that as a 0. let's go ahead and write all these out i'm going to select all these lines write out the configuration data so these are transferred into these values here as soon as we got all this data correct look what happened the encoder recognized that gave us a success message and we are now online with that encoder so keep an eye on these status tags are really really helpful when you have to debug problems with your adapter devices well we're online here's my input data if i reach down and flip that encoder and sure enough it changes now the output data allows you to preset the value of the encoder you put the value you want in here and then according to the documentation if i put a 2 here and i write that out and then i put a 13 there and i write that out i keep an eye on this value right here sure enough it resets the value of the encoder now we told the encoder we want 100 counts per revolution so i'm going to rotate the shaft to one revolution and sure enough we get 100 counts perfect exactly what we expected well that's all there is to setting up an amci ethernet ip encoder to be used with the productivity3000 quick review all you do is go to hardware configuration drop a generic client on the screen fill in the blanks don't forget to hit the monitor button to create a data view you transfer that down to the controller bring up your data view and on some devices you need to set the configuration data first of course you toggle this enable flag check to make sure you have a successful connection and everything works exactly as expected easy check out the other videos in this series for more tips on using ethernet ip with the productivity 3000 and don't forget automationdirect's tech support is always free and you'll always talk to a real live person here in the us within minutes please keep in mind that while support will be happy to help you with any productivity 3000 ethernet ip questions you may have if you have any questions about the amci devices you'll need to contact amci support automationdirect doesn't sell or support amci devices performance plus value that's productivity from automationdirect
Voted #1 mid-sized employer in Atlanta
Check out our
job openings