TIA Portal: HMI Linear Scaling

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello hi and welcome to today's video in which we are going to look at a little neat trick that I only have learned way too late after working with a lot of analog values and Siemens HMI Cintia Porter and scaling all right what you would usually do is you would write a little program on your PLC to scale a value we're going to talk about a motor so I have I have a motor that I want to control this motor has a speed I have put like a variable here a tag into my data block here that is of type integer and I want to control a motor speed on an HM I like with the scale what you would usually need to do is this scale just gives the value of this variable here so it goes from 0 to 30 2767 and you just you put in that value that means 20600 is in reality an RPM of 250 something like this so we need to scale it correctly make 0 is 0 speeders motor off and 32767 is 100% of the motor speed right so what would you rather put in 30 mm or 100 percent or 16200 something or 50 percent of course you would like to go with the percent or with the RPM respectively which is of course then in the end this the same that you in the scaling procedure you can use it for both the RPM and also the percentage I would just show you the percentage rpm is pretty easy then on your own so what we have here um I want to show you very quick on my HMI I would just put a bar a bar a slider so I reck'n'd drop that here on my HMI on this slider you can see already goes from 0 to 100 and I want to link this to my pier see here of course I can do that down here properties and there I have some weather tag the processed tag I just select the processed tag here on my PRC it is in this data block and why is that windows off isn't this data book and it's this so now it's linked to the motor speed it won't work yet just the first thing analog values right now it won't work HMI connection will work but let's see i turn on my HMI just the one thing i want to show you because if you're a beginner you will definitely face that issue so right now this slider oh it does work already okay good so I have set it up so it works you see the slider if I go to 100 is 150 is 50 and so on why I thought it wouldn't work is now I have prepared it and before is if I go here in my HMI 2 connections there has to be this HMI connection between the PLC and so the PSE the node here and your HMI I saw I created it earlier in the testing video but just make sure that you have this connection if not new HMI communication won't work you might have to put it in manually I've showed you how to do that in another video check out my videos on this so in back to the topic so we have two slider that goes from 0 to 100 if you were talking about Moto's about any analog things doesn't have to be motors everything analog you would assume zero is off and 100 in our case is 100 percent on which is not the case let's assume this motor here this variable is connected to a real motor via an analog output if you have an analog output then the maximum value will be something 32,767 of course there's some other things in both doesn't matter but this is basically how it works right now if I want to go with a motor speed of 100 percent what you would expect would be that mice that my PSC value would also be 100 right that is not the case right if it would be 100 but everything would be perfectly fine that is not the case the PSC output a 100 percent of the PSC output is something around this value right that's just the output right it's also just this 26,000 something thingy doesn't matter right now that's our maximum so our slider if I want to go to 100% theoretically we would need to put our slider or so to 32700 something so let's do that I can just go to my HMI go here grab this and tell this in the property say the maximum value should be 30 2007 boom right I can now back in my HMI I can rerun the simulation I can go back and run it the only problem right now this is freaking ugly this is useless who wants to go to 30 mm to say the motor should be on 100% right now I can just if you watch the value up here I can't just take the slider and now it is basically this is off motor off and this motor completely on this is approximately 50% there is approximately 25 and so on that's a little ugly so what I want to have is a scaling it is scaling so that 0 should be 0 and if I put this to 100 we should still have the Turtle 32767 years of the 100% so what I want instead of this right I want the slider value in a scaled form right usually most people most programmers would just put in a program and your PRC that would have like a little mathematical formula just dividing by 100 and multiplying by the value that we want that's that's the way easier way way way easier so this I just want 100 because that's 100 percent this should be 75 because that's 75 this should be 50 this should be 25 this should be 0 right so I want my slider actually scared to the real physical output it could also be like this if this is 2000 rpm right then I want my slider this should also be 2000 all right of course that should change the others as well but you I hope you get the point I'll show you later on yeah so how do we do this usually you would create this in a program I would go in my Piercy there's a scale block there is somewhere in here I can search for scale there is especially a scale block for this right short in another video how to do it there's a way easier way right now and that is pretty hidden most experienced programmers also don't know that this exists we can simply go to our HMI there is an automatic scaling feature in the HMI so if I go here click on HMI text on my default text area from edge I know it's great I was when I looked a little straight right now unlike default tech table format HMI I my HMI right now only uses one variable this variable is called HMI core motor speed on the HMI it's type integer needs to be integer for those scale things you need to have an integer value alright for those bars and sliders and stuff the HMI is just use integer values that's the PSE tag so we have the Pier C tag that's what it's called on in the PLC program that's what it's called on the HMI between those two we can do a scaling you can't find it it just by the way I will just put the acquisition cycle down here to 100 milliseconds because now the update is then way faster with one second you have to wait until the value updates for one second no I want 100 milliseconds so yeah so where's the scaling the scaling is a little bit hidden you have to select your variable here your tag and you go down to your inspector window there you have properties and in properties you already see some things all right you already see some things here that we can actually do we can multiplex emu that's nice I didn't know we can't do what manufacturing practice when is this impure I don't even know what some of these are in here we have more info infos about the variable we have actually selected up here in properties properties there is the range for example I could choose upper and lower ranges by just saying here hey upper limit should be some value I should be able to go above 100 or so not gonna do that right now I don't I'm not talking about limits we talk about linear scaling right there's linear scaling I can activate the linear scaling for every single variable on its own right and now what what do I want to have on the HMI and Piercy it should be a bit different on the HMI if I have a zero right that should be in the PSC also a zero add up side if I have on the HMI 100 that should be if I have a 100 on the HMI that should be the 32767 on my PSC because that is the same as 100 percent for the PSC we need to do it because the PRC thinks that's 100 percent so I'll type that in here all right I typed that number and that's it that's it I save now I go back to my simulation I reopen the window so that that's all the trick usually you would need to write this into a program and stop no no need out wait I still have to change my slider actually let's change the slider back to 100 because that's our maximum value right now so I go here and I open this up and I can at the same time reopen my data block here and now if I go to zero all right you see in the data block it's also zero if I go to 100 so what what would you expect 32,767 if I go to 50 that's exactly the center right that's exactly 50 percent and so on so you see the scaling automatically happens not without me having to write a program on it or so you can just activate it and say the scaled values and so that is pretty nice now if you would like for example hey you want to control a motor speed right you want to control the motor speed directly and let's say your motor speed is not just 100 or it is 2500 so what do we do I go to my root screen here I change the display here the maximum should be 2500 all right and then I go also to my variables in my HMI right that's my variables and I just say on the action I if it says 2500 that is the same as 32767 on the PRC that's it and now we're talking about revolutions per minute per minute rpm right pretty simple it could be anything else right that's that's just scaling very simple way of scaling so 0 0 2500 you see it is our 32,000 something in the center is something in the center and you see everything in between is linear scared yeah so a very nice feature if you ask me very nice feature I have found out about this way too late usually I would go to my to my program and actually use this scale block which of course works as well but you see it is well now I have this in the program and it's a little annoying to write that and if I want to change something hey where do I change it and just just do it the good way just do it the good way don't do this and if you still do it if you if you did they always did that and you want to continue doing that feel free alright that's that's definitely up to you but I found out about this and I thought this is awesome that's actually a great feature to have good great awesome yeah if you've got questions to this just leave a comment below someone else might answer I will try to get to it as always or also you could check out the link in the description below to our forum that is growing and I should definitely look more into it so you see a lot of people doing a lot of things here great awesome it's growing thanks for that awesome I love it and the next thing and the last thing is of course if you want to support me because I am doing putting a lot of effort into this you can go to in the description below you can go to my GoFundMe just click the link and there is something like ah donate now I think and you could donate just toss some coin in my direction that'd be awesome and there's some people I don't know who I have thanked already I think I think I thanked those Frank I think I haven't thanked you and anonymous thank you as well great awesome thank you everyone for watching right thank you for liking the video thank you for sharing the video with your colleagues and friends and I will see you in the next video while I'm working on my new tank system if you haven't seen it check out my videos and my posts on my factory simulator tool that I'm building awesome stuff I love it so yeah have a nice day stay safe and healthy and bye bye
Info
Channel: Hegamurl
Views: 9,324
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, navigation, change, quick, fast, english, german, 1200, s7-1200, s7-1500, password, wincc, flexible, basic, runtime, simulation, example, templates, screen, screens, touch panel, touch, panel, new, new user, operator, key, appearance, visibility, language, alarm, alarm view, alarming, error, display, popup, pop up, linear, scale, scaling, scale_x, linear scaling, skalierung
Id: aDIS59mrFhM
Channel Id: undefined
Length: 13min 48sec (828 seconds)
Published: Thu May 07 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.