PLC Programming without a PLC - Entry PLC Project | Generalist Programmer | Skillshare

PLC Programming without a PLC - Entry PLC Project

Generalist Programmer, I am the generalist programmer

Play Speed
  • 0.5x
  • 1x (Normal)
  • 1.25x
  • 1.5x
  • 2x
12 Lessons (1h 15m)
    • 1. Introduction to PLCs

      2:54
    • 2. Introduction to a real PLC

      10:47
    • 3. PLC Analog vs Digital

      7:35
    • 4. Interacting with a PLC

      5:06
    • 5. Power supplies and wiring

      5:14
    • 6. Wiring a PLC

      3:51
    • 7. Installing the PLC software

      1:53
    • 8. PLC Programming - Setting up a Simulator

      5:26
    • 9. PLC Programming - First Programming Project

      11:21
    • 10. PLC Programming - Memory Bits

      5:08
    • 11. PLC Programming - Memory registers

      8:21
    • 12. PLC Programming - LD LDI LDF

      7:16

About This Class

If you want to learn PLC Programming and get started with PLC programming this class is for you. We will start on a project where I show you how to simulate a PLC with software and then build your first PLC program and project.

Transcripts

1. Introduction to PLCs: what is appeal? See, what does the word people see me? Well, that stands for programmable logic controller, which basically means we control various machines and apparatus using programming logic, using electrical signals. So let's quickly talk about the concept of a pill. See on how it works, what sort of types of PLC's you get and what is the purpose off. Actually, Learning PLC's so conceptually, the PLC works on the basic principle of inputs and outputs. Generally speaking and input would expect 24 volts signal in most PLC's and give a 24 volt upward in most pill sees the up. It'll generally turn on a contactar or a really, which is like a mechanical switch, which is powered by a 24 volt supply, which will, in turn on higher loads. Such a fool, your machinery or apparatus such as mergers and pumps, and any other equipment that requires higher current. Generally, they are two different types of PLC's as well. Some are Relay PLC's Transistor PLC's, which is inputs and outputs, which are type Each of these types pill sees have the own purpose. So, for example, Transistor PLC's are generally used in high speed applications because off how transistors work, they can quickly switch inputs and outputs on, as opposed to realize which have mechanical levers, which are slow to react. And, um, I mean Teoh close mechanically before they can allow current to flow. So I learned PLC's PLC's are used all over industry for controlling machinery and manufacturing processes. So think companies like which makes soft drinks the bottling sterilization. Think about your local city with these traffic lights. So anywhere with this electrical switching being done in an intelligent way, the PLC is probably at the heart of it. Due to the fact of this, that PLC's are being used in most electrical applications, which have some complexity. There's a huge market for PLC skills, and they're growing. So dive into this course with me and learn more about PLC's 2. Introduction to a real PLC: For our example, PLC's I will be showing your two different types of Chelsea's one, which contains digital only inputs and outputs, and another rich contains analog as well is digital inputs and outputs. This first we start with the D. V. P 14 s is to from Delta. So this is the D. V P. 14. Ss two is one of them or intraday level models you will see in the Delta Range. So let's look at what this pills he has to offer. So first of all, we've got this indicators here on the top left, which are just basically led ease, which indicate power state, Iran state in the estate. So power is quite obvious and basic. It just indicates with the pill sees on off the run, like basically indicates whether the PLC is actually executing the program, which is inside the pill. See, the error state basically can mean a few things, such as there's an error with the actual program, and it's not running the cycle correctly or the PLC has lost its its program. So this often happens when basically, PLC's have batteries, which allow them to store their programs up until but 10 years, and then the battery needs to be replaced. And when you do replace the battery, it can potentially lose program. So this is something to take note of, especially when you're working in the field. Not too. Pull out the battery without any good reason. Otherwise, you may lose the only source of the program that you've got. Usually, this only happens after many years are. Usually the original program isn't available even from the manufacturer, because that may not have it on hand. So this can cause a lot of problems where you need, Teoh reprogrammed the PLC, or it's gonna cost the client or the customer a lot of money to reinvent the program, which was in the pill. See, originally, Mother isn't while cnnheros state, as if the program has some error and cannot executed cycles. Or it just has some other fault, like memory is full or something of that sort. So the next thing you see year is the run stop switch. So this is just a physical switch we can use in the field for debugging or fault. Finding the reason why we when I use it, is because when we get to a field project and we see appeal. See there and there's maybe some fault on the machine. We would want to taste it by triggering some input, maybe, like buttons or sensors or similar types of sensors, which are connected to the inputs of the Bill C so generally will put it into the stop merge. Because we don't want to unintentionally execute current, which is in the pill. See which could in turn on some outputs, which could maybe turn on motors pumps, which potentially could damage the machinery if it's not operating correctly. So the next thing you'll see year on the top right is the in label here. So the first terminal just blood that is ISS, which basically stands for sing source. So we're going to more dips on this in light of directors. But for now, all you need to know is that it operates similar to N, p N and PNP configurations and transistors. Then the next. Really, here is X era Terminal, which is basically the first in paternal on Delta PLC's adult appeal sees. X is followed by numeric values are usually inputs, so each of these green terminals basically has other relay or transistor, which sits behind it, which then allows current flow for impressive, energized or not and moving down to the outputs. Be looking at wiser y one y two. Similarly to the inputs. These are labeled with a while and numeric value, and once again they could be transistors or realize which set behind these terminals, then moving down to this round plug here. Generally, we called us a done female plug, which in Delta PLC's or A pens. But you can see all sorts of different configurations on Different PLC's, for example, and Panasonic. You may see £5 and other pills is full pins and even some I have £9 so it is good to just become accustomed to this and understand what each of these pens on this port actually mean . But in terms of the Delta PLC, this is Rs 2 32 Port, which we use for programming the pill. See and communicating with the PLC as to the artist to 32 communication method will discuss this further in lectures a hit. So don't worry too much about that right now, but we will go into more depth about Rs 2 32 So let's turn this pill, See, just just to show you the bottom So you will see these the screen terminals here and above . It is something that's his chorus for 85. So again, this is another type of communication method like RST 32 which we just saw. And this is usually use for external communications, usually with devices like Actualize or Other PLC's, which are connected, and Daisy Chain, then below that will see the power terminals, which will be the 24 volt D C zer vil D C and Earth Cold Ground Terminal. So turning the PLC on the side just to show you how we mouth pill. See. So, for example, how this will be mounted in electrical panels in electrical panels, There will be a done railing, which is mounted to the back of the panel, which the pills can then clip into. Just to show you how this works, it is going to show you the clip and how we actually mounted start to you. Firstly, just loosen the clip I need Teoh Pool is back. We'll see that it allows a bit more space and then that can be attached to the general in the back of the electrical panel and then just step back to allow it to be secure. So the next pill semen me looking at is the D. V P. 26 to she's a little bit bigger than the previous one. So some of the things you want to know Chair is that we've got these additional led lights use be for us to 32 or is 45. So there's just give you but more of an indication off how the pills is communicating over there. It's a very sports. It's also got this many years be port, which can use programming as well. It's also got Doris to 32 open once again and in just the big difference between this pills . Er previous one resource that it's got compatibility with some analog inputs and operates as well. So you'll see your a slash d, which is analog to digital conversion. And on this side there's digital to analogue conversion, generally the analog type in input between their 2 10 volts or 4 to 20 million times, and then interpret that as digital signals inside the PLC, which the program can then use to do different operations and below. Here we've got digital a digital to analog, which allows you to update some ranges between their 2 10 volts, 4 to 20 million times so that it's like the different types of input you gets on the side again. We get digital, decided, get analog. We go into more detail of how analog and digital differ in lighter electors. But for now, I think that this is a great start for you to start identifying pills. He's in the field, understanding the various different communication ports, how to switch them into the stop mode, how to actually dismount them from the done rails, using the clips. Just one last thing to show on this feel. See, we've got an expansion port over here. So what we can use this for is if we've got lacking off inputs or outputs on appeal, see, we can add additional models to the PLC, which will then allow us to have more in prison outputs. Andi, that will allow us to just work with bigger projects. On the bigger project can be 256 inputs and outputs at a time, so Hopefully, this is a great introduction to PLC's and you will be able to know, identify them, understand them. And now that they are actually the in the project that you're working on, see you in the next lecture. 3. PLC Analog vs Digital: Hello! Log versus Digital. With previous lecture, we looked at to Physical PLC's, which had digital inputs and outputs and analog inputs and outputs. In this lecture, we just going to go into further detail of what the differences are between analog and digital on where you can use them in your projects in industry. First of all, it started on analog signals. So in a lot of signals are voltage signals, which really between a range typically and look signals are between their 2 10 bolt or 4 to 20 million EMS. In some cases, you may come across some PLC's in the field, which only supports 0 to 2 involved rangers and not for 2 20 million brainers. Where is your sensors? May only support for 2 20 million and signals you may need to do some conversion from 0 to 10 bolted 4 to 20 million and rangers. So in order for us to do this, we can simply just introduce a resistor which can then take a voltage signal and converted into a milli M single signal, which we can use for reading analog signals in our PLC's. So, just to explain further how analog signals are actually used and how they do work in. For example, we'll look at a scenario where we've got three tanks. So what we'll do is we'll have sensor, maybe a level sensor which sits inside of this tank. And this represents our tank and this are actual level of liquid inside our tank. So in this case, we are about 50% full. We could possibly expect the five volts signal which will come back, which would indicate 50% off the level of the tank. In this case, we are empty, so we could expect zero bold signal to come back. And here we are full so we could expect tingled signal to come back. So there's these different levels off signals and voltage terms we convene, convert them into values which we can use inside of her appeal, see, in order to actually make some decisions. So that is basically how analog signals work. All you really need to know is that they are a way off measuring levels of things or values off sensors and field and make it represented in a voltage or a milli and range or value the next list. Look at how and look signals are actually represented on the graph, just to give you more detail how it actually works. So look. Signals, as we said can very over time. So you'll see here. We've got our voltages on that time so I love signals can fluctuate between a maximum and the minimum value and out case. This will be our zero hold value on a tin bowl value. As you can see, it can give us different readings based on whatever signals we're getting back from our senses. Not all analog signals follow this exact son little graph. I can very They can have portions which are square waves intermittently for different sorts of readings. So hopefully this gives you a bit of an idea of how in Iraq signals actually work. Let's move on to digital signals. The digital signals are bolted signals, which have one of two states. Usually it is a zero built for a 20 full, bold signal most people sees have a terrible through 24 volt, my own name for the digital inputs and outputs. However, they're all different types of pill sees out there, son do have a zero vulture, 12 votes digital i o. But the big industry level standard is definitely desirable to 24 bold signals. So this is what you'll see most typically in PLC's in the field. So just another thing we need to talk about. In terms of digital signals, there are things that we call rising ages and falling ages. The falling edgewood essentially ramped down the voltage from 24 volt to zero volts almost completely instantly, just due to how electrons flow at the speed of light. This sort of voltage drop can happen quite quickly. So just to give you a bit of background on where we will do get digital signals, it could get them from inputs like batons or proximity switches, an example of where digital signals will be used. For example, in a box sorting application where we will take the box, which comes down a conveyor and passes past approximately switch, and then that give us a signal to let us know that the box is actually a certain point on the conveyor belt, and then we can obviously do some logic around that to decide what to do next. So just to once again, visualize digital signals on a graph about voltages and our time. So in this case she will have a falling edge where it goes from training full vote all the way down to zero volts almost instantly. That signal remains for a while, then brands up with the rising edge to 24 volt. Almost instantly, Old said, input for a while and drops off site. From this graph, you can actually see that digital signals are a lot like binary by other owner, both true falls. So digital signals are basically just used. Teoh indicate states or do some form of detection off the imprint, like a pattern or a proximity switch. So actually, this will give you a good idea what the difference is all between digital analog, where any log has gotten variances on digital signals have two states. We can use these two different types of ire for very different things in the field. I hope this has been useful. See in the next lecture 4. Interacting with a PLC: so interacting with PLC's, There's talk about a lot of different types of connectors that you might see in the field. We're trying to connect to people, see or communicate with a PLC, or either to connect appeal, see maybe to another device in the field, maybe a PC workstation or a server, or even H of eyes and different other field devices like frequency drives. So let's look at the result. Will this first pin, which is quite a gold pin connector, 25 10 0 connector? They'll see these, usually with older PLC's, which quite outdated. So just to take note of this that if you do see this, you need a 25 pin connector and probably one of these converters as well. So that takes the 25 men and converted to one of these db nine standard pens. Makes this look at this pendant like so we traditionally used these on Delta PLC's so quite common to see in the field they've got a FireWire plank, which only some people see still use. But for the most part of these actually get used in frequency Dr Programming. But you do tend to see the sometimes in the field as well. For PLC's meaning Years report are printed Years Report our Ethernet cable female DB nine flag, a male DB nine flag near where we made up a cable specifically for an application because we could not find this cable. So I made up this cable just for a specific project on purpose so often what you'll need to do. Sometimes you'll get appeal. See, which should. I never programming cable four. And you actually need to go look at the schematics of how the cables are made up and actually make one of your I'll show you an example just now in this video of how this plague was actually made up. Then we've got our regulators be port as well. And just another thing that you need to know is that usually most of the comports on PLC's ours to 32. So you need a converter, which will convert your USB port on your PC to Norris to 32 port side, for example, on this blue converter here, it's actually takes your years report and converted to ours to you 32 communication port, which you can then use to actually connect to your PLC. Another one that you come and you see, is this little box which is touch to the cable on its what we call a prolific USB to serial device which actually been converted to cereal or ours to 32 communication methods. So what you will often see is little legs like this. I'm gonna show you exalt blood. Were we made up that other cable so often? See these on you will probably come across them quite often when making your own cables because these sort of ports are extremely common in the field as well. So just to look at the cable being laid up, which is in this well, I'm just going to show you an example of how we actually soldered it. So this is what enclosed one looks like and just take that up there just to keep it insulated shares an example of how soldered So we have a female DB nine on one end, which is then sold it down to the back of these pens on inside. The don't, like, basically looks like this with some pens at the back as well. You'll see it's a five we use this for a very specific purpose for Panasonic pill seed, which is cables available So you have to become comfortable with making your and cables figuring out how to communicate with PLC's. Because often the biggest problem with PLC programming in the field and the bagging is actually the communication between your PC or software and appeal. See, so I hope this has been a good introduction of different ways you can communicate with PLC's what sort of cabling you get hard to make up your own cables, so see you in the next lecture. 5. Power supplies and wiring: So let's talk about the wiring of the PLC. So this unit here is a power supply which takes a 100 to 240 volt. I see power supply and converted into a 24 volt 2.5 supply, which is for turning on our PLC. As you can see from the bottom is appeal. See, over here kill. So you can only take an input of 24 volts DC as a power supply. So we have to use the power supply, which we can then provide the 24 volts to appeal, see for to turn on. And also, we need one of these little chief electrical bridges. As you can see that I've got some terminals and some screws inside there for us to actually distribute our power to our buttons and the inputs that we're going to actually be attaching to the PLC later. So just to explain what we actually going to be connecting Europe for there we're going to have our earth from our power outlay to be going to have a neutral and alive. So in my country, currently, the the live is a brown wire. The neutral is a blue wire on earth is a green wire, but maybe in your country it's a little bit different. So you will just have to go. What's the color cards off for your country? Always remember when working with I see voltages or any voltages at all, just to make sure that the power is actually connected when you do start wiring things up and that everything is turned off. So here are terminals for the voltages for the 24 volt DC so there's a plus and a minus will actually be connecting their up to our bridge at some stage. I mean, running that out to appeal, see for it to be powered on. So I'm just going to skip ahead with this video and do the wiring, and then I'll explain to you what I did and how I wired it up. Okay, so we're back. So as you can see, this green wire is our earth wire. I've got a neutral and alive, which is our 2 40 volts in my country. On us, it is. I think it is 1 20 volt. So this willpower on up power supply and then it will actually be in up to 24 volts on the sides have connected and negative on a positive wire, which is in hooked up to the bridge. Let me show you how that has been connected. So you can see here the positive and negative or going in here into these terminals. And then basically, what is done here is this wire over here has been bridged over to this terminal on this wire here has been bridged over to that terminal. Then on this end, we've got positive power cord off the people, see, And we've got the negative power point of the PLC. So then, at the end of that, we've got this little plaque, as you'll see, has got a positive the negative this and then basically, that just gets plugged into the people. See, like this in the metal ding. Allow us to power on our PLC with the 24 volts from our power supply. So just some all safety tips before feelings on Just be sure that you're not going to be touching these terminals because there is going to be some a c voltage on your which can hurt you. Or actually, it can kill you if you're not careful, So try not to touch, Tried to cover it up or just put it out of the way so that you don't touch it in any way. Usually these come with little plastic clubs, which can clip over here to protect you from touching the terminals. But also then just remember that for you to avoid even more risk, you could just have to make sure that your wiring is actually properly set into the terminal On my wire is actually sticking out at the end. Out of this and all the wires are loose and between, she just jumped out and jumble over and actually touch you. So just be aware of safety at all times being working with a C voltages of any voltages, for that matter. So in the next video, I'm gonna show you how to wire up a button which we can and uses input on appeal. See, sitting in the next lecture 6. Wiring a PLC: So let's talk about wiring up digital inputs to our PLC. So in this instance, you'll see there is this little unit, which is industrial, but usually this is the bare bones of that. We would usually mount around Big Button on here with an led light, which can also be powered, which didn't gets mounted on two panels but for simplicity have left that open so that you can see that we've got these terminals here and that actually wire up the wiring and then script down on both ends. So these come in two different variations, so this one is normally type in, which is a conventional switch where basically, the switch is always open by default. Then we've got another type of button like this, which is normally closed. So usually that's what already allow current to flow from this to Lord to that terminal on . Once the button is pressed, it will then disconnect it. So that is the difference between N. C, as it's called and normally closed and normally open Butel. So just to get back to the wiring, But if done here is we have connected to the sing source zero volatile the negative terminal and from here from eggs zero. We've connected to the button on this one side, and this wire runs in to the 24 volts supply on our bridge. So how the PLC basically decides whether input should be energized or not is it basically does a comparison between what the sing sources in and what actual voltages flowing to the input. In this case, you've got a zero vaulting source. So 24 vault will then energized Xterra in the case off placing a 24 volt er in a zero voltage will then energized x zero. So this is different ways of how we can have P, m, P and NP and configurations on the PLC, as we have discussed earlier. So let's just give us a guy so you can see how it works. It's true in this thing up, We'll see you. Currently. The PLC is in the run mark, and we've got no input coming on at the moment until we actually press the button so we'll see how it didn't light up. And it's actually getting the input from the button. So, as we previously discussed that, if we want to do some fault finding in the field. We could didn't take the pills out of the running load. And it can actually still there press buttons on trigger senses to get actual values on the inputs. So hopefully this is me in a good introduction of how to actually wire digital inputs, well, buttons to your actual PLC so that you can start tasting it and all of that for those who don't have a pill. See tow wire. Full discourse. That's fine. Already really need to know is just the practicality behind it and how to actually do it. It's not necessary to actually go and get yourself plz, too. Try and do this, so just use what you've learned share to just apply in the field and always remember safety principles. We're touching any electrical equipment. Make sure that everything is often turned off. See you in the next lecture 7. Installing the PLC software: before we can start. That's our policy programs. We need to get some software Richard can use to actually write our programs or a ladder diagrams in. For this course. We're going to be using a piece of software which is free from the Delta website called SP Soft. So in the resource of section, I will just leave the link to this page for you to going down. Nerd sp soft. Another piece of software we're going to be using for simulating PLC is something called Comin g R. So you would need to get that. So just to run you through how to get the software one. Sure. On this page, you make sure that you have got industrial automation selected and anyone to go and select . We'll see programmable logic controllers and premier. We want to click on software and hit submit. And then, from there you wanted down discovered G O. R. The latest version at the point of making these videos 1.9 start down with that and also the latest ice piece off 37 So once it's downloaded, just unzip it. You will see it could be a zip file here and just install it on your machine. That is in these pieces of software. And in the next video, we will actually sit up our simulators So you don't need a physical PLC to start programming. You can just use the common gee are simulator to simulate odd repeal, see on your PC, and we convinced our programming, See in the next lecture. 8. PLC Programming - Setting up a Simulator: Hello, everyone. Welcome to lecture one of the many adults appeal. See, Program. Of course. Today in this course, we get to start discussing Delta PLC simulation on how you can achieve this. And this is maybe just four people who don't have Audrey PLC to play around with to try out some Delta bills. He programming techniques. So we just going Teoh quickly, just go through watch. Could be learning in this first lecture. So we're gonna be installing calm g r and I S P soft, which is the two main Softwares, which allows us to right our code and also for us to create stimulator, which we can to stop occurred on. And we're going to be sitting up the Belt PLC programming somebody later on the right, a very basic first program. And we just going to play around with inputs just to show you how we can, like, test our program in online mode in the software. So, first of all, you just want to guard Teoh good belt, uh, website, but in the dominant center. And then you would want to select industrial automation, xliv product subcategory and slicked PLC programmable logical colors. You'd want to select software and hit Submit the two pieces of self. Very going to be downloading is contrary. Our version 1.9 justices the flowers here and I ask you soft version 3.5 So go ahead and like down on that and install it on your windows machine on. Then I'm going to now move on to sitting up the actual simulator. First of all, you start with comb G. R. So I've got a few connections they already set up. What you're going to do is click on, add on. We're gonna call this simulator on, gonna make the type TVP simulator. Just take note of the device sitting. So th two is the old Siri's. He's gonna say OK on gonna select a simulator and click Start next. We're going to open up this piece off. So this is what you get in the beginning, when you haven't started, a project of religious is gonna found you on creating new projects. Politest project. Andi, basically, we need to matchless too awesome Electric PLC types if you go back to ecology, are just see what made it. It's the edge to SP. Siri serviceable to match that to the edge to Okay, so now we given a new project on the first thing we want to do is just go you Teoh programs and click on you. So I've got a few different types of languages we can use. We can use letter diagram which most people are familiar with. I understand constructionists and sequential function charts. Well, this tutorial, we're just going to do the latter diagram. First thing you want to do before we were stopped writing any letter card, the lecture that our communication settings is correct and that we've got it allocated Chelsom emitter. Okay, I can actually start typing out a program first, but it is just click on the first round. It's space for all the dams there. So this will be our imprint. Good game, Space bar up on one. Well, we need to do to compile a program and goings on my motor contrive and simulate. This is to take on online inside as a politics Do you want? Oh, yes, we do want done with the current printable till see, So this will be a virtual simulator. Kelsey. This and just one thing to marriage here is that you need to make sure that the semi lecture is in run mode. Viruses stop. So in order to could have been to run my kick this run. But here and so Yes. Okay, so just my truth and run. And once that has happened, you can just click on input and set it on, and you will see that m one will turn on. So, guys, that's that's all for this tutorial. Just to show you how you consume, emulate hard repeal, see on a computer so that you can start writing card and testing occurred and so on, so just 9. PLC Programming - First Programming Project: our guys are going to election of the two of Delta PLT programming Many course if you've been following up until now. In the previous lecture, we set up our belt ability programming simulator so that we contest out occurred and writing programs actually, suddenly late them on our PC as if it'll hardware PLC list electric. We just going to cover some of the basic fundamental programming functions Teoh read inputs Cruz energized outputs say things so that they thirst and also do some resetting so that we can refit persisted outputs as well. So just to get started on open up soft Onda, first thing you're going to do is just going to get over Teoh Lift bar here, click on Programs on we're gonna write a check and click on you. So what we're gonna do is we're gonna just do some light of diagrams on for those who don't know what letter diagrams are. They basically got their name because they look like letters. When I click a care, you'll see that got this First Network network one. This is also known as a rung rung with part of the actual leather, and it's actually the steps of the letter, and that's where that the diagrams get their name from conventionally. They were used because they were easier for folks, which the electrical work to understand because they follow the same sort of logic and relays. So if you want to like, for example, at another run in I S P soft, you just click in this programming well and click on one of these errors Teoh, either in suit search one before they strangle after the shrunk. So we're going to do is just considering often this run they got to run to play with. And let's just start with very basic function. 1st 1 is just click in the first round. It's space bar and type LD James Era L. D is just basically a function which allows us to get an input on when it is turned on. It will allow the rest of the wrong to execute. For the conventional programmer, since is a lot like an if statement and M zero, like 1,000,000,000 on for our electrical guys. This is like a switch where we push a button and energizing in the last current flow once you get your LD in there in there. Click OK, and you'll see that it creates a little boxer on the left. Implied usually on the left. The inputs will allow Sit on the left and are up. It'll sit on the right. Well, on this front, click again and space bar and type out in one Just for this example, We just great Teoh delete. This rang for now. We'll bring it back later. Now what we need to do is just go back to communication sittings and make sure that got us in the later selected click on OK. And from here it just click on online mode handle, So Okay, Yes, we want to download. Okay. And OK, and then basically just need to make sure that this is in the running snake. If it is not, then you'll just have to click on this button to run. If you stop the simulation just clicking stop. So now in the run mode, And just to show you how this actually works, you required out in one. That means it is an outfit and you're retired all the era, which means input and what we can actually do. Well being online mode, click on this right click and we could sit on and you'll see that this execute and this executes turns in one on so conventional programming. If m zero then in one, let a diagram programming. If this switches on current flow and this it's ritual, all this component will turn on. Whatever that may be is to look at a couple of other assumptions. We create another running here so strict on this pick back on the second run club space bar L D I and to so L d. I is the inverse of l d. Start when it is, or then this Lionel energized and run whatever function is on the side. So let's pick her out at in our three go back online, you'll see that entry is turned on. So what we're gonna do is just click on your way to scrape it off so you'll see when it's off in three on, sit on. It will be in bursts on turn into. So out is basically used for a nun. Persistent bets. So basically any of these values do not allow current through allow this condition to become true, then these actions will always be like turned, or let's look at a case where we can make this bit persist. So let's just go out of online load. Create another again. Just for this is something I will be in four and again the Space Bar Place 65. The States will basically consist in five when enforced, turned on just to prove that contemplates corrections online. Married? Yes. Okay, okay, so I turned him for on and turn it off and we'll see that in five stays on. So in this case, if you wanted to turn on output on and keep it on for the program sometimes reduces full, like status changes within the program just to have bet on which last to keep a steak. But what a share to what I wanted to de energize in five. Some state. What would you do? And this again just another bottle. Unload and create another room. Let's tol be six on at R T as a function and five touristy bicycle stands for Reset Onda. I think it's quite obvious what this is going to do, but it's going toe online load and just demonstrate what it does. My great Liston import on so in Friday's on genital and five remains on, Let's turn em six on and you'll see that it resets in five back to its original state. So these are some of the really basic functions that you will probably used in your programming, so get to know them quite well. But we'll be here. Let's look at some other things you can do. For example, we could add in an additional condition here, let's get out of online mode and it's picking their sigh and, you know, seven basically in there, and M seven needs to be on in one on against God's online note. And huh said that until CN one is still not on until him civilians on on an M one or energized in their eyes or also not in a job so there, for these two need to be on well, conventional program is what has happened here is we had elderly in there and in seven, so that would have been if conditions for those two, it's to be all or true well in one to be true on for your electrical guys. Once again, no current can flow because there is no current basically at the source or if this one is off and m one is on current conflict through two in one. So some other things you can also do issue Could dio prism pull or came eight that in online murder just to show you what it does, we'll see that in three is now on that. Let's turn this on so that entry is not enjoy in a So, basically, if into in a condition is made in, three will turn on. So that is how you can chain different bits around or use them in parallel. And then do you sit logic with it? And that just makes it really useful because the pen on its basis in the city on all your functions on, like a logic that you want to do on guys. That's basically for this video. I hope you've enjoyed it. If you want to see more of this many cause, subscribe to our channel, hit the notification bell so that you could be notified of any future videos. If you would like to support us in any way, you can also book consulting times of that through our website. If you need any automation help with any of the existing automation project. And thanks guys on. Glad you guys watch this. And I hope it was useful and painting. See you in the next one. Just 10. PLC Programming - Memory Bits: Let's start tasting ours simulator by writing our very first program. So go into SB Soft. See you're on the left hand side. There is this auction here. Cool programs, right tickets and click on You. So here you'll see these different types of languages. Creation Most PLC program law written in letter diagram, however instruction. This is also quite popular. That's why, in this course, people be covering but its variations, obstructionists and better diagrams for you to get a better understanding our how the different languages look and also to allow you to actually take over other projects in the field. If there is instruction, this cool ladder diagrams available for those PLC's all those programs. So that's visible to start off with a basic letter diagram just to test our simulator. So click on that a diagram and click. OK, so first of all, you'll get this. So just click in this box and hit space bar and this little window should pop up. Talkin all the 00 is Ah, memory bit and L D is a note. Contacts are elusive. Okay, so you'll see it sits here on the lip, so usually everything sitting on the lift off this network is inputs, and everything on the right is outputs again. Just click just off to the side. Here it's space bar and type out in one. That's just another memory bits and click. OK, so from here, all we need to do is just go to this button here, online mode. Click on that, and that's going to ask you to compile the program because it hasn't been compelled it. So Okay, that's fine. And from there it's going to ask if you can download to the simulator pill. See? So that's a yes. So now there's gonna be a transfer process. All of this will be the same in a real hard A P L C. Being just sending tumor. Just to make sure is that this little box of the here save ran. If it does not, in your case, then just come up to you. This pattern here, and you can click on ran or stop to stop the PLC or put it into Stop Murdered. A zit previously saw another lecturers with, for example, with hardly a switch here. We can do it by the software, so just make sure it's in the run load, and then all we can do is just go down to here over this and right click and sit on. So now you'll see. When M zero comes on, it energizes him one. So that is, offers letter diagram program. And as you can see, it's actually working with the simulator. So let's not similarly do something with instruction list. So what you need to note is that you call in program while it's him online. Is this online? It admired option, but it is not supported within the simulator. You can, however, use it with hardly PLC's, which allows you think Teoh edit the program while the PLC is actually running. So this is very useful in the field as well, because you can day go and change the program and actually see how the machine acts based on your changes all in real time. So anyway, we need to know, just got out of online, my dear back of its programs Go Teoh my click and take new again. Just go down to instruction list this time and hit OK so you will see instruction list is a little bit different. It's pretty much a same some taxes. What type in the leading diagram, but it is just structured very different. It's in text format instead of actual network or diagram, which you saw previously. So in this case, we're going to type in our weekend to on out three. So now that we've got the basic program just hit online again, okay? And let's just alerted to our pill, see? And again, just make sure it is in the run murdered. So here we just got into this and we had sit on a Z. You can see it turns on in three. So those are two very basic programs that could not tested with our simulator to make sure that you get to this point. Because in the course lectures to follow, there's going to be more advance programming and more concepts, so you will not be able to follow along if you don't have your simulator set up correctly. Thanks. So I hope this has been useful to you. The next lecture 11. PLC Programming - Memory registers: Let's talk about core concepts off memory in PLC's in general, this lecture is going Teoh cover the core concept and not be too specific over one sort of brand of PLC. Because most of these concepts actually do exist in most of the pill. Sees that you do. You get so having a look at one of the Davis useful that this is to Siri's and Delta we can see on this list. There are quite a few different types off memory bits and memory registers that we can actually use to store data and even states within inside our PLC's. So having a look just at the very First World this exemplary relay, which is this register, if you remember correctly from a previous literally used to memory but Teoh turn remember, but island being given out put another memory. But so these memory bets can actually be used to hold states within our program without actually affecting but physical outputs on pill see or the inputs as well. So there are a few different types of when we bet such a gates. In this case it got the general memory bent, which we can use for the storing temporary values. So what this would mean is that if the pills here Teoh power down, we would actually then lose the state off these memory butts it conceive that range of the memory roots where actually set in the pill, see the next one has lashed or what we usually call retain to memory. In the case of Beltre, we call it alleged, but in most pill sees, we talk about retentive memory and registers. These registers usually have Maura tainted ness, and they retain this state even when the PLC is turned off, so that the next time in extra starts up, we can start the pill, see with their states once again. So just a few other things that we need to note here that we've got the special memory bits . Often these are useful sitting with people. Seeing These may differ from PLC to PLC, but usually the information is quite easily accessible, and you can just find out what each of the memory but actually mean. So we've been further down, got the tea memory bit, which basically stands for timer, so there's different types of timers. In the case of this data sheet, you can see that Timers Teas era up until t 1 26 run at 100 millisecond intervals. And if we do say its memory, but 1 to 8 to one, then we will get a 10 millisecond delay between increments off the timer there is you got him 1038 If that is on in the range of t 202 T 45 will have one second so you can see how some of the special memory but said we have. We connection them. Tuggle options on often are PLC's and actually then affect other registers as well. So these sorts of things are very important to actually night, because often you get a lot of bags in your programs, and it's sometimes that a special register is being used somewhere and turning on options, which are actually causing bags within your programs. So I just keep that in mind when writing your programs so that you don't run into this problem down the line. So next we've got counters which have 32 bit and 16 but counting Rangers. So this means it can come from to really, really large numbers and the YouTube It range, which is close to the two billion mark and 16. But Ranges is a lot smaller, but the 65,000 sort of mark where we can count up to and store so moving down, we are going to be talking about state points at this point in time. We may cover this in this course later on, but the biggest and most important registers really that you need to know about is the data registers because we would usually store some data values in there, which will be like sittings for our programs. Maybe we've got a very specialized machine which mass contains, and settings like links and other sorts of values, which we need to do measurements on comparisons on in our programs, Teoh actually cut certain items to length or whatever the application. Maybe so use word registers are very important in storing our data. So once again, they also have general and matched where we can in retain information over a longer period of time. And with addition to this, we have two different types of things. We we've got a double word and we've got a single word register. So if you look at with General, you'll see the stall one, which basically means it's a single word register and she we've got start to. Which means it is a double word register, which allows us to just store larger amounts of data bigger than miracle values in the indexes. What we actually use these four is, too. Keep indexes off where we actually do store data, email data register so that we can retrieve it and actually start reading data from specific indexes and using that data to our advantage. So where we typically use these sorts of indexes is when we have programs, we restore multiple sets of data for different configurations, and all we can really do is in just increments are index and and load up the next set of values for our settings while program. So indexes are very useful. But it but more of an advanced topic but definitely can be incorporated into the programs to actually get data that you specifically need for a particular task. So that is basically the idea behind David registers and memory management. Just keep in mind when you are writing your programs that do you use retain toe registers in the correct place is so that when you do more memory for storing, actually, information later, under NATO registers aren't overlapping with general registers, which he should have used, or just storing temporary information. Show you in that later lecture how we can actually check, which registers people really using our program so that we can make decisions on what registers we can use next in our programs. But for now, I think this is a good introduction to how memory works and kill sees. And, as I said, most PLC's have this retain tive latch sort of scenario and also the general purpose registers, which do use the data in PLC's or powered off. So I hope this is being useful on DSI UMA next Electra. 12. PLC Programming - LD LDI LDF: L D l D I l d if and LDP So these are some of the most common functions you will use in a PLC programming programs. So let's have a look at what do these actually do and what do we use them for? So, first of all, L d is basically a function which the pill Siebel, then once the state to be a constant un forward to actually then execute that up. Good side off on right network or running Well, the eyes. Basically, the PLC is expecting a constant state of off lt itches. Affording edge and basically a falling edge is when the PLC is expecting a transition between an on and off state. Then we get LDP, which is the rising edge. PLC is now expecting transition between both on and on. So here is Justin example where we can actually use these sort of functions. So in this drawing, we've got a conveyor belt on this side and this is our box. We've got a proximity sensor here at zero, and this second block is just with boxes were forward and here has been forward again. So here is a sample program off using elderly, all the air from LDP So in this program will be really doing is when we do have a Elton LD of egg zero increase a counter LD. If we decrease the counter and LDP, we increased the counter. So this is just to illustrate the differences between on l D L D L P. So in this instance, what will season from stage here? We're going to have big Zero, which is going to be no signal back to the pill. See, So all the exterior will be off algae. If eggs era will be off, an LDP eggs era will be off. In this instance, eggs era Belman four will be triggered and turned on. So, as we explain is with pills is expecting constant state of, um because the boxes in front of this proximity the whole time eggs era is on all instances for LD so this country will basically keep increasing. As always, the box is in front of the proximity sensor. So how this will work is it'll basically use what we call a scared in time for you. Look at our eyes. P soft here, we'll see at the bottom. There's a scan time. So this basically is how quickly the pill Ciolek surrender our program and it is running through once every 0.2 milliseconds. So in the case of L. L B program here, we will be incriminating number every 0.2 milliseconds, which will make this number grow quite quickly. Actually, in the case off the LDP, what will happen is the state will change as soon as this sensor actually sees the box, and then it'll transition into a constant state and internal LV, eg zero. So this will only trigger once in this case. So our increase of our culture will be a one here and here. It will continue to increase on every scan time of the pill, see, so they can see why we were brought the one to maybe use this. If, for example, we wanted to count when we first a little box and we say one box instead of counting every time the pills he scans again now was LD If as soon as the box actually passes eg zero all the airfield and energize and in decrease the counter. So if you're using the same counter here and this would have been one from the LDP. It will now be zero from the LD. If so, just to illustrate how falling and rising edges actually work. And how the LD on LV ice actually fit in, we're going to go back to our trusty little girl fear of digital signals. So in this case, we're going to be seeing initially and or state of big zero. So this will be an LD I sort of scenario to turn on output. Then we're going to have a rising edge. It's gonna go up. So I assume is this particular state happens. Then LDP will be triggered. And as soon as we reach a constant state off 24 balls, we will have an l the contact that is coming into play being on the fooling edge of the airfield in trigger. And then finally, lti will trigger again every here. So basically your falling edges is just basically assume is it changes state from one to the other and rising edges the same. So we're just going to quickly look at a program which were Britain just to illustrate all these various functions. So here we've got a short little program from this going to take out of online murder back in. So LD I basically will energize in three win it is off. So watch that soon Return it on. It Will Didn't turn m three off. Then we've got LD in four. So as long as it is off the operative will people turn it on and you'll see that the output gets energized pulling edges. Basically, we can turn it, turn it on and it will electric gate because it needs to transition from on to off and you'll see that it turns on in seven. All the P is arising edge. So you need to go from that Allstate to the on state for it to actually trigger. So you got to sit on and triggers and sits in line. So this is basically how all the pl all the I all the if and L D works you're going to be using probably the sorts of contacts and all your programs, and they're very common, so get to know them quite well. I hope this has been a good introduction, Tol the I'll be all the LDP and rising and falling edge triggers. See you in the next lecture