PLCLogix User Guide: Learning Ladder Logic Programming with Tags and Aliases, Lecture notes of Logic

This user guide introduces PLCLogix, a tool for learning ladder logic programming using tags and aliases. It provides an interactive approach to understanding tag-based PLCs in a simulated manufacturing environment. Users can create and run their own ladder logic programs using tag-based memory, featuring a graphical controller organizer and point-and-click I/O configuration. The application organization is based on tasks, programs, and routines, with sophisticated data handling and support for arrays and structures.

Typology: Lecture notes

2021/2022

Uploaded on 09/07/2022

zaafir_ij
zaafir_ij 🇦🇪

4.4

(61)

884 documents

1 / 27

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
PLCLogix
User Guide
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b

Partial preview of the text

Download PLCLogix User Guide: Learning Ladder Logic Programming with Tags and Aliases and more Lecture notes Logic in PDF only on Docsity!

PLC Logix

User Guide

Table of Contents

  • 1-1 Introduction Chapter 1: Welcome to PLCLogix
  • 1-2 Graphic User Interface (GUI)
  • 1-3 Controller Organizer
  • 1-4 I/O Chassis
  • 2-1 Introduction to Tags Chapter 2: Tags and Aliases
  • 2-2 Alias Tags
  • 2-3 Creating Tags
  • 3-1 Introduction Chapter 3: Instruction Set
  • 3-2 Bit Instructions
  • 3-3 Timer and Counter Instructions
  • 3-4 Program Control Instructions
  • 3-5 Compare Instructions
  • 3-6 Math Instructions
  • 3-7 Advanced Math Instructions
  • 3-8 Data Handling/Transfer Instructions
  • 3-9 Array Shift Instructions
  • 3-10 Sequencer Instructions
  • 3-11 Communication Instructions
  • 4-1 Tags and Aliases tutorial Chapter 4: Ladder Logic Tutorials
  • 4-2 Ladder logic tutorial
  • 4-3 Branching tutorial

One of the main advantages of using PLCLogix is that it enables you to gain “hands on”

experience in the operation of the Logix 5000 PLC. By using PLCLogix, you are able to gain much-needed programming practice by creating and running your own ladder logic programs

using tag-based memory. The integration of the ladder programs with the 3D “worlds” provides a unique opportunity for programming in real-time and observing the operation of complex

control devices and systems.

PLCLogix functionality includes a graphical controller organizer and a point-and-click method of configuring various I/O. The application organization is based on using tasks, programs, and

routine structures. In addition, it features sophisticated data handling and incorporates both arrays and structures to provide maximum flexibility and emulation of real world control

applications. PLCLogix also includes a free-form ladder editor that allows you to modify multiple rungs of logic at the same time. The point-and-click graphical interface provides a simple,

intuitive method of entering and editing ladder logic programs.

The PLCLogix Graphic User Interface (GUI) displays the interactive animation as well as the

ladder logic, controller organizer, I/O chassis, and a range of control panels. The ladder logic display is the same format as Logix 5000. The controller organizer also follows the same

convention as Logix 5000 to provide a seamless transition from PLCLogix simulation to the real- world Logix 5000 control.

1-2 Graphic User Interface (GUI).

The Graphic User Interface for PLCLogix is designed to emulate RSLogix 5000, with the main

difference being the addition of a virtual I/O chassis and a range of 3D simulation worlds. The purpose of the GUI is to provide a range of information displayed on a single screen. This

information ranges from bit display to program code to status indicators. The Bit Status is represent by green horizontal bars on either side of the I/O device. The bar on the left is

referred to as the rung-condition-in and the bar on the right is the rung-condition-out. When the

green bars are illuminated, it indicates a high bit (1) is present in the I/O memory location. If the I/O point is not green, it means that a low bit (0) is present at that address.

Figure 1-2 shows the main components for the PLCLogix GUI. The Menu Bar provides access

to a variety of Windows-based functions including Help, Search, and I/O Worlds. The Windows Commands Toolbar contains common Windows-based instructions such as New, Open, Save,

Print, Cut, Copy, etc. The Ladder Instruction Toolbar provides category tabs which contain a wide range of instructions in various subsets, or categories. Instructions are inserted into ladder

programs by clicking on instructions in the various categories.

FIGURE 1-2 PLCLogix GUI.

The Online Bar places the PLC online (Run) or offline (Program). When the PLC is Offline,

program edits can be made. When switched to Online, the program is downloaded, and the PLC is in the Run mode. The Standard Toolbar consists of typical edit functions, such as cut,

copy, paste that are used repeatedly during the development and debugging of ladder logic

programs. The Ladder Element Toolbar features both common editing functions as well as more specialized edit capabilities. The Controller Organizer is a graphical representation of the

contents of your controller project. The Status Bar provides prompts during software operation as well as on-going status information updates. The View Panel is the window which contains

the ladder logic diagram and various editors, such as Tag Editors.

FIGURE 1-4 Task Execution Types

A Continuous Task is self-triggered and automatically repeats. It runs constantly in the background, and when it completes a full scan it immediately restarts. For most applications the continuous task will hold the PLC user-created program. Only one task can be executed at a time so continuous tasks will be executed whenever other tasks are not triggered. When a new project is initiated, a continuous task is created by default. A program does not require a continuous task, and there can be only one continuous task, regardless of number of tasks.

Periodic tasks operate at specific pre-determined intervals and contain program commands that need to be executed on a timed basis. A periodic task performs a function at a specific rate. The time period can be adjusted from 1 ms to 2000 s. Periodic tasks can be assigned a priority level with high priority tasks interrupting lower-priority tasks. Event-driven tasks will execute when a specified event takes place. Tasks in the Logix5000 controller are executed by priority. Continuous tasks have the lowest priority, which is fixed. Periodic and Event-driven tasks have adjustable priority levels. Event-driven tasks are generally used for Axis- and motion-control applications.

Tasks are divided into one or more programs, and each task can operate up to 100 of these programs. Once a task is executed, every program assigned to the task will be triggered in the order they are stored in the controller’s memory. A program is basically a set of related tags and routines. Each program consists of tags, a main executable routine and other routines, such as a fault routine. A routine is a set of logic instructions written in a PLC language, such as ladder logic.

1-4 I/O Chassis

The PLCLogix I/O chassis shown in Figure 1-5 contains discrete input and output modules as

well as BCD and Analog input and output devices. There are two 16-point discrete inputs and two 16-point discrete outputs. There are five different input switch types: NO switch, NC

pusbutton, NO pushbutton, NO limit switch, and NC limit switch. The discrete output simulators use green LED lights to indicate when an output is ON or OFF. The BCD input and output

modules are designed to simulate a range of decimal input and output values. The 4 BCD

thumbwheels connected to the BCD input module allows for decimal values of 0000 to 9999 to be entered. The output value is displayed using four 7-segment displays to indicate a decimal

range from 0000 to 9999.

FIGURE 1-5 PLCLogix I/O Chassis

Each of the simulated discrete input devices are selectable among five different types of devices

by right-clicking on the device with your mouse. The five settings available are normally closed (NC) pushbutton, normally open (NO) pushbutton, NO switch, NO limit switch, and NC limit

switch.

Chapter 2: Tags and Aliases

2-1 Introduction to Tags

Logix 5000 and PLCLogix controllers define memory by using variable names, also known as tags and aliases. Tag-based memory structures are the newest type of memory addressing used by PLCs. A tag is simply another name for a memory location with an assigned data type. For example, Start_PB1 could be a tag name assigned to a start button, instead of something less user-friendly, such as I:1/05.

When a tag is created, it must be given a data type. A data type is a definition of the size and layout of memory allocated for the created tag. Data types define how many bits, bytes, or words of data that will be used by a tag. There are two main data types: basic and structured. Figure 2-1 shows the data types that are considered to be basic, or atomic. These include Boolean (BOOL), Short Integer (SINT), Integer (INT), Double Integer (DINT) and real numbers (REAL). RSLogix 5000 data structures include timers, counters, arrays, messages, and PID. PLCLogix has 32-bit memory locations, which means that a tag will always reserve 32 bits of memory, regardless of whether the data is Boolean or integer. The memory bits shown in Figure 2-1 indicate 32-bits for each memory type, even though some use less (e.g. Bool only uses one bit) only use one bit.

Figure 2-1 Data Types

A tag can also be defined as a compound set of the data types such as a structure or an array. Unlike other PLCs, Logix 5000 and PLCLogix processors do not use indexed or direct addressing. Instead, they use arrays. An array is a type of tag that contains a block of data, and is similar to a data table. Arrays are numerically sequenced tags of the same data type that occupy a contiguous memory location.

An array is basically a table of tags, and is capable of holding the values of multiple tags. It is, essentially, a type of tag that consists of a block of multiple pieces of data. Each individual piece of data in the array is called an element. Each element in an array must be of the same type. An array tag holds each element in its assigned order in a contiguous block of the controller’s memory. Arrays are useful for indexing applications, when the elements are required to be stepped through (indexed). Arrays can be created in 1, 2, or 3 dimensions. Figure 2-2 shows an example of a 1-dimensional array which holds 5 different values of pressure ranging from 100 to 140.

FIGURE 2-2 One-dimensional array.

PLCLogix also has a User Defined Data Table (UDT), or structure, which allows users to setup their own specific data structure for customized applications. Structures are capable of holding multiple types of data and include a description of each member. Structures enable you to assign both a name and description for each member within a user defined data type. The member name is used to access the associated data, and the member description helps to define the purpose of the member. By adding a description to a tag, it is possible to store another 120 characters of information.

Earlier Allen Bradley PLCs programmed with RSLogix 5 and RSLogix 500 software had memory locations where I/O and other internal values were stored, and these different data files could only hold one data type. These PLCs require very specific addressing to indicate I/O addresses, timers, counters, bits, variables, etc. Logix 5000 programming software has eliminated the use of data files and in its place is the tag database. The tag database organizes memory locations in one area, and each tag is assigned its own data type and radix.

2-3 Creating Tags

There are several methods available for creating tags – they can be created one at a time as you write the program, or they can be created in the tag editor shown in Figure -3. The tag editor contains a spreadsheet-like view of the tags where the tags can be created and edited. When an instruction is first used a “?” will indicated the need for a tag. There are three simple ways to create a tag using the “?” symbol. One method is to either right click or double click on the “?” and select an existing tag from the drop down box. Another method is to double click on the “?” and type in a tag name. If the name does not yet exist, right click on the tag name and select “Create New Tag Name”. A tag can also be created by clicking on the tag name and drag and drop an existing tag to a new instruction. Using any of these methods, PLCLogix will automatically assign the correct data type according to the instruction selected.

FIGURE 2-3 Tag editor.

The tag data type indicates the data format used by the tag, such as an integer, Bool, REAL, Timer, Counter, control, etc. Figure 2-4 shows the tag types used in PLCLogix and RSLogix Controllers. A Base tag is generally selected to hold data from logic-based operations using bits, integer numbers and real (floating point) numbers. Produced tags and Consumed tags are mainly used in the transfer of data between two or more controllers.

FIGURE 2-4 Tag Types.

Chapter 3: Instruction Set

3-1 Introduction

PLCLogix features an extensive instruction set of over 70 commands. These instructions encompass all of the main ladder logic programming commands associated with Logix 5000.

The PLCLogix Instruction Set consists of the following groups of commands: Bit Instructions, Timer and Counter Instructions, Program Control, Compare, Communications, Math, and Data

Handling/Transfer instructions.

3-2 Bit Instructions Instruction Mnemonic

Instruction Name

Symbol Description

XIC Examine If Closed

Examines a bit for an On (set, high) condition.

XIO Examine If Open

Examines a bit for an Off (cleared, low) condition.

OTE Output Energize

When rung conditions are true, the OTE will either set or clear the data bit.

OTL Output Latch When enabled, the instruction signals to the controller to turn on the addressed bit. The bit remains on, regardless of the rung condition.

OTU Output Unlatch

When enabled, it clears (unlatches) the data bit. The bit remains Off, regardless of rung condition.

ONS One Shot Enable/disable outputs for one scan. Storage bit status determines whether this instruction enables or disables the rest of the rung.

OSR One Shot Rising

A retentive input instruction that triggers an event to occur once. It either sets or clears the output bit, depending on the storage bit status.

OSF One Shot Falling

This instruction either sets or clears the output bit, depending on the storage bit’s status.

3-4 Program Control Instructions

Instruction Mnemonic

Instruction Name

Symbol Description

JSR Jump to Subroutine

This instruction jumps execution to a specific routine and initiates the execution of this routine, called a subroutine.

SBR Subroutine Stores recurring sections of program logic.

RET Return Used to return to the instruction following the a JSR operation.

JMP Jump to Label

Skips sections of ladder logic.

LBL Label Target of the JMP instruction with the same label name.

MCR Master Cont. Res.

Used in pairs to create a program zone that can disable all rungs between the MCR instructions.

NOP No Operation

This instruction functions as a placeholder.

END End End rung in ladder logic circuit.

AFI Always False Instruction

Sets the rung condition to False.

3-5 Compare Instructions

Instruction Mnemonic

Instruction Name

Symbol Description

EQU Equal This instruction is used to test whether two values are equal. If Source A is equal to Source B, the instruction is logically true.

GEQ Greater Than or Equal To

Determines whether source A is greater than or equal to Source B. If the value at Source A is greater than or equal to the value at Source B, then the instruction is true.

GRT Greater Than This instruction is used to test whether one value (Source A) is greater than another value (Source B).

LEQ Less Than or Equal To

Determines whether one value (Source A) is less than or equal to another (Source B).

LES Less Than This instruction determines whether Source A is less than Source B.

LIM Limit This instruction is used to test for values within the range of the Low Limit to the High Limit.

MEQ Mask Equal To Passes the Source and Compare values through a Mask and compares the results.

NEQ Not Equal To This instruction tests whether Source A is not equal to Source B.

3-7 Advanced Math Instructions Instruction Mnemonic

Instruction Name

Symbol Description

SIN Sine Takes the sine of the Source value (in radians} and places the result in the Destination.

COS Cosine Takes the cosine of the Source value (in radians) and places the result in the Destination.

TAN Tangent Takes the tangent of the Source value (in radians) and stores the result in the Destination.

ASN Arc Sine Takes the arc sine of the Source value and places the result in the Destination (in radians).

ACS Arc Cosine Takes the arc cosine of the Source value and stores the result in the Destination (in radians).

ATN Arc Tangent Takes the arc tangent of the Source value and stores the result in the Destination (in radians).

LN Natural Log Takes the natural log of the Source value and stores the result in the Destination.

LOG Log to the Base 10

Takes the log base 10 of the Source value and stores the result in the Destination.

XPY X to the power of Y

Takes Source A (X) to the power of Source B (Y) and stores the result in the Destination.

3-8 Data Handling/Transfer Instructions

Instruction Mnemonic

Instruction Name

Symbol Description

TOD Convert to BCD

This instruction converts a decimal value to a BCD value and stores the result in the Destination.

FRD Convert to Integer

Converts a BCD value (Source) to a decimal value and stores the result in the Destination.

MOV Move Copies the Source (which remains unchanged) to the Destination.

MVM Masked Move Copies the Source to a Destination and allows segments of the data to be masked.

DEG Degrees Converts the Source (in radians) to degrees and places the result in the Destination.

RAD Radians Converts the Source (in degrees) to radians and stores the result in the Destination.

XOR Bitwise Exclusive OR

Performs a bitwise XOR operation using the bits in Source A and Source B and stores the result in the Destination.

CLR Clear Clears all the bits of the Destination

SWPB Swap Byte Rearranges the bytes stored in a tag.