https://www.AutomationDirect.com/xgb-plc?utm_source=nLlyb2TfZdo&utm_medium=VideoTeamDescription
(VID-OT-0055)
In this video, Doug Bell from Interconnecting Automation discusses the evolution of machine control from relays, the first PLC, ladder logic, and now IEC programming. AutomationDirect offers a CODESYS CPU in the Productivity 2000 hardware platform and we also offer the LS XGB PLC that supports IEC style programming.
00:00 Introduction
00:45 IEC Overview
01:51 Controls History
05:26 PLC Software Introduced
14:11 IEC Programming Introduced
21:18 Outro
Online Support Page: https://community.automationdirect.com/s/?utm_source=nLlyb2TfZdo&utm_medium=VideoTeamDescription
**Please check our website for our most up-to-date product pricing and availability.
We're pleased to have Doug Bell from Interconnecting Automation here at AutomationDirect to discuss IEC 61131 PLC programming which is the programming standard used with the LS Electric XGB and the Productivity CODESYS controllers that we offer. Doug brings over 25 years of experience in providing training classes on AutomationDirect PLCs. His experience spans from our initial PLC line, the DirectLogic family, to our modern-day PLCs including CLICK PLUS, BRX and Productivity. Now Doug thank you for stopping by and offering your insight into the IEC programming standard. So Shane, what they did was uh CODESYS takes it to the next level so to speak. With IEC 1131, you have to use the vendor software with their hardware and IEC 1131 still gives you the base but they can have add-ons, add-on instructions and such. CODESYS says we have one software package and we're going to download to multiple hardware platforms like you folks. You went and made a CPU for your Productivity PLC. So I can take out your Productivity PLC that works with your software, pop in a CODESYS CPU, use the CODESYS IEC 1131 and it works. Now if I want to take that program and transport it to a different hardware platform, I don't have to rewrite the whole program over. I just go into the hardware configuration, reconfigure for the new hardware I'm going to download it to and for all intents and purposes I can download it. I might have to make a tweak here or there but I can download the code. I don't have to rewrite the whole thing with the new hardware editor and all the rest of it. Even though it's IEC 1131, it just gives us the base. Right. CODESYS gives us everything - the software and the hardware platform on multiple pieces of hardware. That's awesome. And it works really good. What I'd like to do is explain how we got to the IEC 1131 standard that they use in the world. But before you can do that it takes a little bit of a history lesson, so we've got to go back in time a little bit and explain where we came from. One of the things people don't understand is that decades ago when I first came out of a trade school, machines were controlled by relays. I've got some pictures here I'm going to show you. It would be hundreds and hundreds of relays in a control cabinet. If you look at some of these pictures here, they're just massive. They just go on forever. And somebody has to have a wiring diagram for that. So, draftsmen would sit down and create wiring diagrams using ladder logic. Ladder logic is a wiring diagram methodology, it's not a programming language. It morphed into a programming language because electricians wanted to see ladder diagrams, but we'll get to that later. Right now, here are some of these relay panels that we used to work on. Now these are small panels. When I started out, we had panels that you would stand inside of. They were so huge; they were just massive. And you'd be inside the panel with a Wiggy voltage tester, an electrician would take a piece of plywood, set it on sawhorses and have 30, 40 pages of wiring diagrams. And he'd be calling out numbers. Okay Doug check number 38, and I'd test it and say it's hot. Check 97, it's not hot. Check 83, it's hot. Okay, replace that relay, the contacts are burned. Relays have contacts that open and close, and over time they burn, oxidize, or they weld shut. They burn open. They are problems. And think about this folks, we'd have hundreds of them. Some cabinets had a thousand relays, so these wiring schematics got to be very extensive. So the industry, manufacturing industry was asking for something to replace it. So they invented something called a PLC. So the PLC came on the market. Just as I was coming out of trade school, the PLC started to come out, but it had an inherent problem. It used something called a handheld programmer to program it. It wasn't friendly to the electricians because they're used to wiring diagrams and it programmed with ANDs and ORs. It's a gate, so if I go in here and I look at the ladder wiring diagrams, this is what they were used to - just regular diagrams. Look at the wiring diagrams. And all these, if you look at there's push buttons there's float switches, all kinds of stuff on these diagrams. But there was generic electrician's, wiring diagrams that we used for all machines that were considered to be ladder logic. And it was a symbolic language that we would use to explain the wiring of the m,achine. And there was wire numbers that we would test. Every wire had a number. We also used symbols, all kinds of symbols. Look at some of these symbols here. These were symbols that they would use on wiring diagrams to show different types of switches, different types of push buttons, motor contactors, relays, all kinds of stuff. There were all these symbols that we had to learn as electricians, which was common. We'd go to school for it. When they brought out the PLC, they didn't have those symbols on the handhelds. They had just ANDs and ORs, set and reset. And they had things like this on some handhelds: Gates; AND-Gates and OR-Gates. That's what microcontrollers run on. That's what they work on. So, there was a huge resistance to PLCs. And they didn't take off because electricians couldn't troubleshoot them. So, at the same time, this was happening, the computer world was evolving and there was a war. They had PC DOS, MS-DOS, all different kinds of operating systems. And Microsoft won the war and they brought out something called MS-DOS: disk operating system. At that time, PLC companies said, "hey, we can make fake ladder rungs on the screen in software. And we can convert that all behind the scenes into Boolean instructions like ANDs and ORs like the handheld did, and electricians would love this". And as they did it, PLC sales quadrupled. They went through the ceiling because now electricians could relate to them, they could troubleshoot them. The problem was, it didn't run on ladder. Even today, PLCs don't run on ladder. Behind the scenes the software developers convert all into Boolean code and things that microprocessors understand. But engineers think it's running on ladder. That's just the editor, that's what you're working in. And this part of the market got hooked on ladder because we were the manufacturing capital. And we were doing all these relay panels so electricians just morphed right into ladder logic and it really worked well. But remember; the PLC was invented to replace a relay. For later on when I discuss more, you'll see where I'm going with this. Because the PLC was invented to replace a relay originally. So, if you look at this handheld here that's what they had. So what happened was all the vendors brought out DOS-based software. And the DOS-based software didn't have common shortcuts. So you would go to one course for say Texas Instruments and you'd press F2 to get an open contact, and another vendor you'd go to their training and CNTRL A brought up a normally open contact. It was a mess, but at least we had ladders, so electricians were happy. Okay, then, DOS morphed into Windows. And now we have standard shortcuts CNTRL C, CNTRL X for copy, paste, cut, CNTRL V. It's all standard. Okay, but we still had a problem, because as the PLC s were moving on, they come up with their own addressing scheme. They come up with their own memory location names and such, which made it very difficult to change between brands. Even if you go to one brand you couldn't switch between the models because they were different. The shortcut keys were the same now for most of them but the addressing was different. So I'll just give you an example here. I don't have a DOS-based software on my laptop, I still have a DOS-based software, because you never know when you need that. But, I've got the DirectSoft here. And DirectSoft actually shows you the Boolean code. So what I did is I started this software up and I created a piece of code here, to save time. And I have just a simple rung of code here. Input zero turns on output zero. In this PLC an X is an input - Y is an output. If I go to other brands, an I is an input, an O is an output. They make up their own addressing schemes which makes them difficult sometimes to switch. But in reality, if I show you something here, if I go to mnemonics, that's what I created. That is what gets downloaded to the PLC. This ladder stuff is all fake, it's always been fake. It's just the editor, the graphical user interface. Now this PLC still shows it to me. If I go here to window tile and I take this and I click in here - if you notice, right here, look at the F2. That's a carryover from DOS. You can press F2 and get a normally open contact on the rung. That's how the DOS software worked with this PLC under Texas Instruments. F3 was normally closed. So they just carried it over. Now if I change this to say X14 - when I go up here and I hit accept, now they call it accept some PLC s call it compile. Compile is the proper term. You're going to compile it into runnable code that the microprocessor understands. When I hit accept, you notice up here it changed to X14. This is what got downloaded to the PLC and that's still what gets downloaded to the PLC today. So that's how this particular brand worked, this model. Now if I go over here and I bring up say a CLICK project. You'll see here that CLICK uses pretty much the same terminology except when it comes to memory. So if I go over here to my address picker and I bring up the address picker - over here we have memory we call it DS, DD, DH, DF. Those are made-up names. A DS is an integer. It's minus 32,000 plus 32,000. Now I'm not going to go into all the 32,767 - it's just, some of these numbers get pretty large. A DD is a 32bit integer. A DH is a hex. A DF is floating point or real. The proper term that we use in computers is real. So they made up these names so you get used to it for this product but if you want to switch to a different product it can be tough. Because if I go over to this product and I go over here, this is the BRX. And I go over here to system configuration, I go to memory configuration they have V's, which are unsigned integers. They have N's which are integers again. Now remember, CLICK called it DS they call it N. And by the way, I'm not putting the products down they work great! But, you have to learn the product. There's no naming convention, there's no commonality between these products. An R is a real number. So as you can see things change. If you go over here to Productivity which is AutomationDirects product, here they have tag-based programming, there is no addressing. But when you go to create a tag it asks you what type of tag do you want. Do you want a bit, do you want a Boolean, do you want a bite, do you want a word and what's the format? Is it integer, signed integer, what is it? So it got very confusing to the novice about what do I need here? So they what people do is learn one model just stay with it, because they know it, they got it. So, that's when IEC 1131 stuff started coming out. Before you get too far into IEC 1131 there's two other things I'd like to cover here. You have to understand that the PLC has morphed and evolved over about a 50-some-year period. It came out around 69. And remember, I told you that we programmed with handheld programmers. And then DOS and then the Windows. And as they were evolving, they got more powerful processors. And electricians like me were making more demands. For example, on a sequential process ladder is not conducive to a sequential process. It's hard. So, in the old days, we had things called drum sequencers. And if you look at this picture here, my son and I just replaced this about a year ago. That's an old mechanical drum. And if you look closely here, it's a bunch of switches on the bottom with a roller cam. And over here is a motor that drives it. And as the motor's turning, those little pins would close the switches like a player piano. That's real stuff folks. This was installed in 71, we took it out last year and put a Productivity in. Very, very antiquated control systems. If you look down here at the bottom, it's all relays. There's your relays across the bottom. All the interposing wires, everything else - it was a mess. But it was still running 50 years later. And an engineer that worked at the plant thought he would replace it before it broke because the company's been out of business probably for 20, 30 years, not around anymore. So because customers were asking for that, PLC companies went to the drawing board and said okay, well we'll add a feature to the ladder window called DRUM. So watch, I'm going to go here and put a drum in. So now you take an editor, because, let me explain something, the microprocessor doesn't know what a drum is. A drum is a mechanical device, a cam switch. So they go to the editor, they make a drum fake screen here and behind the scenes use a bunch of instructions to make it work. And it got more and more convoluted. Then the '90s rolled around and low-cost processors started to come out in 2000s and now we could get floating point math in PLCs. So now we've got PLCs doing trigonometry and calculus. The LS PLC does 64-bit resolution floating point. Phenomenal accuracies. Problem is, we're still using ladder and ladder was supposed to replace a relay. I told you earlier, remember what I'm saying, it's supposed to replace a relay. How many relays did 64-bit floating point math? They didn't do that. So it's evolving and it's turning into this massive beast you try to get your arms around when it comes to ladder logic programming. Not to say it's terrible, it's just hard to deal with sometimes. And that's when they started to make things, in the early 90s, they started to develop standards like the IEC 1131 standard which the LS runs on. And we'll talk more about that in a minute. So, the mid 90s, I don't know about 94-ish, the IEC group developed a standard called IEC 1131, which was morphed into IEC 61131-3. The dash 3 is the third revision which happened in 2013. So they made some revisions to it. And the intent behind it was to try to come up with a standard for PLC programming. Now in this part of the world, ladder has been a main-state. But in other parts of the world ladder isn't, because they didn't have the baggage of all the relay panels that our electricians came from. So there's other languages out there like sequential function charts, statement lists, instructional lists. There's other languages PLC use. So if you leave this part of the world, sometimes you walk up to an editor, a software package, it's not ladder. It's something else. Because in reality, all this is fake, even sequential function charts, statement lists - it's all fake; it converts to Boolean. So the IEC group said, we're going to make a standard. We're going to support multiple languages and ladder will be one of them. But we're also going to support other languages in case you want to use that language. The other thing I want to mention here is some languages, like I said to you earlier, don't work well in sequential functions like ladder. So, sequential function chart - it's a flowchart. You create a flowchart - do this, do this, do this - it's sequential process. It works really well for that so some languages fit certain applications better than other languages. So there's huge confusion though and there's a huge resistance to it in this part of the market because people are used to ladder and they're entrenched. But for newer people coming up, they're not entrenched in ladder. So newer people are more adaptive to trying other languages and they may have seen them in college. For example, statement lists is very much like Python or C. It's statements, you write sentences. It's not ladder. And so people that have a programming background can adapt to that easier than ladder if they don't have a relay background. So what they did with the IEC 11 standard is they made a bunch of basic standards that your software has to meet. We're not going to do DS and DD and N and V and all this stuff between brands. A word is a word, a bite is a bite, a double word is a double word. Folks, my phone has 256 gigabytes. It's rated on the bite. That's a common term. It's not a DS or a DD it's a bite. So the standard is to use common terms: bits, bites, words, double words, long words - standard computer terms. So there was some kind of a standard they developed for terminology. Now, the thing to be aware of is that the vendor has to meet the basic standards to be IEC 1131 compatible, and the LS does. But then you can add on your own things. For example, there's a basic set of instructions IEC requires. But I can add more instructions in than are my instructions. So if it meets the basic standard of IEC 1131, they call it IEC 1131 compatible. It may have extended instructions that the manufacturer made for their PLC but it has the base instructions. So now here's the kicker, when I go and I try to switch from one model to another model the basic standard is there. A bite is a bite, a word is a word, a bit is a bit. So they made a basic standard. Now I'm going to take a minute here and just show you some things here. Here is a program that I put together for you. And I wrote a ladder program where a selector switch turns on a yellow light. That's in ladder. Now if I want to see what that actually created I can click right here in the LS software and I see it's a LOAD and an OUT, just like DirectSoft. It's a LOAD and an OUT. It's the same identical instructions: LOAD OUT. If I go back to the DirectSoft software, I see it. That's what gets downloaded to the PLC, not ladder. If I go over here, the instruction list says load black button, store red light. Same thing, except it's written as instructions, almost assembly instructions, basic computer instructions. So if I go in here, I say green light equals green button. That's more of a C-type code or a Python. Very similar, but you can use any one of these editors. And you can mix and match them. So with the LS software I can have multiple programs - one program is in ladder, one program is an instruction list. I create the programs what I want, so basically I have the tools to do the proper job for what I'm trying to do on the machine. So what I did here, I created a small programming in sequential function chart. It's another language that IEC 1131 conforms to. And it's a flowchart. I start up here at the beginning, I have to turn on the green light. I come here and I set the green light on the trainer on. I have a bit that says turn off the green light. I come here and I reset it and I start over. And when I download this, this lights up and lets me troubleshoot. And inside of these decisions I can put pieces of code, I can put ladder code. I can put statement lists. It s very powerful stuff. I can actually edit in here. Over the years vendors have tried with ladder editors to make things. DirectSoft has stage. Other PLC s have files and folders. There's all these different things they invented. IEC conforms to a standard. So if I'm using the LS software and I go over to another brand that's IEC, it's going to have a similar look and feel. May not be identical because it was written by a different vendor but it's going to have the same look and feel. It's going to have a word, it's going to have a bit, it's going to have a double word. Terminology is the same and the look and feel is the same, they must support certain languages. Now don't get me wrong they can put their own language in, they can add it. If they make up their own language they can add it. But to be IEC 1131 compatible you have to have the base standard languages and a base standard terminology so that when I switch brands or switch models, I have the same look and feel between them. Now folks I'm going to say something here - I don't want to be getting any hate mail from all the ladder lovers, okay. I've been doing ladder for 42 years, okay. I was with the PLC when they came out with handheld programmers. You can tell, I have white hair. Very frustrating things at times. I know we have people that are just hardcore ladder guys. I understand ladder very well. But sometimes it's not always the best tool for the job. And what the IEC standard allows you to do is use the proper tool for the proper job, for that job that you want to get done. And, it fits. There's places where ladder doesn't fit. So IEC, the purpose of it was to try to make a worldwide standard. Now it hasn't always worked. But it's something better than just every editor has their own look and feel and their own way of doing things, there's a standard format to the basic way things are done. Thanks, Doug, that was great information on IEC based programming. We hope you found this information helpful. Feel free to leave us a comment below and remember to subscribe so you never miss informative videos like these. As mentioned, we offer the LS brand XGB PLC and a CODESYS-powered Productivity CPU, both with free software, so when you're ready, you can jump right in and begin your next IEC-based project. If you would like to learn more about the LS Electric XGB PLC and its powerful IEC-based software, check out our free PLC training portal. Here you can access hundreds of videos from Doug Bell on PLC fundamentals and the capabilities of AutomationDirect PLCs. AutomationDirect also has an expansive library of videos on our website as well as our YouTube Channel.
Voted #1 mid-sized employer in Atlanta
Check out our
job openings