Messaging from a Controllogix Compactlogix to Micro820 Micro800

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
i just assumed today we're going to talk about how to read tags out of a control logix or compactlogix plc into a micro 850 plc now if you're curious how to do the opposite we also have a video on it which i'll put in the description please take a moment to like this video subscribe to our channel we put out at least one automation video a week and any questions that come up feel free to put them in the comments your question this week could easily be next week's automation topic for this video we are going to be using our compact logix plc trainer and we've stuck a micro 820 plc on the side of it default the ip address of our compact logix trainer is 192 168 110 and the hmi on the back side is 11 and the power flex is 12 so we're going to configure this for 13 or 192 168 113 so we're going to need to create programs in both studio 5000 and connected components workbench for this so let's start in studio 5000 then we're going to start with a new program and we're going to be using a 1769 l16 er bb 1b and we'll just call this micro 850 read and if you're using one of our trainers then typically your expansion i o will be set to zero we've got some modules on here for some other video so i'm to set mine to four you need to have that set correctly if you don't put the right number here your processor will fault when you try to go into run mode and we're going to create two controller tags we're going to create a sent to micro 800 and that will be a data type of sent or single integer and we're going to create an array of 20 of those and then we're going to create another array called dent to micro 800 and that will be a double integer type which is the default type of studio 5000 we're going to create an array of five of those and the reason why is typically when you're programming in studio 5000 you're going to be using double integers or the data type but when you're using messaging over ethernet ip it actually is a single integer or ascent data type so let's go ahead and download this program just as is so we can understand the need for this conversion that we're going to have to do now if you need any help downloading your program look in the description we'll have links to a complete lesson series that goes through how to download how to create programs configure drivers all those good things and once you're done downloading let's go ahead and go into the connected components workbench software which is the software for the micro 820 plc and let's create a new program and we'll just call this our logix messaging and under controllers let's go to the micro 820 and we're going to be using a 2080 lc 20 20 qwb so we'll select it and add to project and then right away let's set our ip address because it's going to need to be 192 168 113 with a subnet of 255 255 255 0. now again let's make sure we understand this because this is the first time that we've deviated from our standard ip address we've been using these lessons we have lessons on the control logics and compact logics plcs for studio 5000 and we have lessons for the micro 820 and other micro 800 line of plc's for the connected components workbench but they both use the same default ip address of 192 168 110 which is what i've kept our compactlogix plc at so this one has to have a different unique ip address in order to communicate so i chose 13 for it now let's go ahead and create a program we're going to add a ladder diagram and let's open up that program and the first thing we're going to do is we're going to use a timer to create a sample rate and we've done this several times before so i'm not going to go into the weeds of it we're going to drag an instruction block down and we're going to use a t-o-n timer on delay and we're going to set the preset at t number sign 100 ms and we've got a video on how timers work which includes this designation but this is going to make a 100 millisecond timer so every 100 milliseconds we're going to read data from our control logics for compact logics plc then let's drag down a reverse contact examine if open and we're going to look at that timer instruction that we just created so we're going to look at ton1 and we're going to look at its q bit so what this is going to do is every 100 milliseconds this qubit is going to be true for one scan so let's go and bring down a new rung and this is where we're going to put our messaging program so first let's bring down a direct contact examinative closed and let's look at that timer's qubit again then let's bring down an instruction block and just start typing msg which is short for message and we're going to be using the cip symbolic message so click yet then just like in many of our other exercises we're going to mouse over this to figure out most of what we need so if we mouse over it first we have a control config which is going to be a data type of cip control config so let's click on it and let's add logix control config and that'll be a data type of cip control config then next we have a symbolic config which is a data type of cip symbolic config so click there and this will be logix symbolic config and that will be a cip symbolic config and next we have a target config which is a cip target config click there and we'll call this the logix target config that'll be a cip target config and then we have our data and this is the actual data that we will be retrieving from the compact logics or control logics plc and it is an unsigned integer so we're going to open this and we will select data from logics and it's going to be an unsigned single integer and this one we're going to add a dimension to and we're going to add a dimension of 20 and to do that we're going to hit 1 period period 20 and the dimension tab and that tells it that use dimensions 1 through 20. and then on the output side of it we're going to have a status and a data length so status is cip status so we'll click on it and we'll call this one logix cip status and that will be a cip status and then we have a data length which is an unsigned integer so we'll call this one our logics data length and it will be an unsigned integer so that's it for our basic structure now there's a few of these tags that do need configured and so let's open up our local variables and let's open up our logix symbolic config let's drag this out where we can see what everything on it is and the main two we're going to be concerned about is the symbol and the count so the symbol is the data tag name in our control logic store compact logics plc so if we pop back over to this we called it the synth to micro 800 in fact we should just be able to highlight that and copy it and then come over here and just paste that yep it'll let us paste and then we need bracket 0 bracket and this is going to let it know to start reading at that first data value let me drag that out where you can see it and then the one right below it is the count and we want it at 20. so what that's going to do is it's going to read sent to micro 800 0 through sent to micro819 and then we're going to need to specify our target and that is under logic's target config and we drag this on out a little bit more then mainly this path is the one that we're going to want it's going to be the number 4 comma and the ip address of the plc so 4 comma 192.168.1.10 and that is all the configuration we need for our basic messaging instruction now we have a few other things that we need to work out so don't go ahead and hit the back button and say i've got it and go try to run do it let's go ahead and download this program though and see how it works again same as with studio 5000 if you need any help downloading your program or creating a new program or configuring your drivers we have lessons on all of that look down in the description okay make sure you switch your controller back to run mode and all right we're seeing a logic data length of 20 i'm not seeing any errors so let's open up our data from logics we can just double click on it it's going to bring up our variable monitoring and data from logix and right now we have all zeros because we have nothing entered in our control logix controllers so let's go to our studio 5000 program and let's just put a value of 12 in and pop back over here and there you go we see 12 but we also see this 0 popping in occasionally so right now is 12 now it's 0 12 0 and this has to do with every time it goes to initiate a read it actually puts a zero back in that value so we're going to fix that in a second but there's also another problem let's go back over to studio 5000 and let's put in a value of 200. and you see it says failed to set tag invalid string value and if we go when we try to put in 128 you're going to see the same thing until we get down to 127. and that's because this is a single integer and the largest value it's going to be able to handle is 127. so there's why we created that second tag that was double integers so what we're going to do is we're going to copy our dent to micro 800 to our sent to micro800 so we can use larger values so let's go ahead and go to our main program and the main routine and let's add a copy instruction i'm just going to type cop and then for our source we're going to want our dent to micro 800 bracket 0 bracket and we're going to use a length of 20. now this is actually a little tricky let's make sure we understand this length because it's going to be different when we get a connected components workbench is the length is determined by the destination so i put a size of 20. that's going to be 20 single integers because there's four single integers in one double integer so we're going to go ahead and put that into our plc and now let's go back to our controller tags and go to monitor tags and look at that first double integer and let's put in a value of one two three four five six seven eight nine zero so we can put a lot bigger value into a double integer and now if we open up our single integer one we'll see that we have values in zero one two and three so what it's done is it's broken up that double integer into these four single integers and that's what we're going to send across to our plc so now let's go to our connect so now if we look at our connected components workbench software we're going to see values as well now they're still bouncing around but one thing i want you to note is these values are not the same values that we saw in studio 5000 we've got 210 2 150 and 73. if we pop back over to studio 5000 we have negative 46 to 106. and 73 now there's a couple ways to fix this and we're actually going to do some really neat videos talking about data manipulation and how this can happen but our bites are swapped is the issue so stay tuned for other videos on that but right now let's get back to our connected components workbench software and let's fix it along with the mysterious blinking out of the values both at the same time so first let's go ahead and go offline and let's add another wrong down here and we're going to first start by adding a direct contact examine if and we're gonna look at that message instruction so right here message cip symbolic and if we drag this out a little bit you're gonna find the queue and the queue says that it has completed reading and so each time that happens we're going to copy that data to our double integer that we made over here in connecting components workbench so we'll drag another instruction block down and type cop and that's going to be our copy instruction and for our source we're going to use the data from logix now we're not even going to you know you could hit the open bracket here and you could specify a specific bit we're not going to do that we're just going to use just that and then for the offset we're going to put in a value of 0 and then for our destination we're actually going to create a tag here and we're going to call this dents from logics and these are going to be double integers and we're going to use 1.5 so that means an array of one through five and then our destination offset will be zero now our length when we were over here in studio 5000 we put our length in as 20 but that's the destination length and this was single integers well now that we're over here we're copying the other way our destination is double integers so this is going to be a length of five and for nail let's put the swap bytes at false just so we can understand what that does so let's go ahead and download this and see what it does okay so this is actually a really good example you can see that the value here in our source is occasionally dropping to zero well of course now that i'm pointing that out it doesn't want to drop to zero there it goes it just dropped to zero but our destination never does and that's because we've tied it to this q bit right here so each time that our message is successfully read then it's going to update this but if we open this up we're going to see that we have a value of like negative 77 million or maybe that's 770 million that's not the value that we have over in our studio 5 000. and that's because the bytes are swapped when they came across the message command and so what we need to do is we need to put that swap bytes here at true so if you see that you have some really crazy values but they do change when you change the value in the plc you're reading from then the swap byte is probably a good idea to try out all right and now that we've swapped the byte that's looking a lot closer in fact let's open it on up here and yeah we have one two three four five six seven eight nine zero so there is how you can read data from a control logics or compact logic plc into a micro 800 style plc check down the description we'll have a video where we do the opposite we take and program a control logix or compactlogix plc to read values out of a micro 800 till next time go ahead look at you man you're looking good thank you he got his braces on hi this is tim and this is amber of tw controls we run the automation store hey thanks for finding our channel here's a playlist with some similar videos and youtube thinks you'll like this video please like our video and subscribe to our channel and if our videos have helped you make some money and you're not using our products please consider supporting us on patreon until next time see ya
Info
Channel: Tim Wilborne
Views: 6,045
Rating: undefined out of 5
Keywords: controllogix to micro820 messaging, micro820 to controllogix messaging, micro820 to compactlogix messaging, compactlogix to micro820 messaging, controllogix to micro820, Tim Wilborne, connected components workbench messaging, connecting plcs over ethernet, connecting a micro820 to a controllogix, connecting a controllogix to a micro820
Id: wMNME11mwPs
Channel Id: undefined
Length: 19min 2sec (1142 seconds)
Published: Wed Oct 28 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.