Tag Archives: programmable logic controller basics

BRX PLC Analog IO – System Configuration

One of the features of the BRX Series PLC is the ability to expand its capability to fit your application. This is easily done by “snap-on” modules that will fit on the side of the BRX MPU (Multi Processor Unit). As we have seen before in the BRX PLC System Configuration post we can add additional discrete inputs and outputs. Automation Direct now offers Analog Voltage and Analog Current input and output modules. These modules come as an 8 point channel unit. There is also a 4 point thermocouple input module also available. We will be configuring, scaling and programming the Analog input and output Voltage modules for our BRX PLC. Let’s get started. Continue Reading!

The 7 Essential Parts of a PLC System

When I was in school PLC’s were just in their infancy. We were taught that the PLC consisted of the central processing unit (CPU), analog and digital inputs and outputs. Everything was programmed with dedicated handheld devices and/or software devices on specialized hardware. We now have modern PLC systems that are capable of so much more. Let’s look at how we can now break up these modern PLC system into the seven essential components.

CPU
Inputs and Outputs (I/O)
Analog I/O
Specialty I/O
Programming Tools
HMI
Networking Continue Reading…

Understanding the PLC Program Scan

Understanding how the PLC will scan and update your program is critical in programming and troubleshooting your system. Typically a PLC will solve your logic from left to right, top to bottom. The status of the memory from the previous rung, are available for the next rung to use. We will look at a few examples to determine how the PLC will solve logic to illustrate the above program scanning.  Keep on Reading!

Click PLC Installing the Software

Previously we discussed the Click PLC System Hardware. Today we will be installing the free software required to program the PLC. This includes the actual program and communication drivers.  Keep on Reading!

Click PLC System Hardware

Many people ask me what I do when looking at a new PLC model or system. My approach is very straight forward and we will view this in action with this Click PLC series. This series will go from examining the hardware to programming and communicating to the PLC in several ways. If you have questions along the way, please let me know. Keep on Reading!

PLC Bits Numbers and Position

People often ask “What is a PLC?” and “PLC Meaning”. A programmable logic controller (PLC) is a piece of hardware that isolates inputs from outputs. Programs are written to look at the inputs solve logic and set the outputs to perform work. Today we are going to look at the basic fundamental way we program. Every PLC company will do this…

Everything in the programmable logic controller actually boils down to bits in the memory.
Memory Bits-min
It is these bits that we manipulate in order to accomplish the work that we need done by the PLC. The instruction set is the method we use to do this. In general, there are several ways to view the bits. Discrete input and output, Numbers and Position of bits will be covered. Understanding the different ways in which we can view these bits will help in developing programs.
Bits are part of the memory of all PLC systems. The memory can be retentive or non-memory retentive. Memory retentive means that if power is lost to the PLC, the status of the bit remains the same when power is restored. If the bit is non-memory retentive, and power is lost the bit returns to the off state. Addressing refers to how the controller understands what memory location to look at. When we address memory in the PLC we can do this in two different ways:
Direct Addressing: Specify a location of the memory location
Indirect Addressing: Specify a location that contains a value to point to the memory location required.
Indirect Addressing Animation

Refer to the manual of the specific PLC that you are using for the way in which memory is addressed and if it is memory retentive or not.

Discrete bits are the basic building blocks in the PLC. When we talk of digital I/O this is referring to the individual bits that you can wire switches, pushbuttons, proximity sensors, or any other device that is either on or off. (1 or 0) They can be usually wired to the PLC as a normally open or normally closed contact. The ladder logic is written in a way that you examine the bit as either on or off.
HOW PLC INPUTS WORK
PLC Input

HOW PLC OUTPUTS WORKPLC Outputs
We also must look at the frequency (rate of change from off to on) of the input bits or output in some cases. The maximum frequency that we can read an input to the PLC will be determined by the scan of the PLC.
Example:
A 2 ms Scan (0.002 second) means that we can read the inputs and solve the logic in 2 ms. In order to ensure that the input is read in both states (on / off) we have to ensure that the input is off or on for at least 2 ms. The maximum frequency (Switching / Second) that the input could switch would be 2 ms = 1/.002 times per second = 500hz

Numbers in the PLC are all based on binary. Analog inputs and outputs are based upon the number of bits put together in order to display the range for the input. (12 bit or 16 bit) The values from the analog 12bit input will go from 000 to FFF base 16 (Hex). Hexadecimal is used to display the binary bits in the word or register. Some of the more common numbering systems in the PLC are binary, hexadecimal, BCD (binary coded decimal) and octal (based on 8 bits)
funny_counter
Additional Information on understanding numbering systems in the PLC:
What Everybody Ought to Know about PLC (Programmable Logic Controller) Numbering Systems

Position of the bits within the word, stack or accumulator can be very useful. Usually we can use this to track items. The typical example of this is to track items on a conveyor belt. The belt movement is usually a pulse input from an encoder. A sensor indicates the item on the conveyor.
PLC PROGRAMMING EXAMPLE – SHIFT REGISTER (CONVEYOR REJECT)
Conveyor Reject

Bits are the basic building blocks that we use to program programmable logic controllers. The three ways to view bits (Discrete, Number and Position) will help use to understand the different ways to program.
Here are some additional links that you may find helpful:
Five Steps to PLC Program Development
PLC Programming Example – Process Mixer
PLC Programming Example – Shift Register (Conveyor Reject)
PLC Programming Example – Paint Spraying

The Secret of Using Counters
The Secret of Using Timers

Watch on YouTube : PLC Bits Numbers and Position
If you have any questions or need further information please contact me.
Thank you,
Garry



If you’re like most of my readers, you’re committed to learning about technology. Numbering systems used in PLC’s are not difficult to learn and understand. We will walk through the numbering systems used in PLCs. This includes Bits, Decimal, Hexadecimal, ASCII and Floating Point.

To get this free article, subscribe to my free email newsletter.


Use the information to inform other people how numbering systems work. Sign up now.

The ‘Robust Data Logging for Free’ eBook is also available as a free download. The link is included when you subscribe to ACC Automation.

Create a PLC with HMI Training and Learning Environment Free

Learn PLC programming and use a powerful HMI (Human Machine Interface) easily and free. We will use the Automation Direct Do-More programming software tied into the Advanced HMI package via Modbus TCP.
PLC HMI Training Learning 0080-min

Our application will show a HMI screen with a panel meter and a reset button. The panel meter value may be changed by clicking it. This will bring up a input screen to put in a number. When the reset button is selected the input value entered will show on the panel meter.
PLC HMI Training Learning 0310-min

Since we will be communicating via Modbus TCP, the following table shows the Coil/Register Numbers and the associated Do-More PLC Addresses.

Coil/Register Numbers Data Addresses Type Do-More PLC Table Name
00001-09999 0000 to 270E Read-Write MC1 to MC1023 Discrete Output Coils
10001-19999 0000 to 270E Read-Only MI1 to MI1023 Discrete Input Contacts
30001-39999 0000 to 270E Read-Only MIR1 to MIR2047 Analog Input Registers
40001-49999 0000 to 270E Read-Write MHR1 to MHR2047 Analog Output Holding Registers

Note: The Do More PLC uses the Modbus area to communicate. This is because having direct access to the digital I/O can be dangerous when connected via Ethernet to the internet. Data must move in and out of this area via the PLC program.

We will first start with the PLC.
Automation Direct has a powerful simulator with their Do-More PLC. It is the Do-More Designer Software. This software simulator includes the entire instruction set (Not Just Bit Logic) as well as communication protocols. It can be downloaded and installed for free from the above link.
Our PLC program will have the following addresses:
Digital Panel Meter Present Value (PV) – MHR1 – Modbus 40001
Digital Panel Meter Set Value (SV) – MHR2 – Modbus 40002
Reset Button – MC1 – Modbus 00001

The first rung of the ladder will use the 1 second pulse bit and increment the PV value of our digital panel meter. This will also compare the current value to 4000 and if greater or equal, move the value of zero into the PV value.

The second rung of the ladder will move WX0 analog value from our simulator into the PV value of our digital panel meter.

The last rung of ladder will move the SV value into the PV value of our Digital Panel Meter. This happens when the reset is hit.

PLC HMI Training Learning 0200-min

The simulator is showing X0 on and we can then use the WX0 slider to change the PV value of the Panel Meter.
PLC HMI Training Learning 0210-min

Advanced HMI is a powerful HMI/SCADA (Supervisory Control and Data Acquisition) development package that takes advantage of Visual Studio. There is no coding required and you can simply drag and drop items onto the page. The best thing is that the software is free.

Communications drivers include the following and are accessible via VB or C# code:

  • Allen Bradley DF1 RS232 Driver
  • Allen Bradley Ethernet/IP Driver for SLC,MicroLogix, ControlLogix, and CompactLogix
  • Beckhof TwinCAT Driver
  • ModbusTCP Driver
  • ModbusRTU Driver
  • Omron Ethernet FINS Driver – Ethernet for newer controllers such as CP1H with Ethernet module
  • Omron Serial FINS Driver – Serial (RS232 / RS485) for newer controller such as CP1H
  • Omron Serial HostLink Driver – Serial (RS232 / RS485) for controllers such as CQM1, C200H, K-Series (C28K), C200, etc

The power of Advanced HMI is that it works within Visual Studio. This is a program integrated development environment (IDE) that you can take advantage of to modify or create new features including data logging applications.

Advanced HMI runs on Visual Studio 2008 or higher and will need to be installed on your PC. Visual Studio Community Edition 2015 is the latest version of the software. If you do not have it installed, please download and install from the following link.

https://www.visualstudio.com/en-us/products/visual-studio-community-vsPLC HMI Training Learning 0090-min

We will now need the Advanced HMI project. Here is the link to download the zip file.

http://sourceforge.net/projects/advancedhmi/PLC HMI Training Learning 0095-min

After downloading ‘AdvancedHMIBetaV399a.zip’ extract the files from the zip file. (Right Click.. Select Extract All)
Note: Your version might be different than the one above.

Open the solution file (AdvancedHMIv35.sln) from the extracted files in the root directory.
PLC HMI Training Learning 0097-min

PLC HMI Training Learning 0100-min

Our initial screen looks like the following. The project will now need to be compiled in order to add the components to the Toolbox.
Select Build | Build Solution from the menu
The next thing to do is add the communication to the form. On the left hand side of the screen you will see the ‘Toolbox’. Click on it and under AdvancedHMIDrivers Components we will select ModbusTCPCom. To actually add a component to our form you need to drag it. Select the component and as you hold the mouse button down move to the form.PLC HMI Training Learning 0120-min

After adding the ModbusTCPCom component, it will appear at the bottom, beneath our form.
Click on the ModbusTCPCom1 at the bottom of our form. On the right hand side you will notice the properties for this communication driver. Under Communication Settings | IP Address, enter the value  of the IP Address for the PLC. (192.168.1.3) Ensure that the port number is 502. This is the default port number for Modbus TCP.PLC HMI Training Learning 0130-min

We can now add the digital panel meter. From the toolbox select and drag the DigitalPanelMeter to our form.PLC HMI Training Learning 0140-min

Resize the panel meter on the form by dragging a corner of the component.
While the panel meter is clicked, set the Properties | PLC Properties of the component:
PLCAddressValue – 40001 – MHR1 – Value to display on the meter.
PLCAddressKeypad – 40002 – MHR2 – This is the location of the stored number when the operator selects the meter and enters a number in the keypad.PLC HMI Training Learning 0150-min

Add a MomentaryButton to our form by selecting and dragging it from the toolbox.PLC HMI Training Learning 0160-min

After re-sizing the component, we can change the colour to blue under Properties | Misc. Also change the text on the button to ‘RESET’
Set the PLCAddressClick value to 00001. This is address MC1 in the Do-More PLC.PLC HMI Training Learning 0170-min

Run the application by selecting the ‘Start’ form the top menu. This also can be started by hitting ‘F5’. The form will then show in a separate window and the panel meter will be incrementing the value. Hitting the reset button will reset the value to the one entered when you click the panel meter.PLC HMI Training Learning 0310-min

When you hit the panel meter on the display a keypad will then pop up on your screen. Enter the new value and then select ‘Enter’. The new value will appear in MHR2 in the Do-More PLC.
PLC HMI Training Learning 0320-min

Watch on YouTube : Create a PLC with HMI Training and Learning Environment Free
If you have any questions or need further information please contact me.
Thank you,
Garry



If you’re like most of my readers, you’re committed to learning about technology. Numbering systems used in PLC’s are not difficult to learn and understand. We will walk through the numbering systems used in PLCs. This includes Bits, Decimal, Hexadecimal, ASCII and Floating Point.

To get this free article, subscribe to my free email newsletter.


Use the information to inform other people how numbering systems work. Sign up now.

The ‘Robust Data Logging for Free’ eBook is also available as a free download. The link is included when you subscribe to ACC Automation.

Three Free PLC Programming Software Tools

Every manufacturer has there own software to program the programmable logic controller (PLC) or the human machine interface (HMI). However there are a few tools that are free which will help in the development of your PLC programs. We will look at three of these software tools and show how beneficial they can be to you.

Synergy

When programming, I usually will have my laptop for the ladder logic and my desktop for the screen software. Connecting the two together and using one mouse and keyboard saves me the aggravation of switching back and forth between the keyboards.
Synergy Splash

Synergy lets you easily share a single mouse and keyboard between multiple computers with different operating systems each with its own display without special hardware. It is intended for users with multiple computers on their desk since each system uses its own monitor(s). Redirecting the mouse and keyboard is as simple as moving the mouse off the edge of your screen. Synergy also merges the clipboards of all the systems into one, allowing cut-and-paste between systems. It works on Windows, Mac OS X and Linux.

Synergy Website
http://synergy-project.org/
Downloads:
Synergy for Windows:
http://download.cnet.com/Synergy/3000-2072_4-10714570.html
Synergy for Mac
http://download.cnet.com/Synergy/3000-2094_4-75362427.html

Windows Calculator

That’s right. The windows calculator can be a very helpful tool when it comes to programming PLCs. When you need to convert, hexadecimal to binary, BCD to hexadecimal, or any other combination the windows calculator can do it for you.

What everybody ought to know about PLC numbering systems.

Start the calculator. Start – All Programs – Accessories – Calculator
Calculator 01

View the programmer calculator. View – Programmer (Alt + 3)
Calculator 02 Programmer

We can then choose Hex for our numbering system. Then Word for our length of address. You will notice that the display will show the Bin equivalent along with the marking of bit 0 to bit 15.
Calculator 03 Programmer

7ABC base 16 = 0111 1010 1011 1100 base 2 = 31420 BCD
Calculator 04 Programmer

Note: I am using Windows 7, but all of the versions of window calculator have similar functionality.

Windows HyperTerminal

Serial communication can be difficult using the PLC. HyperTerminal can be used to monitor the communication being sent from or to the programmable logic controller. Just hook up to the serial port and program HyperTerminal to monitor the port. Set the correct Data Bits, Baud Rate, Parity, Stop Bits etc. Viewing the information on the monitor will assist you in seeing the exact data being sent to, or received by the PLC.
HyperTerminal

HOW TO IMPLEMENT THE OMRON PLC HOST LINK PROTOCOL

Hype Terminal – Windows 7 and 8

HyperTerminal was no longer sent with windows when Windows 7 was introduced.

Hype Terminal is fully functional replacement of HyperTerminal, perfect for GSM and GPS debugging, works with AT Commands. You can use Hype Terminal to help debug source code from a remote terminal. You can also use Hype Terminal to communicate with older character-based computers. Hype Terminal is designed to be an easy-to-use tool and is not meant to replace other full-feature tools available on the market.
HypeTerminal

Download Hype Terminal:
http://download.cnet.com/Hype-Terminal/3000-2086_4-76158601.html

Watch on YouTube : Three Free PLC Programming Software Tools
If you have any questions or need further information please contact me.
Thank you,
Garry



If you’re like most of my readers, you’re committed to learning about technology. Numbering systems used in PLC’s are not difficult to learn and understand. We will walk through the numbering systems used in PLCs. This includes Bits, Decimal, Hexadecimal, ASCII and Floating Point.

To get this free article, subscribe to my free email newsletter.


Use the information to inform other people how numbering systems work. Sign up now.

The ‘Robust Data Logging for Free’ eBook is also available as a free download. The link is included when you subscribe to ACC Automation.

What Everybody Ought to Know About PLC Programming Languages

PLC programs are normally written in a special application on a personal computer, then downloaded to the PLC. This downloaded program is similar to compiled code to keep the program efficient. The program is stored in the PLC either in battery-backed-up RAM or some other non-volatile flash memory.

Albert Einstein said “The world as we have created it is a process of our thinking. It cannot be changed without changing our thinking” PLC programming languages have evolved to both adapt and change the way we program these units. We will look at all five programming languages as defined by the IEC 61131-3 Standard.

  • Structured Text (ST)
  • Function Block Diagram (FBD)
  • Sequential Function Chart (SFC)
  • Instruction List (IL)
  • Ladder Diagram (LD)

Not all of these programmable controller languages are available in every PLC. Ladder logic programming is by far the largest percentage of use in PLC’s today. Fundamental concepts of PLC programming are common to all manufacturers. Differences in I/O addressing, memory organization, and instruction sets mean that PLC programs are never interchangeable between different makers. Even within the same product line of a single manufacturer, different models may not be directly compatible. This is true when looking at manufactures that private label other controllers.

Estimates are as high as 95% of installations use ladder logic programming in the programmable logic controller.

The PLC programming language that is used can be decided when you look at the following:

  • Maintenance and troubleshooting
  • Knowledge of language
  • Acceptance of the country, location, or individual plant
  • Application of the PLC
  • Ease of changing PLC program

The actual programming of the PLC is the second last step in the development of programs. The five steps to PLC program development is a good method to follow before picking what programming language to use. As mentioned before the languages supported by each PLC may differ. Please refer to the types of programming that are available for your model and version of PLC.

Let’s quickly review some of the different programming languages for the PLC.

Structured Text (ST) is a high level programming language that closely resembles Pascale programming. Statements are used to define what to execute.
ST MP50pro_st

Function Block Diagram (FBD) is a graphical representation of AND, NAND, OR, NOR gates, etc. that are drawn. It will describe the function between input and output variables.
FBD MP50pro_fbd

Sequential Function Chart (SFC) is like a flowchart of your program. It defines the steps through which your program moves.
SFC MP50pro_sfc

Instruction List (IL) can also be referred to as mnemonic code and statement list. It contains simple instructions for looking at your variables.
IL MP50pro_il

Ladder Diagram (LD) is the most popular programming language for the PLC. It was written to mimic the mechanical relays in the panel that the programmable logic controller replaced. It has two vertical rails and a series of horizontal rungs between them. Controllers will usually scan from left to right top to bottom. The output of one rung is available for the next rung.
LD MP50pro_ladder

Note: All pictures from PLCopen IEC 61131 Basics

PLC programming methods are evolving. PLC Open is an organization that is defining new methods to take advantage of the latest computer innovations. They have defined the IL method of programming to XML (Extended Markup Language) which is used for web development. This in my opinion keeps moving the ideal method, to a standard way to program PLCs.

If you have any questions or need further information please contact me.
Thank you,
Garry



If you’re like most of my readers, you’re committed to learning about technology. Numbering systems used in PLC’s are not difficult to learn and understand. We will walk through the numbering systems used in PLCs. This includes Bits, Decimal, Hexadecimal, ASCII and Floating Point.

To get this free article, subscribe to my free email newsletter.


Use the information to inform other people how numbering systems work. Sign up now.

The ‘Robust Data Logging for Free’ eBook is also available as a free download. The link is included when you subscribe to ACC Automation.

Five Steps to PLC Program Development

Programming a PLC can sometimes be a daunting task. The best method is to break the task into some smaller steps. These are the steps that I have used for years. We will apply them to a die stamping application.

1 – Define the task:

What has to happen?
Die Stamping

A master switch is used to start the process and to shut it down. Two sensors: an upper limit switch that indicates when the piston is fully retracted and a lower limit switch that indicates when the piston is fully extended. When the master switch is turned on the piston reciprocates between the extended and retracted positions. This is achieved with an up and down solenoid. When the master switch is turned off, the piston returns to the retracted position and all solenoids are off.

2 – Define the Inputs and Outputs:

Inputs:
Master Switch – On/Off
Upper Limit Switch – On/Off
Lower Limit Switch – On/Off

Outputs:
Down Solenoid – On/Off
Up Solenoid – On/Off

3 – Develop a logical sequence of operation:

This can be done with the use of a flow chart or sequence table. You can use anything to fully understand the logic of the operation before programming. Many people do not use this step and jump straight to programming.

Fully understanding the logic before starting to program can save you time and frustration.

Sequence Table: The following is a sequence table for our die stamping application. I usually review this sequence with the person with the most knowledge of the machine. This can be the designer and / or the machine operator.
Sequence Table

How to read the Sequence Table: Follow the steps from left to right, top to bottom. Inputs and outputs are labelled as 1 (ON), 0 (OFF) or X (Does not Matter). Step 1 indicates that it does not matter the upper and lower limit switch positions. The master switch is off, so the up and down solenoids are off. Steps 3 and 4 repeat themselves as long as the master switch is on.

Note: You will notice that at step 2, after the master switch turns on the up solenoid will be activated. So the piston always retracts when the master switch is first turned on.  This operation was picked up in development of our logical sequence.

4 – Develop the PLC program:

Look at the sequence table in respect to the following logic. I have used Set and Reset conditions so it is easily followed by the sequence table. When the master switch turns on the up solenoid is activated. Notice the first rung is a direct correlation. Follow the rest of the sequence table with this ladder logic.

PLC Program Die Stamping
Document, Document, Document This is a vital part of every program, which will save you time and money when you have to return to the program years later.

5 – Test the program:

Die_Stamping
Test the program with a simulator or actual machine. Make modifications as necessary. Check with the people most knowledgeable on the machine, to see if it is doing what they expect. Do they need something else? Follow up after a time frame to see if any problems arise that need to be addressed.

These five steps will help you in your PLC programming.

  1. Define the task
  2. Define the inputs and outputs
  3. Develop a logical sequence of operation
  4. Develop the PLC program
  5. Test the program

The five steps form the basis of all PLC development. You will notice that the actual programming does not occur until the second last step. Usually more time is spent on understanding the task and sequence of operation.

Watch on YouTube : Five Steps to PLC Program Development
If you have any questions or need further information please contact me.
Thank you,
Garry



If you’re like most of my readers, you’re committed to learning about technology. Numbering systems used in PLC’s are not difficult to learn and understand. We will walk through the numbering systems used in PLCs. This includes Bits, Decimal, Hexadecimal, ASCII and Floating Point.

To get this free article, subscribe to my free email newsletter.


Use the information to inform other people how numbering systems work. Sign up now.

The ‘Robust Data Logging for Free’ eBook is also available as a free download. The link is included when you subscribe to ACC Automation.