Tag Archives: programmable logic controller tutorial

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!

BRX PLC AdvancedHMI Communication – Modbus TCP

Advanced HMI is a powerful, adaptable 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. We will look at using AdvancedHMI with the BRX Series PLC.

Our sample BRX PLC program will display a digital panel meter and a gauge of a value in the PLC. Stop and start momentary pushbuttons on the HMI will allow this number to increase or stop. An indication will turn green when the number is increasing and red when it has stopped. The AdvancedHMI package will communicate Modbus TCP over Ethernet to the BRX PLC. We will be able to monitor our process via the AdvancedHMI window. Lets get started. Watch on YouTube…
Continue Reading!

PLC Programming Example – Palletizer

We will apply the five steps to PLC program development to a palletizer example. Our example will allow you to determine how many layers of boxes you want on each skid.

Developing the PLC program is a process that can be clearly defined. In our series on the five steps to PLC program development we have done some similar practical examples.
PLC Programming Examples – Five Steps to PLC Program Development
– Press
Process Mixer
Shift Register (Conveyor Reject)
Paint Spraying
Delay Starting of 7 Motors
– Pick and Place
– Sorting Station (Shift Register)

Define the task: (1)
Watch the sequence of operation video below. This will demonstrate the pallet layer selection, running and resetting of the machine.
Watch on YouTube : PLC Programming Example – Palletizer Testing
Continue Reading!

BRX PLC Compare Instructions

Compare instruction are often used in PLC programs to test pairs of values. The output of this comparison conditions the logical continuity of a rung. The BRX series of programmable logic controllers has the following compare contact instructions.
= (if Equal contact)
<> (if Not Equal contact)
> (if Greater Than contact)
>= (if Greater Than or Equal contact)
< (if Less Than contact)
<= (if Less Than or Equal contact)
Besides these instruction the BRX PLC will also have compare instructions for the built in real time clock of the system. We will be looking at these instructions along with some programming examples. As a system integrator, this ability can prove very useful to you in the field when commissioning your automation system.
Lets get started with the BRX PLC Compare Instructions. Continue Reading!

BRX PLC Numbering Systems and Addressing

The BRX PLC like all of the PLCs in the Do-More Series use strong data typing. This means that there are fixed memory structures to work with in your program. Errors will be displayed if you try to put the wrong type of value in the memory location. The data structures will automatically assist you in your automation system.
Memory can now be as flexible as you want and need. You can define and allocate all the data memory the way you want it up to specific maximums. As a system integrator you determine what best fits your automation framework.
We will be looking at the addressing and numbering systems in the BRX Series PLC. Let’s get started. Continue Reading!

BRX PLC Establishing Communication

We will now use the Do-More Designer software to establish communication with the BRX PLC. This is the same software that we used in the Learn PLC Programming Fee Video Series. Using the Do-More Designer software, we will communicate via USB, RS485 and Ethernet. These three methods will allow us to communicate to our BRX PLC in order to program or troubleshoot this controller. Once we have established communication we will then look at updating the firmware in our controller. Let’s get started. Continue Reading!

Implementing the Omron Host Link Protocol (VB.Net)

Previously we used VB6 (Visual Basic 6) to implement the Omron Host Link Protocol to communicate to our programmable logic controller. (PLC) In part 2 we used Visual Basic for Applications (VBA) to accomplish our host link serial communication. We will now look at using VB.Net to establish and retrieve information in and out of the PLC using host link. (C mode commands)

Hostlink communication protocol is a method developed by Omron for communication to PLC’s and other equipment. This ASCII based protocol is used over RS232 or RS422/RS485. It is a many to one implementation which means that you can communicate with up to 32 devices back to a master. (1:N) This communication on the industrial floor can control PLC’s, Temperature Controllers, Panel Meters, etc.

The Omron CP1H plc will be used with a CP1W-CIF11 (RS485) communication serial link adapter. We will also use a USB-485M Universal Serial Bus to RS485 adapter from automation direct. The video at the end of this post will demonstrate the communications by reading 10 registers form the DM area of the PLC. 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.

Inputs and Outputs (I/O)
Analog I/O
Specialty I/O
Programming Tools
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!

Building a PLC Program That You Can Be Proud Of – Part 6

We will continue the series by looking at a sequencer controlling seven cylinders that can be taught. The cylinders can be operator programmed from the AdvancedHMI screen. You will be able to select what cylinders to activate at each step and program in 500 steps. Our PLC will be the Do-More from Automation Direct.
Cylinder Teach HMI 110-min

Here is a quick review of the programming series so far. If you are new to the site, we recommend reviewing the other parts in the series first.
In part 1 we looked at writing PLC programs to control a traffic light using discrete bits and then using timed sequencing using indirect addressing.
Part 2 used indirect addressing for inputs as well as output to control the sequence of pneumatic (air) cylinders in the program. Part 3 and 4 we returned to the traffic light application and expand our program significantly. We looked at the sequence of operation using Input, output and mask tables.
In part 5 we used the AdvancedHMI software to create the game of Simon. A round in the game consists of the device lighting up one or more buttons in a random order, after which the player must reproduce that order by pressing the buttons. As the game progresses, the number of buttons to be pressed increases.

We will be using AdvancedHMI to communicate Modbus TCP to the Automation Direct Do-More Designer Software Simulator. The following is the sequence of operation:
Watch on YouTube : Running the Cylinder Sequence (PLC / HMI)
Note: All of the  programs used are provided free of charge and are an excellent way to learn PLC / HMI programming.

The following table is the Modbus TCP memory map to the Do-More PLC:

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

Cylinder Teach HMI 100-min
Here are the inputs and outputs we will be using for our program:

Device Data Addresses Type Do-More PLC Description
Start Pushbutton 00011 Input MC11
Stop Pushbutton 00012 Input MC12
Jog Pushbutton 00013 Input MC13
Reset Pushbutton 00014 Input MC14
Run/ Jog Selector 00008 / 00015 Input/ Output MC8 / MC15  MC8 is the value and MC15 is the click
Light Stack 00010 / 00009 / 00008 Output MC10 / MC9 / MC8  Red / Green / Amber
Set Pushbutton 00071 Input MC71
Jog / Teach Selector 00070 Input MC70  MC70 on is teach mode
Sequence Step (Panel Meter) 40001 Output MHR1  Current step in the sequence
Inputs Actual 40002 Input MHR2  Show the actual inputs in binary format
Output Sequence 40003 Output MHR3  Show the actual outputs in a binary format
Input Sequence 40004 Input MHR4  Show the input sequence bits in a binary format
Cylinder 1 to 7 – value 00001 to 00007 Output MC1 to MC7  Determine if cylinder is on/off
Cylinder 1 to 7 – set (click) 00041 to 00047 Input MC41 to MC47  Set the cylinder button
Cylinder 1 to 7 – retract indicators 00021 to 00027 Input MC21 to MC27 Indicate cylinder has retracted
Cylinder 1 to 7 – extend indicators 00031 to 00037 Input MC31 to MC37 Indicate cylinder has extended
Cylinder 1 to 7 – extend / retract error indicators 00050 to 00063 Output MC50 to MC63 Indicate cylinder input error when jogging

The first thing we will do is design the HMI. We have three main areas on the screen. Basic Controls, Cylinder Visualization and the Sequence Step/Teach area. Please refer to the above reference chart for the inputs and outputs programmed on the screen.
Cylinder Teach HMI 130-min

Basic Controls:
This area will allow us to see what mode we are in via the stack light. Red – Stop
Yellow – Jog / Teach Mode – Troubleshooting
Green – Run
Cylinder Teach HMI 101-min

Cylinder Visualization:
Each cylinder will have indication lights to determine status of the cylinder. (Extended / Retracted)
The cylinder will also have red indication lights to reflect the differences between the current sequence and the next sequence step. This is visible when we are in jog mode.
Cylinder Teach HMI 102-min

Sequence Step/Teach:
When in jog or teach mode the sequence step is visible, which indicates the current step that we are on. The inputs and outputs are displayed as a binary value which represents the actual inputs and outputs. This is valuable when troubleshooting and finding errors in the system. The set button is visible when in teach mode. When pushed the outputs and inputs are set for that step and the sequence will then increment.
Cylinder Teach HMI 103-min

The following is the code for each of the words that the DataScribers are reading. This includes the code to change the word into a 16 bit binary value.

Private Sub DataSubscriber1_DataChanged(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles DataSubscriber1.DataChanged
'Label1.Text = Hex(DataSubscriber1.Value)Dim i As Integer = DataSubscriber1.Value
Label1.Text = Convert.ToString(i, 2).PadLeft(16, "0") '16 bits
End Sub
Private Sub DataSubscriber2_DataChanged(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles DataSubscriber2.DataChanged
'Label2.Text = Hex(DataSubscriber2.Value)
Dim i As Integer = DataSubscriber2.Value
Label2.Text = Convert.ToString(i, 2).PadLeft(16, "0") '16 bits
End Sub
Private Sub DataSubscriber3_DataChanged(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles DataSubscriber3.DataChanged
Dim i As Integer = DataSubscriber3.Value
Label3.Text = Convert.ToString(i, 2).PadLeft(16, "0") '16 bits
End Sub
Private Sub DataSubscriber4_DataChanged(sender As Object, e As Drivers.Common.PlcComEventArgs) Handles DataSubscriber4.DataChanged
If DataSubscriber4.Value = True Then
     Label1.Visible = True
     Label2.Visible = True
     Label3.Visible = True
     Label4.Visible = True
     Label5.Visible = True
     Label1.Visible = False
     Label2.Visible = False
     Label3.Visible = False
     Label4.Visible = False
     Label5.Visible = False
End If
End Sub

We will now look at the PLC ladder program. The program is broken down into several parts as follows:

ACC Automation
This is the main start / stop circuit of the program.
If we are in run mode the green light will be on. (MC9)
If we are not in jog mode (MC8) this circuit will be functional.
Cylinder Teach PLC 100-min

If we are not run mode (MC9) or in jog mode (MC8) then the stop mode is active.
This will turn on the red light. (MC10)
Cylinder Teach PLC 110-min

Run / Jog – Toggle Circuit
Flip Flop circuit to set the jog function
Cylinder Teach PLC 120-min

Move the outputs to the physical outputs when we go to run mode.
Cylinder Teach PLC 130-min

Indirect Addresses for the Program
V0 – Input pointer – 100 – 499
V1 – Output pointer – 500 – 999
V2 – Input pointer last step in sequence
V3 – Output pointer last step in sequence
V10 – Inputs to the sequencer
V20 – Outputs from the sequencer
Cylinder Teach PLC 140-min

Jog Mode – Jog Pushbutton
Cylinder Teach PLC 150-min

Reset the sequencer pointers. This will happen automatically in run mode or by hitting the reset button in jog or stop mode.
Cylinder Teach PLC 160-min

Teach Function
This first rung will activate the values so we can manually turn them off/on with the HMI screen.
Cylinder Teach PLC 170-min

This will reset the pointers when going into teach mode.
Cylinder Teach PLC 180-min

This will set the teach point and increment to the next step.
Cylinder Teach PLC 190-min

Show the current step of the sequence.
Note: 0 is the first step
Cylinder Teach PLC 200-min

Set the inputs for cylinders.
The actural physical input points would be inserted here.
HMI inputs from the cylinders have a 500ms delay to simulate the movement of the actual cylinder.
Cylinder Teach PLC 210-min Cylinder Teach PLC 220-min

Set the actual inputs / sequencer inputs / sequencer outputs so we can monitor this on the HMI.
Cylinder Teach PLC 230-min

Set the outputs for cylinders.
This will set the physical output points Y1 to Y7.
This will also set the HMI cylinders MC1 to MC7 (00001 to 00007)
Cylinder Teach PLC 240-min Cylinder Teach PLC 250-min Cylinder Teach PLC 260-min

Diagnostic Bits for indicating the difference for the inputs to the PLC. This will show up as a red indication light on the cyclinder represented on the HMI.
Cylinder Teach PLC 270-min Cylinder Teach PLC 280-min

This section of PLC logic will mimic the inputs from the cylinders.
Cylinder 1 – Retract MC21 (00021) – Extend MC31 (00031)
Cylinder 2 – Retract MC22 (00022) – Extend MC32 (00032)
Cylinder 3 – Retract MC23 (00023) – Extend MC33 (00033)
Cylinder 4 – Retract MC24 (00024) – Extend MC34 (00034)
Cylinder 5 – Retract MC25 (00025) – Extend MC35 (00035)
Cylinder 6 – Retract MC26 (00026) – Extend MC36 (00036)
Cylinder 7 – Retract MC27 (00027) – Extend MC37 (00037)

Between each funtion of the cylinder there is a time delay for the input to turn on and off of 500msec.
Cylinder Teach PLC 290-min

Cylinder 2 – Retract MC22 (00022) – Extend MC32 (00032)
Cylinder Teach PLC 300-min

Cylinder 3 – Retract MC23 (00023) – Extend MC33 (00033)
Cylinder Teach PLC 310-min

Cylinder 4 – Retract MC24 (00024) – Extend MC34 (00034)
Cylinder Teach PLC 320-min

Cylinder 5 – Retract MC25 (00025) – Extend MC35 (00035)
Cylinder Teach PLC 330-min

Cylinder 6 – Retract MC26 (00026) – Extend MC36 (00036)
Cylinder Teach PLC 340-min

Cylinder 7 – Retract MC27 (00027) – Extend MC37 (00037)
Cylinder Teach PLC 350-min

This is the end of the PLC program. You can see that the program is not very complicated once you break down the individual steps.

Download the PLC program and the Bin directory for the AdvancedHMI screen.

Watch on YouTube : Building a PLC Program that You can be Proud Of – Part 6b – Explaining the Program
If you have any questions or need further information please contact me.
Thank you,

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.