Micro800 Modbus RTU Serial Configuration

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
the micro 800 PLC supports modbus TCP but it also supports modbus rtu let's use it to control this powerflex 525. [Music] any of the micro 800 plcs that have the round serial Port connector will support a modbus rtu also on the top of the micro H20 these small terminals are serial communication and we're connecting to this powerflex 525 and before anybody says it yes it does have ethernet and we have videos on how you can communicate from the micro 800 to the powerflex 525 over ethernet so the first obstacle you have to overcome is figuring out the pin out of this cable that seems to be the most difficult part with any serial communication but off the DSi Port is going to be pins four and five and pin 4 is going to be the blue wire out of a standard ethernet cable and it will go to the D plus and the blue and white wire which is pin five will go to the D minus now let's create a new program and connected components workbench and I'm going to be using a micro 820 and it's the one that ends in qbb and just so I can show the parameters that we're going to change in the powerflex 525 I'm going to go ahead and add it to here also and I'm going to upload the parameters out of the drive and I'm just going to show the non-default one so you can see what I did because the main parameters you're going to need to change our p46 and p47 which is typically what you need to change on a powerflex 525 now these parameter numbers are different on some of the other power flexes and if you're using a different drive then obviously they'll be different for it which I didn't actually mention that's what's so cool about modbus especially modbus rtu is it's a very Universal protocol so if you know your baud rate and those basic communication things and you know where you need to read and write from you can control almost any device no matter what manufacturer it is so you're going to change p46 to 3 and p47 to 3. that's going to make it where our start source and our speed reference are going to come over that serial port and in my case I needed the baud rate to be 9 19 2 and my node address was 2. now you also see I have some ethernet I Peak parameters here don't worry about those that's just so I can communicate with the drive in other videos now let's configure our serial Port which to get there we're going to double click on the micro 820 and then we're going to select serial port and it's going to default to a CIP serial driver and when you try to hit the drop down it's not going to let you change it and it says down here remote LCD is configured to overwrite serial Port parameters so we're going to click on this because this is a link and then we're going to uncheck the configure serial port for remote LCD now we can go back to the serial port and now we have our drop down and can select modbus rtu and we're going to leave all this at the defaults and now we're going to go ahead and create a program so right click programs add new ladder diagram and we'll open it up and let's start by bringing down an instruction block and type modbus and you're going to see two options come up we have the TCP and the rtu so the rtu is the serial one that we're using and let's go ahead and just start creating tags for all this now we're going to do a read and a right so I'm just going to start filling these in so this is our cancel so I'm going to double click and type read cancel and it's going to go through really quickly and do all of those and then I'm actually going to double click on this function block again and at the bottom you can name these and instead of looking at the default instance I'm just going to call this read modbus and now I'm going to copy this line and we're going to paste it and now I'm going to change all these to rights and then I'm going to double click on this function block and we're going to change it to right modbus and I'm going to highlight one of them and just hit F1 to bring up the help just so we can go through a couple of things and mainly this is going to give us all of our error codes but if we go down we have our Target parameters and local parameters and if I go to my local parameters then we got some important information here so first is the channel and so 2 is the embedded serial Port so on both of them our channel is going to be two and then we have our message trigger type now we can have it trigger continuously or once each time it goes true now I'm going to use the once just so we can show how we can make a sample rate and then we're going to need to know these commands so I'm going to bounce back to it in just a second and then the element count so now I'm going to open up our local variables and let's open up read local perium and write local parameters if that's going to be roughly the same and on my project value we're going to put 2 for the channel on both of them because that is the built-in ethernet port and our trigger type is going to be zero because I'm going to make an external sample rate and then we have this command here so we're going to read what this one so if we go back our read is going to be a 3 because we're going to read some holding registers to get some information about it and then our right we're going to write to multiple registers so that's going to be a 16. so this is going to be a three and this one down here or right is going to be a 16. then our element counts just so we'll see some information I'm going to put 10 in her on the read just so you can see that you're going to read multiple things on our right I'm going to put a size of two because I'm going to write a run command and a speed command to this now let's go back to our ladder logic and I'm going to insert a rung above these and I'm going to bring down an instruction block and I'm going to find a t-o-n and I'm going to call this my sample rate and I'm going to put an examine all in front of it and we're going to look at sample rate Dot View which is the done bit in studio 5000 and I'm going to make the sample rate one second and one really neat thing if you don't know in connecting components I could put T Number One S and one s means one second and now I am going to put an examine on in front of both of these looking at that sample rate dot Q looking for copy and down here we're going to paste it so the next thing we need to look at is our Target parameter so let's go back to our local variables and let's open up both of those Target parameters oops and I just realized earlier I made a mistake apparently I renamed this tag by accident so I'm just going to double click on this one and that'll be read okay because we need a separate Target parameter for the read and the right and now we have right target parameter and we have read Target parameter and there's mainly two things you're going to need in here we're going to need an address and a node and it's a little confusing because you would think this address is the address we configured in the powerplex drive but it's not it's the node and the easy way to remember it is the smaller number is going to be what we'll call the address the larger number is where do we want to read and write data from so my address of my powerflex 525 is 2. so I'm going to put that in my node parameter for both of these my read parameter address is going to be one because that's going to give us some data about whether our job is running and the speed and various things and there are right is going to be 81.93 and there is a modbus chart that you can look all this up on the powerflex 525 dry okay I had to leave and I forgot to save the file so I just recreated it I noticed that I made a few tags that were different in the second version in the first one for example I had read Target param now I have message read Target Bram so you'll see a few differences but I think you can follow all that and now let's add three wrongs just to make this a little easier to operate and we're going to examine on run and if Ron is on then we are going to put a 1 in right local address bracket one close bracket dot zero and then we're going to examine off that same run bit and I'm just going to copy this address because it is going to be that same address we'll go one at the end of it mainly I already know this is our start drive and this is our stop Drive and then let's bring a move down and we're going to create a tag called speed and it's going to be right local address 2 and there will be another no extension on the end of it and let's go ahead and download that and if you need any help on any of that or we went too fast through any of it just look down in the description we have lessons on everything from creating new programs to the basic instructions to using messaging command to uploading downloading and now if we have done this correctly if I toggle this run bit this drive should start and okay you probably heard it did make a noise but it did not start because I forgot to put a speed in it so now let's just go ahead and go to our local variables and go down to our speed and I'll put 3000 in it and right above it there's the check box so as soon as I check that box and we see it's starting to run and you probably might be able to see there it's saying roughly 30 Hertz now and if I go and change this to 1500 you know here it start to drop down and yeah now we're going to run 15 Hertz also if we look at our local read parameters now we get some values in here and so there's that 1500 we put in did you know we also have videos on how to read and write to a compactlogix PLC over ethernet using modbus and also we have some power Flex Bob 25 videos click here to learn more about modbus
Info
Channel: Tim Wilborne
Views: 14,177
Rating: undefined out of 5
Keywords: Allen Bradley PLC Training, Industrial Automation, PLC Programming, Manufacturing, Tim Wilborne
Id: ARg2QHn3IB0
Channel Id: undefined
Length: 11min 35sec (695 seconds)
Published: Sat Oct 22 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.