TIA Portal: GET Command / PLC-PLC Communication

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello and welcome to today's video in which we're going to look at the get command we already talked about the put command so if you want to know more about hood come and check out my channel and it should be there somehow sort of a put in which this PLC has written some data to this PSE put just putting data into the storage this time we want to have get which is from this PSE we start a command and this will get us some data from the second PSE to the first PSE so we will read data from the second PSE for this some preconditions as for the put command they both need to be in the same you see it's Ethernet network so one and two one six eight zero is my choice here the second one the one we want to read from is one or two the first one is 101 and that's the first the second just for the repetition if you don't want to watch the other video here is the second thing that we need to do for the second PSE that we want to get the data from we need to allow we have to permit the excess this you can do by clicking on the PRC going properties general and then we have protection and security you scroll down a little bit and there it says connection mechanism permit access with put gate communication from remote partner this needs to be active for the second PSE because we want to read data from it right it does not need to be active for the first PC because we're just we're not accessing the data here right from somewhere else so just from the one we want to read data from or that we want to write the data into yeah those are preconditions the third precondition I have some data on the second Piercy here in my second PRC I have those two right data comes from here it's an integer on memory word 0 and theta 2 comes from here's a real that is in memory double word 2 so those two I want to read and I want to get from this PRC so from now on I don't need to touch that PRC anymore I just want to make sure that it's downloaded here I got that so the second PRC that's all the preconditions I need to do you see those numbers here they're doing something so some calculations are going on here but I don't need to touch it I don't care anymore I would just go offline and push that to the side for later use mm-hmm good now let's get to the get commands in my main function here usually I would create a new function and so on but here let's do it just simply in the main function you can search for it here and the structures on the right side we have communication and communication I can open it and there we have s seven communication right and there we have get which would put what we already talked about and get I can take get and put it here on in my main or anywhere in your function it needs an instance data block because it is a function block if you need to know more about this check out my channel there's a video about it something about function blocks and instancing so now that I have this automatically generated was this get database right the get data data block and you see there's a lot of stuff in here no need to touch it but it's there it needs to be unique right if you have a second gate like if you copy and paste this you have two times the same data block which won't work you would have to get a second data block for that right talking about function blocks so as the same as input you have this little tool box here if when you click on the tool box right a window why am I in the middle a window will open down here all right when clicking on toolbox and this is our parameterization we know we don't need anything else for the operation of this block we don't need anything else the first thing we need to set our the connection parameters and here we have as the local partner this is where the program is running our PLC and as the partner partner we can use unspecified or we use the PLC if we have the other POC in our project we can simply use that if we do not have it and want to communicate to another project basically to another PRC that's in a different project we can take unspecified which I prefer I can take unspecified and I just need to type in the Ethernet address of this one zero 102 and also right now my PLC does not communicate into any network so I need to go to the device and networks and I need to put this one here this PLC wants to communicate on this interface I will need to say just edu net subnet but you'll see with this line now it is in a network and everything here book should be green with my communication good if you already have a put or get communication you can always you can simply use the same as seven connection here you don't have to create a new one you can use the same one because this identifies the same partner if you want to communicate to a different partner of course you would have to create a new connection here which automatically happens you don't need to take care of automatically happens just for information what that is good next we get the block parameters and this is everything that we need to parameterize like when do you want to get the data which data do you want to get the request I have again this push button here you could also put a frequency or some other tricks there's many many possibilities so it almost dropped I prepared this push button which I called start button so whenever I press the start button I will get the data then we need two things write a read area this is the area from the other PRC and a store area this is from our PLC as we are talking about areas here we have to use we have to use some addressing right how we use and can work with data blocks that are optimized and we're not really using addresses anymore I will talk about in the next video right now I would just get this into global memories into without using data blocks right next video will be about using data blocks so Reed area specify the area on the partner CPU that is to be read I remember it it's this stuff here right and first I just want to start with the first one here which is memory word 0 so the start of this is M 0 point 0 M 0 point 0 and the length is it's a memory word so it's one word right one word or one INT it's the same length actually doesn't make a difference one INT or one word right and now it's edit here you can see it's here next thing where do I want that in my local memory hey I also want to put it to memory zero zero and it's also one INT all right so now it's gonna be put into that area very good that's all we need to do that's all we need to do but there's still some smaller issues here let's see I will download that to my PLC here but you are done it's done and I can already go online and whenever I press this button here you see I'm sending a request and it's actually doing that and the only problem I have right now is I am writing here into an area right into an area and if I go to my tags here I don't have that area defined somewhere I have my text tag one which is memory zero zero but that's not really it I'm using memory word zero right so of course I would have to create a variable for it and this is int and now here we go so we're really talking about memory areas where with this is really bit level byte level and so on make sure make sure that this and this that they have the same length if they do not have the same length like this is one INT and this is 15 int it won't really work I will do something but it won't really work so make sure that they have the same length if it comes to on a bit level one integer is one word is 16 bit you will need to calculate a little bit there so let's see I'm on line and whenever I press the button now you see and you hear whenever I press the button I am reading the current number out of the other POC and which changes a little bit whatever the program does with that number I don't know we are just getting it but only if I press the button right I could also add this request input here I could have a frequency like like clock memory so every 1 second or so I'm reading the data or whatever you can also put this ndr but this needs a little bit of logic there as well so the best usually is really to put a frequency of 1 Hertz here so depending on how fast you need the data or really on request whenever you need the data might not need it always so what can I do if I want to also read this one here right it's a real number so we have memory but 0 and we have memory WR 2 which is in total one word towards three words right if I want to read three words I can't just go here and change the length I can just say word three right I can manually change to see if you know the codes or I could also click on the toolbox and I can say hey I want to read three word I don't change see automatically again I will need to make variable out of this state 2 goes here was real and it is memory W 2 now we need to pay attention of how the data is structured and that's also a very bad part about doing it with addressing and not with databases and data blocks I will get two data blocks in the next video which makes it for me for my thinking actually easier but that's that's just however you like it so no I've got the second one here and let's go online here let's go on and here right now it's still pretty difficult to read right let's do it like this it's zero zero if I press the button I'm actually reading the data all right you see whenever I press the button I'm actually taking the data and getting it so what it is I get the data from here and get it in here alright whenever I press the button on the rising that's the get command in the next video I will talk about the use of data blocks because it's not that easy we have optimized block access and so on but we'll get there I hope I didn't forget something if I did if you think I did just put a comment down below I would try to answer it or someone else could also answer it um if you have any questions or anything unclear just put a comment as well if this was helpful don't forget to Like don't forget to subscribe for more content and I will see you in the next video once more new data new data bye and have a nice day bye bye
Info
Channel: Hegamurl
Views: 15,116
Rating: undefined out of 5
Keywords: tia, tia portal, plc, siemens, plcsim, advanced, v15, v15.1, v14, clock, controller, simatic, 1500, s7, hmi, tp700, tp900, tp, easy, learning, intro, beginner, help, training, change, quick, fast, english, german, 1200, s7-1200, s7-1500, data, users, wincc, basic, example, copy, paste, new, plc cycle, start, retain, retentive, dalay, interrupt, time, hw, view, virus, limit, passwort, ip, smc, adresses, addresses, ip adress, ip address, iso, communication, profinet, i device, io device, plc plc, i-device, put, get, send data, receive data
Id: YbxQ1j9gbLE
Channel Id: undefined
Length: 11min 49sec (709 seconds)
Published: Mon Oct 07 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.