Welcome to the third part of our PLC training for beginners! In this part, we will do an introduction to Studio 5000 programming software to program our controller and focus on Ladder Diagram.
This training is structured into four parts. You are now in Part 3. If you landed here and want to start at the beginning, feel free to jump to Part 1: PLC Basics or go back to Part 2: PLC Hardware Components.
- History of the PLC
- PLC Architecture
- Rockwell automation PLCs
- Central Processing Unit- CPU
- Power Supply
- Digital And Analog IO
- Choose suitable PLC hardware for your application
- Studio 5000 Introduction
- Studio 5000 Installation and Activation
- Get Started with Studio 5000
- Ladder Diagram Basic Instructions
- IO Configuration
- Let's develop a basic program...
- Configure the controller in Studio5000
- Download logic to the controller
Though this is general PLC training for beginners, it will be focused on Rockwell automation PLCs and software in the examples.
Part 3 - PLC Programming
In parts 1-2, we were focused on the hardware side. In this part, we will do the software side. Studio 5000, Rockwell’s leading PLC programming software, is used to program ControlLogix and CompactLogix controllers.
Studio 5000 Introduction
Studio 5000 is the new name for RSlogix 5000 that existed from the early days when ControlLogix was born in 1997. The CompactLogix was released in 2006 and was also supported by RSlogix 5000.
As described in part 2, we have a CPU, IO modules, and communication modules in the PLC system. The program running and controlling all this hardware is programmed by Studio 5000 and can be downloaded to the PLC and modified in the future.
The latest version of Studio 5000 is V32. In the last years, Rockwell updated the versions of Studio5000 rapidly, adding functionality and fixing bugs, but the main features of Studio 5000 didn’t change between the versions.
Studio 5000 Installation and Activation
In this training, we will not explain the installation and activation of Studio 5000 in detail. We assume that you already have it ready for use.
Get Started with Studio 5000
Ok, Let’s start being more practical.
Open Studio 5000 and Create New Project
Open Studio 5000 from the start button:
The Studio 5000 will open with this quick start screen, press New Project:
Chose the PLC type, here you will find all the controllers supported by Studio 5000. Of course, it will be all ControlLogix and CompactLogix controllers.
Give the new project a name, in our case it will be “Test_Project”:
New, we will choose a few hardware-related properties according to the type of controller we chose. here the ControlLogix L85E controller was chosen, and the properties are:
- Revision – The controller firmware has to match this version.
- Chassis – Chassis size 4,7,10,13.
- Slot – The slot of the CPU in the chassis.
For other properties, we will leave the default values.
Studio 5000 Main View orientation
Finally you will see the main view of the Studio 5000. don’t be overwhelmed, I will explain the necessary properties required for this training.
Project name – as the name you assigned earlier to the project. It can be changed later from the controller properties settings.
Project Hierarchy – Tasks -> Programs -> Routines
Controller Tags – Tags and IO database, Controller Tags is the global level of tags, the local level is Program Tags.
IO Configuration – Here, the type of controller, IO Modules, And Communication modules are configured. This is the connection to the actual hardware.
Controller Status – Online/Offline/Program. Program: A state where the logic isn’t running and outputs are disabled
Controller Key Mode –
- Run – Logic is scanned, outputs are energized
- Prog – Logic isn’t scanned, outputs are disabled
- REM – Remote – The software controls the mode
Ladder Diagram Instructions – Relay Instructions, Timers, Counters, etc. Drag and Drop Into The Rung.
Rungs – Ladder Diagram Canvas, Drag and Drop From The Instructions Tab. Stored In The MainRoutine.
Communication Tab – From there, you can download and upload the program.
Routine – the logic code is saved as a routine. In our case, only the “MainRoutine” exists.
Program – a program contains the routines and the Program tags (those are local tags, in this training, we will use only Controller tags that are global to the project). You can have multiple routines with different names in one program. In our case, the program “MainProgram” contains one routine named “MainRoutine”.
Task – a task contains one program or more. In our case, the task “MainTask” includes one program named “MainProgram.” There are three types of tasks:
- Continues – The task will run all the programs and routines cyclically.
- Periodic – The task will run all the programs and routines every period (milliseconds). Most suggested since it enables control of the scan timing.
- Event – Task will run all the programs and routines when a condition is met, like tag change, or EVENT Instruction is scanned in the logic.
Controller tags vs Program tags
Tags are the controller’s database, and it includes IO tags (created automatically when adding hardware in the IO configuration section) and memory tags (created manually by the user).
Controller Tags are global to all tasks, programs, and routines. This means that you can program code wherever you want and reference those tags.
Program tags, Unlike Controller Tags, the Program tags are local for the program. Therefore, you can only reference those tags from a code in the same program.
In the beginning, it’s better to create Controllers Tags only. It will help you avoid confusion.
Ladder Diagram Basic Instructions
If you want to read about different PLC programming languages visit our blog post – Popular PLC Programming Languages.
Here will focus on the basic Ladder logic instructions:
Those are the most basic instructions:
- New rung – simply adding a new rung to the routine.
- Branch – add a branch when you need to conditions in parallel.
- Branch level – like a regular branch, it will add a new branch aligned with the previews branch.
- XIC – Examine on – a boolean condition. If the bool tag in the XIC instruction is equal to ‘true’, then the action after (from right) the XIC will be executed.
- XIO – Examine off – a boolean condition but the opposite of XIC. If the bool tag in the XIO instruction is equal to ‘false’, then the action after (from right) the XIO will be executed.
- OTE – Output energize – an output action, if the conditions before the OTE are ‘true’ then the bool tag in the OTE instruction will be equal to ‘true’, if the conditions before the OTE are ‘false’ then the bool tag in the OTE instruction will be equal to ‘false’.
- OTL – Output latch – an output action, if the conditions before the OTL are ‘true’ then the bool tag in the OTL instruction will be equal to ‘true’, it will keep the value of ‘true’ until an OTU instruction with the same tag will be executed.
- OTU – Output unlatch – an output action. If the conditions before the OTU are ‘true’ then the bool tag in the OTL instruction will be equal to ‘false’. It will keep the value of ‘false’ until an OTL instruction with the same tag will be executed.
Look at the picture above:
Rung 0 – two bool tags (Bool1, Bool2) are a parallel condition (XIC, XIO) for the bool tag Output1. Then, if Bool1 is equal to ‘true’ or Bool2 is equal to ‘false’, the Output1 tag will be equal to ‘true’. Otherwise, Output1 will be equal to ‘false’.
Rung 1 – one bool tag (Bool3) is an XIC condition for the Output2 tag. If Bool3 is equal to ‘true’ then Output2 will be equal to ‘true’. Output2 will be equal to ‘true’ until an OTU instruction will be executed.
Rung 2 – one bool tag (Bool3) is an XIO condition for the Output2 tag. If Bool3 is equal to ‘false’ then Output2 will be equal to ‘false’. Output2 will be equal to ‘false’ until an OTL instruction will be executed.
Note: here, the tag Bool3 will always be equal to the tag Output2.
In the IO configuration section, we will configure the actual hardware on the PLC. It may include communication modules, Digital IOs, Analog IOs, and many more modules for different capabilities.
You can see an example of ControlLogix 7 slots chassis with L85E CPU, EN2T Communication modules, and 4 IO modules (DI, DO, AI, AO).
The IO configuration must be configured accurately; otherwise, unexpected results may occur.
Congrats! You finished the third part of our PLC training. The next part of this training is PLC Training For Beginners – Part 4 of 4: PLC practical training. In this part, we will take everything we learned in this training and implement a simple program, including downloading the code to a controller.