newj

Showing posts with label PLC. Show all posts
Showing posts with label PLC. Show all posts

Thursday, 11 February 2016

PLC Programming

Programming Languages

A program loaded into PLC systems in machine code, a sequence of binary code numbers to represent the program instructions.
Assembly language based on the use of mnemonics can be used, and a computer program called an assembler is used to translate the mnemonics into machine code.
High level Languages (C, BASIC, etc.) can be used.

Programming DevicesPLC can be reprogrammed through an appropriate programming device:
Programming Console
PC
Hand Programmer

Introduction to Ladder LogicLadder logic uses graphic symbols similar to relay schematic circuit diagrams.
Ladder diagram consists of two vertical lines representing the power rails. Circuits are connected as horizontal lines between these two verticals.

Ladder diagram features Power flows from left to right.
Output on right side can not be connected directly with left side.
Contact can not be placed on the right of output.
Each rung contains one output at least.
Each output can be used only once in the program.
A particular input a/o output can appear in more than one rung of a ladder.
The inputs a/o outputs are all identified by their addresses, the notation used depending on the PLC manufacturer.



Introduction to Statement listStatement list is a programming language using mnemonic abbreviations of Boolean
logic operations. Boolean operations work on combination
of variables that are true or false.
A statement is an instruction or directive for the PLC.
Statement List Operations* Load (LD) instruction.
* And (A) instruction.
* Or (O) instruction.
* Output (=) instruction.
Function Block DiagramsFunction block is represented as a box with the function name written in.




please note:
 LD: load
 O: or
 AN: and not (and a normally closed contact)
 ALD: AND the  first LD with second LD

Friday, 16 January 2015

Comparison Instructions

IN1 and IN2 are compared according to the type of comparison you choose:


==     IN1  is equal to  IN2
















 >       IN1  is greater than  IN2




<       IN1  is less than  IN2




>=     IN1  is greater than  or equal to  IN2



<=     IN1  is less than  or  equal to  IN2










Wednesday, 14 January 2015

NEW PLC tutorial and guides for automation

hi there, this blog is dedicated to provide you with PLC tutorial specifically for industrial automation and robotics.



There are two types of PLC available in the market, which is relay type and transistor type. the major difference between these two is the response time. The response for transistor type PLC can go as fast as 0.5 microsecs compared to those of relay types which have response time around 10 ~ 20 millisecs.

The ability of transistor type PLC to do fast switiching makes it possible for it to have pulse outputs and high speed input to control AC servo motor.

Planning your project plc

It is very important to plan your work in designing your PLC projects. identify your project requirements, inputs and outputs involve etc.



Today i will give you a free PLC programming on how to do a PLC controller for a water tank system. This is a typical exam question for PLC beginner.

The inputs involve are 1 start button addressed at 0.00 and 2 level switches addressed at 0.01 and 0.02 respectively. The one address at 0.01 will turn ON whenever the tank is empty thus it will switch ON the water valve (output) which is address at 10.00. The other level switch will turn ON whenever the tank is full and consequently will turn the water valve OFF. By doing this control, the water tank will not run empty. The water will fill into the tank whenever the empty switch is ON. Address 14.00 and 14.01 is just internal relay address to sequence the programming.

two stage counter Free PLC

When an SV higher than 9999 is required, two counters can be combined as shown in the following example. In this case, two CNT instructions are combined to make a BCD counter with an SV of 20,000.



long term timers


Example 1:
Long-term Timers
The following program examples show two ways to create long-term timers
with standard TIM and CNT instructions.
Two TIM Instructions
In this example, two TIM instructions are combined to make a 30-minute
timer.




TIM and CNT Instructions

In this example, a TIM instruction and a CNT instruction are combined to make a 500-second timer.TIM 0001 generates a pulse every 5 s and CNT 0002 counts these pulses. The set value for this combination is the timer interval × counter SV. In this case, the timer SV would be 5 s x 100 = 500 s. With this combination, thelong-term timer’s PV is actually the PV of a counter, which is maintained through power interruptions.




PLC tutorial open source, free codes for you 2020

This is your source for PLC programming. Finally, a FREE place to practice your PLC programming skills. The PLC Simulator is here to help you learn PLC programming.
For simple directions please view the help section. The help section can be found on the top menu of the PLC simulator.


Suggestions for improvement are always welcomed. If you would like to share any of the PLC programs you write via the simulator, please upload them to the downloads section of the site. You may also wish to search there for some examples other people have written.

Enjoy the program and remember that your feedback is welcomed as well as your suggestions for improvement. NO requested feature will be considered crazy.

Servo motor control using PLC

i have been working with servo motor for quite sometimes. anyhow, it is also good to have training from the original equipment manufacturer.

difference between linear servo system and motion control system:



linear servo system: PLC will supply pulse input to the motor drive (digital type) then the motor driver will give power through PWM to the AC servo motor. feedback will be given by encoder to the driver and driver will do the error counter.

motion control system: PLC will supply pulse to the motion control unit. then motion control unit will give analog input 0-10V to motor driver. the motor driver will give power through PWM to the AC servo motor. feedback will be given by encoder to the driver and driver will give the error signal to the motion control unit to do the error counting.

i will start explaining on the linear servo system. basically, there are two common ways to control the direction of the motor which is using the CW/CCW pulse mode or using the pulse + direction mode. u need two pulse outputs from the servo motor to do this. make sure u know the setting from your plc of how the pulses are being output. please check with the manual of the pulse timing diagram for better understand. it is important also to know the response time of the pulse.

make sure the wiring is correct. basic outputs from the PLC to the servo driver (amplifier) are the pulse outputs (u need two outputs here, if you are using the pulse + direction, one output will supply the pulse whereas the other output will tell the servo amplifier the direction. if u are in CW/CCW mode, one output is for clockwise pulse and the other is for counter clockwise pulses).

u also need to output the servo RUN signal to on the motor and Reset signal to reset any alarm. just for extra information, not all alarms can be reset from the reset signal, for some alarms, u need to reboot the servo driver.

for the input to the PLC from the servo driver, u need the feedback from the AC servo motor encoder. if you are using open collector, one feedback input is enough. it will count the Z phase from the encoder and pass it back to the plc to do the pulse count.

u also can tap into the PLC the 'pulse output complete' signal from the servo driver. this is important to make sure all pulse have been supplied and the motor is ready for next move.

here is a sample of ladder diagram on how u can jog your motor backward, tell the motor to count how many pulses has it moved backward, and use the same amount of pulses to go forward. since what i use is pulse+direction mode, when i moved backward, the encoder gave me a negative-signed pulses. i need to make it positive so a little arithmatics has been done so that the amount of pulses use to move forward, is the same amount of pulses supplied to the motor to move backward. it is also worth noting here that the PULS instruction is to tell the plc what is the amount of pulses to be supplied, the SPED instruction is to tell the frequency of the pulses, and this will determine the speed of the servo system, and the PRV is the instruction to tell the PLC to receive the pulse count from the Servo driver output ( input to the PLC).

Friday, 2 January 2015

Replacing Relays PLC

Next, lets use a plc in place of the relay. (Note that this might not be very cost effective for this application but it does demonstrate the basics we need.) The first thing that's necessary is to create what's called a ladder diagram. After seeing a few of these it will become obvious why its called a ladder diagram. We have to create one of these because, unfortunately, a plc doesn't understand a schematic diagram. It only recognizes code. Fortunately most PLCs have software which convert ladder diagrams into code. This shields us from actually learning the plc's code.

First step- We have to translate all of the items we're using into symbols the plc understands. The plc doesn't understand terms like switch, relay, bell, etc. It prefers input, output, coil, contact, etc. It doesn't care what the actual input or output device actually is. It only cares that its an input or an output.

First we replace the battery with a symbol. This symbol is common to all ladder diagrams. We draw what are called bus bars. These simply look like two vertical bars. One on each side of the diagram. Think of the left one as being + voltage and the right one as being ground. Further think of the current (logic) flow as being from left to right.



Next we give the inputs a symbol. In this basic example we have one real world input. (i.e. the switch) We give the input that the switch will be connected to, to the symbol shown below. This symbol can also be used as the contact of a relay.



Next we give the outputs a symbol. In this example we use one output (i.e. the bell). We give the output that the bell will be physically connected to the symbol shown below. This symbol is used as the coil of a relay.

The AC supply is an external supply so we don't put it in our ladder. The plc only cares about which output it turns on and not what's physically connected to it.

Second step- We must tell the plc where everything is located. In other words we have to give all the devices an address. Where is the switch going to be physically connected to the plc? How about the bell? We start with a blank road map in the PLCs town and give each item an address. Could you find your friends if you didn't know their address? You know they live in the same town but which house? The plc town has a lot of houses (inputs and outputs) but we have to figure out who lives where (what device is connected where). We'll get further into the addressing scheme later. The plc manufacturers each do it a different way! For now let's say that our input will be called "0000". The output will be called "500".

Final step- We have to convert the schematic into a logical sequence of events. This is much easier than it sounds. The program we're going to write tells the plc what to do when certain events take place. In our example we have to tell the plc what to do when the operator turns on the switch. Obviously we want the bell to sound but the plc doesn't know that. It's a pretty stupid device, isn't it!



The picture above is the final converted diagram. Notice that we eliminated the real world relay from needing a symbol. It's actually "inferred" from the diagram. Huh? Don't worry, you'll see what we mean as we do more examples.

Relays plc

Now that we understand how the PLC processes inputs, outputs, and the actual program we are almost ready to start writing a program. But first lets see how a relay actually works. After all, the main purpose of a plc is to replace "real-world" relays.




We can think of a relay as an electromagnetic switch. Apply a voltage to the coil and a magnetic field is generated. This magnetic field sucks the contacts of the relay in, causing them to make a connection. These contacts can be considered to be a switch. They allow current to flow between 2 points thereby closing the circuit.

Let's consider the following example. Here we simply turn on a bell (Lunch time!) whenever a switch is closed. We have 3 real-world parts. A switch, a relay and a bell. Whenever the switch closes we apply a current to a bell causing it to sound.

Notice in the picture that we have 2 separate circuits. The bottom(blue) indicates the DC part. The top(red) indicates the AC part.

Here we are using a dc relay to control an AC circuit. That's the fun of relays! When the switch is open no current can flow through the coil of the relay. As soon as the switch is closed, however, current runs through the coil causing a magnetic field to build up. This magnetic field causes the contacts of the relay to close. Now AC current flows through the bell and we hear it. Lunch time!

Response Time Concerns PLC

Now that we know about response time, here's what it really means to the application. The PLC can only see an input turn on/off when it's looking. In other words, it only looks at its inputs during the check input status part of the scan.




In the diagram, input 1 is not seen until scan 2. This is because when input 1 turned on, scan 1 had already finished looking at the inputs.
Input 2 is not seen until scan 3. This is also because when the input turned on scan 2 had already finished looking at the inputs.
Input 3 is never seen. This is because when scan 3 was looking at the inputs, signal 3 was not on yet. It turns off before scan 4 looks at the inputs. Therefore signal 3 is never seen by the plc.







To avoid this we say that the input should be on for at least 1 input delay time + one scan time.




But what if it was not possible for the input to be on this long? Then the plc doesn't see the input turn on. Therefore it becomes a paper weight! Not true... of course there must be a way to get around this. Actually there are 2 ways.







Pulse stretch function. This function extends the length of the input signal until the plc looks at the inputs during the next scan.( i.e. it stretches the duration of the pulse.)








Interrupt function. This function interrupts the scan to process a special routine that you have written. i.e. As soon as the input turns on, regardless of where the scan currently is, the plc immediately stops what its doing and executes an interrupt routine. (A routine can be thought of as a mini program outside of the main program.) After its done executing the interrupt routine, it goes back to the point it left off at and continues on with the normal scan process.





Now let's consider the longest time for an output to actually turn on. Let's assume that when a switch turns on we need to turn on a load connected to the plc output.
The diagram below shows the longest delay (worst case because the input is not seen until scan 2) for the output to turn on after the input has turned on.
The maximum delay is thus 2 scan cycles - 1 input delay time.




Response Time (PLC)

The total response time of the PLC is a fact we have to consider when shopping for a PLC. Just like our brains, the PLC takes a certain amount of time to react to changes. In many applications speed is not a concern, in others though...





If you take a moment to look away from this text you might see a picture on the wall. Your eyes actually see the picture before your brain says "Oh, there's a picture on the wall". In this example your eyes can be considered the sensor. The eyes are connected to the input circuit of your brain. The input circuit of your brain takes a certain amount of time to realize that your eyes saw something. (If you have been drinking alcohol this input response time would be longer!) Eventually your brain realizes that the eyes have seen something and it processes the data. It then sends an output signal to your mouth. Your mouth receives this data and begins to respond to it. Eventually your mouth utters the words "Gee, that's a really ugly picture!".

Notice in this example we had to respond to 3 things:

INPUT- It took a certain amount of time for the brain to notice the input signal from the eyes.

EXECUTION- It took a certain amount of time to process the information received from the eyes. Consider the program to be: If the eyes see an ugly picture then output appropriate words to the mouth.

OUTPUT- The mouth receives a signal from the brain and eventually spits (no pun intended) out the words "Gee, that's a really ugly picture!"

PLC Operation

A PLC works by continually scanning a program. We can think of this scan cycle as consisting of 3 important steps. There are typically more than 3 but we can focus on the important parts and not worry about the others. Typically the others are checking the system and updating the current internal counter and timer values.



Step 1-CHECK INPUT STATUS-First the PLC takes a look at each input to determine if it is on or off. In other words, is the sensor connected to the first input on? How about the second input? How about the third... It records this data into its memory to be used during the next step.

Step 2-EXECUTE PROGRAM-Next the PLC executes your program one instruction at a time. Maybe your program said that if the first input was on then it should turn on the first output. Since it already knows which inputs are on/off from the previous step it will be able to decide whether the first output should be turned on based on the state of the first input. It will store the execution results for use later during the next step.

Step 3-UPDATE OUTPUT STATUS-Finally the PLC updates the status of the outputs. It updates the outputs based on which inputs were on during the first step and the results of executing your program during the second step. Based on the example in step 2 it would now turn on the first output because the first input was on and your program said to turn on the first output when this condition is true.

After the third step the PLC goes back to step one and repeats the steps continuously. One scan time is defined as the time it takes to execute the 3 steps listed above.

The Guts Inside (PLC)

The PLC mainly consists of a CPU, memory areas, and appropriate circuits to receive input/output data. We can actually consider the PLC to be a box full of hundreds or thousands of separate relays, counters, timers and data storage locations. Do these counters, timers, etc. really exist? No, they don't "physically" exist but rather they are simulated and can be considered software counters, timers, etc. These internal relays are simulated through bit locations in registers. (more on that later)



What does each part do?

  •     INPUT RELAYS-(contacts)These are connected to the outside world. They physically exist and receive signals from switches, sensors, etc. Typically they are not relays but rather they are transistors.
  •     INTERNAL UTILITY RELAYS-(contacts) These do not receive signals from the outside world nor do they physically exist. They are simulated relays and are what enables a PLC to eliminate external relays. There are also some special relays that are dedicated to performing only one task. Some are always on while some are always off. Some are on only once during power-on and are typically used for initializing data that was stored.
  •     COUNTERS-These again do not physically exist. They are simulated counters and they can be programmed to count pulses. Typically these counters can count up, down or both up and down. Since they are simulated they are limited in their counting speed. Some manufacturers also include high-speed counters that are hardware based. We can think of these as physically existing. Most times these counters can count up, down or up and down.
  •     TIMERS-These also do not physically exist. They come in many varieties and increments. The most common type is an on-delay type. Others include off-delay and both retentive and non-retentive types. Increments vary from 1ms through 1s.
  •     OUTPUT RELAYS-(coils)These are connected to the outside world. They physically exist and send on/off signals to solenoids, lights, etc. They can be transistors, relays, or triacs depending upon the model chosen.
  •     DATA STORAGE-Typically there are registers assigned to simply store data. They are usually used as temporary storage for math or data manipulation. They can also typically be used to store data when power is removed from the PLC. Upon power-up they will still have the same contents as before power was removed. Very convenient and necessary!!

PLC History


In the late 1960's PLCs were first introduced. The primary reason for designing such a device was eliminating the large cost involved in replacing the complicated relay based machine control systems. Bedford Associates (Bedford, MA) proposed something called a Modular Digital Controller (MODICON) to a major US car manufacturer. Other companies at the time proposed computer based schemes, one of which was based upon the PDP-8. The MODICON 084 brought the world's first PLC into commercial production.





When production requirements changed so did the control system. This becomes very expensive when the change is frequent. Since relays are mechanical devices they also have a limited lifetime which required strict adhesion to maintenance schedules. Troubleshooting was also quite tedious when so many relays are involved. Now picture a machine control panel that included many, possibly hundreds or thousands, of individual relays. The size could be mind boggling. How about the complicated initial wiring of so many individual devices! These relays would be individually wired together in a manner that would yield the desired outcome. Were there problems? You bet!

These "new controllers" also had to be easily programmed by maintenance and plant engineers. The lifetime had to be long and programming changes easily performed. They also had to survive the harsh industrial environment. That's a lot to ask! The answers were to use a programming technique most people were already familiar with and replace mechanical parts with solid-state ones.

In the mid70's the dominant PLC technologies were sequencer state-machines and the bit-slice based CPU. The AMD 2901 and 2903 were quite popular in Modicon and A-B PLCs. Conventional microprocessors lacked the power to quickly solve PLC logic in all but the smallest PLCs. As conventional microprocessors evolved, larger and larger PLCs were being based upon them. However, even today some are still based upon the 2903.(ref A-B's PLC-3) Modicon has yet to build a faster PLC than their 984A/B/X which was based upon the 2901.

Communications abilities began to appear in approximately 1973. The first such system was Modicon's Modbus. The PLC could now talk to other PLCs and they could be far away from the actual machine they were controlling. They could also now be used to send and receive varying voltages to allow them to enter the analog world. Unfortunately, the lack of standardization coupled with continually changing technology has made PLC communications a nightmare of incompatible protocols and physical networks. Still, it was a great decade for the PLC!

The 80's saw an attempt to standardize communications with General Motor's manufacturing automation protocol(MAP). It was also a time for reducing the size of the PLC and making them software programmable through symbolic programming on personal computers instead of dedicated programming terminals or handheld programmers. Today the world's smallest PLC is about the size of a single control relay!

The 90's have seen a gradual reduction in the introduction of new protocols, and the modernization of the physical layers of some of the more popular protocols that survived the 1980's. The latest standard (IEC 1131-3) has tried to merge plc programming languages under one international standard. We now have PLCs that are programmable in function block diagrams, instruction lists, C and structured text all at the same time! PC's are also being used to replace PLCs in some applications. The original company who commissioned the MODICON 084 has actually switched to a PC based control system.

What will the 00's bring? Only time will tell.

Thursday, 23 October 2014

Tutorial - PLC TRAINING BUY NOW - LOGIN DETAILS EMAILED TO YOU AFTER PURCHASE

Who is this course for?


OUR MOST POPULAR COURSE - BUY BOTH Level 1 & 2 together and SAVE approx 14% OFF the normal individual course prices.
This course also includes FREE the content from our “INTRODUCTION TO PLCs”

TRAINING IS FOR - BEGINNERS - EMPLOYED - UNEMPLOYED - STUDENTS
Companies employ engineers who have had professional accredited
PLC (Programmable Logic Controller) Training
SCANTIME are an INDUSTRIAL TRAINING & ENGINEERING COMPANY.

This training course is for Maintenance or Control Engineers and anyone wishing to become a PLC Automation Designer. The training includes industrial programming techniques with introduction to programming standards and how PLC technology is used in manufacturing processes.


What you will receive with this course



  • Industry approved PLC Programming training
  • Access to your Online Course Area 24 Hrs a day
  • Study in your own time and at your own pace
  • FREE PLC software for your PC - Syswin34
  • Online Course Viewer includes AUDIO & VIDEO
  • Offline Manuals to read offline
  • Assistance from Professional Engineer Tutor
  • FREE course Certificate - Training CD & Delivered FREE worldwide


Introduction



In today’s manufacturing industries, it is essential to ensure that your Engineering Skills and Knowledge  of PLCs (Programmable Logic Controller) is up to date - Industrial PLC Programming knowledge is fundamental for ALL engineers worldwide - You can gain this knowledge via our Industry Accredited eLearning PLC training courses.

PLC Programming Part 1 (Programmable Logic Controller) - Learn how to use Timers - Counters - create Ladder Logic to industrial standards - Hardware Configuration - Addressing - Basic PLC programming exercises -  PLCs and Operator HMI & SCADA Interfaces -  introduction to other programming languages, be capable of reading ladder logic in process control routines, identify faults in ladder logic routines.

Part2 of our PLC Programming series is the hand’s on practical training, working with your course tutor, he will teach you programming, and how to write Programmable Logic Controller control routines for industrial processes.  Learn about: Data Handling, using Comparators, creating Automatic Control of a process, Safety Interlocking, Monitoring process limits, Program Structure, Alarm Handling, How to write a Full program to Industrial Standards to reduce manufacturing Downtime and Safety.

Learn about PLCs (OMRON - MITSUBISHI - SIEMENS & ALLEN BRADLEY PLCs). 

Study in your own private Online course area.  You also have a private course tutor who is available to you over the entire course, anything that you do not understand he will help you with. There is no pressure to complete the training by a certain time or date, once you buy a course it is yours to utilize whenever you wish. Study & Practice Programming OnLine OR OffLine whenever you wish, entirely flexible to suit you.
(*PLC software req 32 Bit PC or use our free Remote Access software)

Tuesday, 1 July 2014

Tutorial - FINAL THOUGHTS

PLC Considerations
When selecting a PLC or similar control engine there are many questions:


  1. How much I/O?
  2. What type of I/O?
  3. What type of control logic -- simple ON/OFF or is there PID and data analysis?
  4. What type of data is monitored and captured?
  5. Are there recipes (databases) involved?
  6. Is there an operator interface involved?
  7. Are there special communication interfaces required? For example, flow meters, scales, thermocouples, or other signals that are not a regular discrete or analog signal.
  8. Does the application require links to an external network, database, or some type of MES system?
  9. Does the application require motion control, bar coding, machine vision, etc?
PLC and / or Computer
Sometimes we do not use a typical PLC for the control engine. Typically what we do is:
  1. If the application is small (less than 50 I/O), no databases (only a few choices), and simplistic HMI then use a PLC.
  2. If the application is small, slow (response time greater than 50 milliseconds) and requires computer functionality (machine vision, networking, databases, multiple axis motion control, etc) we prefer to do the entire application in Visual Basic (VB).
  3. If there are large amounts of I/O (over 100) or you need fast, real-time response, then you will probably appreciate the PLC handling your real-time and direct I/O tasks and letting the computer handle the non-real-time tasks (such as HMI, databases, etc). There are a lot of gray areas in between.
Although today’s Pentium III running Windows NT or 2000 at 1 GHz with 512 KB RAM is very fast in comparison to technology only three years ago, it is still nice, in large systems, to use a PLC to help segment the system functionality. You can write subroutines to segment functionality -- you can also segment using different controllers.

Frequently Asked Questions (FAQs)
  1. What about soft PLCs? Soft PLCs are where the PLC is actually software that resides on a computer. Although this is way that the industry is headed for the future, as with all new technology, we would recommend that your first test of new technology not be a critical application.
  2. What brand of PLC is the best? It depends. J If you have a plant full of GE PLCs then it does not make sense to change to AB. If you have a plant full of some manufacturer that is no longer in business and you have to switch anyways then it may be time to reevaluate. If you have small applications that can be linked by computer networks then an AutomationDirect PLC may be fine. If you have large processes (thousands of I/O) requiring integration of drives and redundancy then you may want to consider AB or Siemens.
  3. How can you program so many different PLCs? Most good PLC programmers, after learning three different PLC programming languages, can program most any PLC since the basic functions are the same. In fact there is an International PLC programming standard (IEC 61131-3) that your best PLC manufacturer’s are adopting.

To learn more
There is a lot you can learn about PLCs.  For example, there are books written on PLCs and some of these books do not seem complete.  If you want to learn more, there are many good resources.  As always try searching the best source of information -- the internet.

Tutorial - LADDER LOGIC

PLCs are traditionally programmed in a notation known as Ladder Logic or Relay Ladder Logic. This notation is easy for technicians to read and understand. Remember that the first PLC’s were designed to replace large numbers of relays and they were designed to be easy for the electricians responsible for those systems to be able to analyze and troubleshoot.  You might want to note that a background and understanding of basic electrical circuits is helpful if you plan to program or work with PLC’s. 
An example of a simple motor start/stop circuit is shown below:



 Assume that A is the "start" button, B is the "stop" button and C is the output that tells the motor to run. Imagine power flowing through the ladder logic example. In this case when the operator presses the "Start" button (labeled A above) power flows through the contact labeled A. The [/] contact means "not on" or off. So assuming that the "stop" button (labeled B above) is not pressed then power flows through the B contact and powers the output labeled C and turns on the motor.

Note that we have another contact labeled C below the contact labeled A. This is called a "seal" circuit since contact C "seals" in contact A. Remember the power flow analogy. If it was only the top row: A, B, and C then every time the operator took their finger off the "start" button (contact A) then the motor would stop. But contact C is placed in parallel with contact A so that once the output C turns on then the input C is turned on in parallel with contact A. Therefore the only way to stop the motor is to press the "stop" button (contact B).

Relay ladder logic - RLL) is the basic PLC logic that converts inputs into outputs.  There are several other methods for writing PLC code.  Sequential Function Chart (SFC) is excellent for the programming sequential machines -- however most customers hate it.  Therefore we usually provide the same framework in RLL.   Structured text is another available programming language – much more like a standard high-level language.  Function blocks are also available now on many processors.  Seen used more in DCS (Distributed Control Systems – a completely new discussion), function blocks are somewhat like a “black box” in electronics.  They have a defined set of inputs to the block (don’t get them confused with the PLC inputs) and a defined set of outputs (ditto).  The block performs a manipulation of the inputs to elicit appropriate outputs.  This can greatly enhance the computational ability of the PLC and simplify some applications.  Once again – most clients want to stay in the RLL world.  The number 1 rule associated with PLC programming is “keep it simple.”  Most end users of PLC’s do not have PLC programmers on staff, or if they do many times those programmers are not the people that are called at 3 am at night when a machine is down.  Generally it’s somebody off the maintenance staff that gets pulled in to solve the problem.  The simpler the program – the more likely the problem is diagnosed and fixed quickly. 

There is an organization that is working to standardize the logic in all PLCs.  More information on this can be found at The PLCopen (IEC 1131-3)

Tutorial - SYSTEM ARCHITECTURE

PLCs are continuously expanding in capabilities and the architecture or hardware that is part of that is also expanding with new functionality. There are some hardware components that are basic to every system. A PLC system generally has the following components:


  1. Processor – consists of the CPU, main memory, possibly some communications and interface capability.
  2. I/O – short for Inputs and Outputs – sometimes included in small quantities on a block with the processor
  3. Power Supply – Provides power for the various components of the system -sometimes built into a block with the processor.
  4. Rack/Chassis – Modular systems generally need a common backplane to plug into. Racks are designed to at least accept a processor and multiple I/O cards. Communication from the processor to the I/O is generally achieved through connections on the rack and power from the power supply is generally distributed through the rack.
  5. Communication interfaces – used to communicate with the programmer, operator interfaces, data monitoring tools, SCADA systems, remote I/O, etc. Sometimes built into the processor.
  6. Programming Tool – used to program and access the processor.


The processor is generally what most people refer to when discussing a PLC. Many controls specialists (including myself) tend to interchange PLC, processor and controller when referring to the module that receives the program and handles processing the logic. All of the components together are generally referred to as a PLC system. The processor is where a PLC program would reside and is responsible for receiving data from the input cards and distributing it to the output cards

I/O cards or Input and Output cards are the connections to the real world for the PLC system. As discussed there are discrete I/O and analog I/O. Both come in many different types. Discrete I/O can come in various voltages: 24 Volt DC or AC; 120 VAC; TTL; sourcing; sinking; and on and on. Analog I/O has even more variety. There are Voltage inputs/outputs, Current inputs/outputs and cards that handle both. There are cards that just grab inputs or outputs and cards that have a mix of inputs and outputs. There are cards that are specially designed to connect to Thermocouple and RTD sensors and to compensate for the non-linearity of the signal. I/O can also be local or remote. Local I/O is located in the same rack or chassis as the processor, whereas remote I/O can be located in a separate location that is more convenient to wire into.

The Rack or Chassis is used to house the PLC processor, I/O cards, and other cards that are needed with the system. Some smaller block style PLC systems don’t use racks and even some modular style systems have cards that stack together with each card having the required connectors to pass processor communications and power to each subsequent card.

There are many available communication interfaces ranging from cards designed to communicate via Ethernet to specialized cards designed to communicate on a manufacturers proprietary communication link. Generally those cards are used to allow the programmer to interface with the controller, another device to interface with the controller, or to allow the controller to manipulate and read I/O located in a remote location.

Programming interfaces vary from handheld programmers (yuck) to more modern programs that can be installed on a laptop to interface and program the PLC.

Followers