Udemy

How to make switch in HMI Screen?

A free video tutorial from Rajvir Singh
Founder, Code and Compile
Rating: 4.5 out of 5Instructor rating
15 courses
129,611 students
How to make switch in HMI Screen?

Learn more from the full course

Learn Siemens S7-1200 PLC & HMI from Scratch using TIA

Learn wiring, programming and Installation of S7-1200 PLC & HMI with Siemens TIA- Total Integrated Automation Software

18:45:56 of on-demand video • Updated November 2024

Learn how to communicate PLC with PC using Siemens TIA
Learn how to convert standard circuits to PLC Circuits
Learn fundamentals commands of Siemens S7-1200 in TIA
English
Alright, so let's start this new project in which we have to make a small button on the HMI screen which will actuate the PLC output. Okay, so the first step is we have to add some devices here. So we'll I will go to add new device, I'll select my controller which we are using S7 1200. I will go to my controller, which is this one 1212C AC/DC/RLY. This is my suitable model. Alright, I will add this model in my device and network section. And I have to check with my IP address. You must note that the IP address which I'm using in my Ethernet board is 192168.0.2. All right, so the one which I want to use in PLC is 192.168.0.3. This is because I'm using a router and it's addresses 192.168.0.1. So I have to make sure that the IP address should not conflict with other IP addresses. All right, so my PLC is here with my IP addresses are configured. Now I have to add a new device which is my HMI. In this case, I'm going to add KTP 400 and this is the model, click OK. And I don't want to have any other screen so I will just quickly navigate to finish. So that's my HMI. So now we'll go back to device and network I want to check the IP address of HMI. So in this case, we are using the IP address 4 all right, if you want to check that we can we can verify this IP address, I will go to, I will shut down this HMI, so that I can access the settings. So in the settings, I can see network interface. So this is 5, I can change that to maybe 4 alright. So this makes sense. Okay, so the IP address is changed to 4. Now I have to make sure it's 4 here. Now to link this PLC with HMI, all I have to do is I have to just click and drag, that's how you link your PLC and HMI okay. So, next is we have to go to my program block in PLC and I will add a logic. I can I can make a simple logic like we have a bit M0.0 and we have an output coil Q0.0. So this bit is going to actuate the coil. Now this bit, we have to make in the HMI, so I will go back to my HMI screens. I will go to screen 0. In screen 0, I will make a button, so the button I can take a switch from here. Now the switch is in the toolbox of the element okay. So drag the switch here, these are the predefined switch. I will increase its size. I have to tag this switch with the PLC tag. For that I will click in the properties, in the properties of the switch, I will take tag 1. So tag 1 is here, my HMI is ready. Now we have to download the logic okay. So first I will download the HMI logic. In this case, I have to just confirm its IP addresses again. So the IP addresses for HMI is 4 and we are using a router so make sure this is ticked. This is okay and in PLC, this is okay. Alright, so I'll go back to my PLC and let's down to the PLC logic first, so click on download and start search. Now this is just for the information that my PLC, HMI, and PC are connected via a router okay. So this is linked. Now I have to load it. Now the program is being loaded in the in my PLC, stop all and click Load. So it will take a while and it will load the logic in the PLC. Okay, so the PLC logic is, is ready. Now I can monitor that to see if it is working fine. Seems like this is fine. So let me just check it. Yeah, if I turn on this bit output is on, this is okay. I'll go back to 0 Now let's see if this can happen in the HMI. Let's go to screen 0, now we have to download this logic in the HMI. So if you click download, and you have to search your rHMI because it will search the HMI in the network. This HMI is here, so click Load. And you can see in the HMI screen, you can override it, click Load again. You can see this Profinet and this is showing transferring. This is transferring the data you can see the screen as well. Now the HMI is ready. So this is my screen 0. So let's see the PLC block. So this is my block. So that's my HMI. So I have to go to screen 0 now. So we can go like this. Now if I click this button, my output should be on, if I turn on this one, you can see that this bit is on. So the simple logic is we have tagged this bit with a tag of this HMI element. And we have just configured the IP addresses. So this is the simple logic to do an on and off the output using a simple switch on the HMI. I hope this makes sense. Now in the next video, we'll see a different types of element on the HMI and how we can use it. So let's take an example, we have to see how we can use a push button in the HMI, we cant see any push button in the library. If you see here, there's no push button. So we have to define this button to work as a push button. So let's see how we can do that in the next video. Thank you