PLC Manual
PLC Manual
Training Manual
RSLogix 500 Version 1.0
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 1
Table of Contents
Lab 1 RSLinx and Communication with PLC (Est. Time 20 min) ........................................... 1-4
Lab 2 RSLogix Configuration, Data Files, I/O Addressing (Est. Time 15min) ..................... 5-17
Lab 4 Concept of Switching Function w.r.t to Field Contacts Start/Stop Logic and
Holding (Est. Time 40
min)………..…………………….…………………………………………….....23-24
Lab 5 Realization of Logic Gates by Bit Instructions (Est. Time 30 min) ......................... 25-26
Lab 7 Timers and its Type, Applications (Est. Time 60 min) ........................................... 33-39
Lab 9 Counters and its Application (Est. Time 30 min) .................................................. 41-44
Lab 10 PLC Timer and Counter Based Problems (Est. Time 60 min) ................................ 45-45
Lab 11 Compare Instruction and its Application (Est. Time 20 min) ................................ 46-49
Lab 12 Mathematics Instruction and its Application (Est. Time 20min) .......................... 50-66
Lab 16 Analog Parameter Controlling, Scaling (Est. Time 30 min) ................................... 80-81
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 2
LAB 1: RSLinx Configuration
1. Open RSLinx Classic by clicking Start > Programs > Rockwell Software >
RSLinx
RSLinx Classic starts in a minimized mode – you will see an RSLinx icon in
your Windows System Tray.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 3
3. In the Configure Drivers window, select the driver you need to use based on
your physical connection to the processor. For example, if you are connecting
with a MicroLogix 1100, select the Ethernet_IP devices driver.
4. Click Add New to add the driver to the Configured Drivers list.
5. RSLinx Classic asks you to name the driver. RSLinx Classic uses this
name to refer to the driver. You can use the default name, or enter a
name (names can be up to 15 characters long). Click OK.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 4
6. The window that appears next depends on the driver you selected.
This window is where you configure the driver. Configure the driver
to match your physical connection to the processor. If you need help
with the parameters for the driver, click the Help button on the
window.
7. When you have finished configuring the driver, the driver appears in
the Configured Drivers list of the Configure Drivers window. Click
Close.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 5
8. You need to make sure the communications driver you configured
is working properly. To do this, use the RSWho function in RSLinx
Classic. This function shows what processors and other communications
devices are available through the driver. To display an RSWho window,
click Communications > RSWho
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 6
LAB 2: RSLogix 500 configuration
RSLogix 500 software is a 32-bit Windows ladder logic programming package for
the SLC 500 and MicroLogix® processors.
To navigate through the various windows and toolbars in RSLogix 500 more
easily, you should understand what they contain and what functionality each
provides.
When you open a project in RSLogix 500 you can expect to see:.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 7
Menu bar - Select functionality from the menus that appear as you click each
selection on this bar.
Icon bar - The icon bar contains many functions that you will use repeatedly as you
develop and test your logic program. If you want to know what any of the icons
represent, RSLogix 500 can tell you. Move your cursor over the icon, and floating
ToolTip window appears to tell you what the icon is used for.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 8
Online bar - See at a glance the processor mode and whether you have online edits
or forces present. You can also view the communications driver and node number.
Project tree - This view contains all the folders and files contained in your project.
You can usually click an icon in this tree and then click the right mouse button for
a menu that applies only to the icon selected. For example, if you click the right
mouse button on a program file, you see options to rename the program file, open
the program file, hide the program file, or reveal properties of the program file.
Status bar - Look here for ongoing status information and prompts as you use the
software.
Results pane - Displays the results of a Find All search or a verification procedure.
You can hide this pane or place it anywhere on your screen.
Ladder view - This is where you edit your ladder logic. You can view several
program files at the same time.
To create a new project, click File > New. RSLogix 500 prompts you for the type
of processor you will communicate with and creates a project tree for the project.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 9
Now press ok. The following programming window will appear as
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 10
2.3- Open an existing project
To open an existing project, click File > Open. The software displays a window
that allows you to choose a project to open.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 11
2.3- Using the project tree
When you have opened or created a project, RSLogix 500 display’s the project’s
project tree. The project tree allows you to navigate through the various program
and data table files in your project.
The following illustration shows the parts of the project tree.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 12
2.4- Define chassis and modules
After you have opened a project, you need to define your chassis,
identify the I/O cards. You perform these procedures in the I/O Configuration
window.
Access this window by double-clicking the I/O Configuration icon in the project
tree.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 13
From the I/O Configuration window, click the I/O’s button to examine the loading
on a rack based on the module configuration that you have selected.
To do this, click the Read I/O Config button on the I/O Configuration dialog.
If you have a Specialty I/O Module in your configuration, you have to enter
additional parameters so that the module can function properly in your program.
You enter this information in the Advanced I/O Configuration window.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 14
Go to this dialog by clicking the Adv Config button on the I/O Configuration
dialog.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 15
Usually, program file #2, the main program file, will open when you open a
project. If you have not entered any ladder logic in a program file, only the end
rung will show.
Click the end rung and then select the New Rung icon from the user toolbar.
To place an instruction on a rung, click the instruction’s button.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 16
2.8- Validate your project
Before you can compile and download your project to a processor, you must
validate the project. You can validate a single program file, click the Verify File
icon or click Edit > Verify File.
To verify your whole project, click the Verify Project icon or click Edit > Verify
Project. After you initiate verification, the Verify Results output window displays
and gives you information about mistakes or omissions that may have occurred as
you wrote your program logic.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 17
2.9- Data Files in SLC and MICROLOGIX PLC
The Allen-Bradley PLC has different type of Memory each performs a particular
function.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 18
One type of files are called Data Files. The plc programmer uses these files
Extensively.
There are 256 Data Files and Each files has registers that stores 16-bit words. The
16-bit in each registers are labeled 0-15. These 256 registers are referred as
element and are labeled 0 through 256.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 19
The data file types are:
Output (file 0) – This file stores the state of the output terminals for the controller.
Input (file 1) – This file stores the status of the input terminals for the controller.
Status (file 2) – This file stores controller operation information. This file is useful
for troubleshooting controller and program operation.
Bit (file 3) – This file is used for internal relay logic storage.
Timer (file 4) – This file stores the timer accumulator and preset values and status
bits.
Counter (file 5) – This file stores the counter accumulator and preset values and
the status bits.
Control (file 6) – This file stores the length, pointer position, and status bits for
specific instructions such as shift registers and sequencers.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 20
Integer (file 7) – This file is used to store numeric values or bit information .
You can also drag and drop physical address from its Data File directly.
I:0.0/3
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 21
LAB 3: Introduction of XIC/XIO, Uploading/Downloading
Step_2: Now go to instruction tab and drag/drop XIC/OTE instruction to the blank
created Rung. . The green drop zone indicates correct placement.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 22
Step_3: Give a H/W Input Address to this XIC instruction and H/W output
Address XIO instruction.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 23
Now you have downloaded your PLC.
A Download Progress dialog will flash through several progress bars as various
parts of the program are loaded. Eventually, you should see:
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 24
The RSLogix status box will change to show you are on-line live with the
processor
Next, we will change the SLC 500 processor key switch from PROGRAM Mode•
to REMOTE RUN Mode.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 25
Note: “How to upload program?” will be explained later on.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 26
LAB 4: Concept of Switching Function w.r.t to
Field Contacts Start/Stop Logic and Holding
In this section you will learn how to develop a ladder logic DOL starter or Start
–Stop ladder logic.
Step_1: Here we are considering you have already done your RsLinx
communication and you have also created a new project file as
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 27
Step_2: Give a H/W Input Address to this XIC instruction and H/W output
Address XIO instruction as
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 28
LAB 5: Realization of Logic Gates
by Bit Instructions
In this section we will examine the basic instructions for PLC programming by
using ladder diagram.
To convert a control objective into an equivalent ladder diagram, the truth table of
the control objective is first determined, and then the equivalent ladder logic
program is drawn.
0 0 0 0 1 1 1 0
1 0 0 1 0 1 0 1
0 1 0 1 1 1 0 1
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 29
1 1 1 1 0 0 0 0
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 30
LAB 6: PLC-SCADA Communication
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 31
In this section you will learn how to communicate your developed scada animation
to your PLC controller.
Step_1: First communicate AB PLC using RSLINX as
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 32
Step_2: In this section we will create a topic in RSLINX as
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 33
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 34
Step_4: In this section we will create few animations so that we can communicate
those one to PLC.
1. Creating discrete button for start- stop application
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 35
In order to add a data server to the tag do the following configuration
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 36
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 37
2. Creating Indicator in SCADA
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 38
LAB 7: TIMERS AND ITS APPLICATION
Timers
In this section we will cover timers used in ladder logic programming.
A timer is a device that introduces a time delay in a circuit or a system during its
ON or OFF condition.
Functions in a Timer
1. Enable bit (EN) – It follows the input enable contact status.
2. Timer Timing bit (TT) – It is set when the timer is operating.
3. Done bit (DN) – When the timer is timed out, this bit is set.
4. Time base - The unit of measurement used to determine the speed at which
time increments are counted. The time base is always 1 msec in RSLogix
5000 timers. For example, for a 2 second timer, enter 2000 for the .PRE
value.
5. Accumulator value (ACC) - This is the time that has elapsed, since the timer
was last reset. When enabled, a timer updates this continually.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 39
6. Preset value (PRE) – This specifies the value that he timer must reach before
the controller sets the done bit.
Classification of a Timer
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 40
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 41
2. OFF-Delay Timer (TOF)
Off- delay timer instructions is used to program a time delay to begin after
rung input goes false.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 42
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 43
3. Retentive-ON Timer (RTO)
Retentive timer is a timer which retains the accumulated value in case of
power loss or rung state going from true to false (rung state transition).
The RTO instruction accumulates time until it is disabled. When the RTO
instruction is disabled, it retains its .ACC value. You must clear the .ACC value,
typically with a RES instruction referencing the same TIMER structure.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 44
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 45
LAB 8: Exercises based on timers
Solved the below exercises: Duration: 30 minutes
Exercise 1: Draw a ladder diagram for a two-motor system having the following
conditions:
1) Starting push button starts motor-1
2) After 10 seconds, motor-1 is off and motor-2 is on
3) Stopping the switch stops motor-2
Exercise 2: Draw a ladder diagram for a two-motor system having the following
conditions:
The start switch starts motors 1 and 2. The stop switch stops motor 1 first, after 15
seconds motor 2 stops.
Exercise 3: Draw a ladder diagram for a three-motor system having the following
conditions:
Motor 1 (M1) starts as soon as the start switch is on, after 10 seconds, M1 goes off
and M2 starts. After 5 seconds, M2 goes off and M3 comes on. After 10 seconds,
M3 goes off and M2 comes on; and after 5 seconds, M2 goes off and M1 comes
on, and the cycle is repeated.
Exercise 4: Blinking indicator lights are used quite extensively in industry. Design
a circuit in which two lights are flashed alternately every 5 seconds.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 46
LAB 9: COUNTER AND ITS APPLICATION
Counters
A device that counts the occurrence of an event. This may include pulses
developed from operations such as: switch closures, interruptions of light beams,
or other discrete events. In controllers, a software counter eliminates the need for
hardware counters.
Counter Parameters
Types of Counters
1. Count Up (CTU)
It increases the current value by an increment of 1 every time an input
transitions from FALSE to TRUE. Count up counters is started from zero
and continue counting until the accumulated value matches the preset value.
When enabled and the .CU bit is cleared, the CTU instruction increments the
counter by one. When enabled and the .CU bit is set, or when disabled, the CTU
instruction retains its .ACC value.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 47
The accumulated value continues incrementing, even after the .DN bit is set. To
clear the accumulated value, use a RES instruction that references the counter
structure or write 0 to the accumulated value.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 48
When enabled and the .CD bit is cleared, the CTD instruction decrements the
counter by one. When enabled and the .CU bit is set, or when disabled, the CTU
instruction retains its .ACC value.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 49
The accumulated value continues decrementing, even after the .DN bit is set. To
clear the accumulated value, use a RES instruction that references the counter
structure or write 0 to the accumulated value.
Now we have some exercises which can be solved by using above concept.
Exercise 1: Draw a ladder diagram for a box packaging system having the
following conditions.
Five boxes are stacked at a time and then bound with a wrapper.
Exercise 2: Design a ladder diagram that will control a stepper motor so that it
moves 10 steps forward, waits for 20 seconds, and then cause the motor to move
10 steps in the reverse direction.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 50
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 51
LAB 10: PLC Timer and Counter Based Problems
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 52
LAB 11: Compare Instruction and its Application
Comparison instructions are basically input instructions and are used to test the
values of two parameters to condition the logical continuity of a rung.
Comparison instructions are given in Ladder Elements Toolbar. You can drag and
drop the desired block to the rung.
The EQU instruction is used to test whether two values are equal. If source
A and source B are Equal, the instruction is logically true. If these values are
not equal, the instruction is logically false.
The NEQ instruction is used to test whether two values are not equal. If source A
and source B are not Equal, the instruction is logically true. If these values are
equal, the instruction is logically false.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 53
The LES instruction is used to test whether the value of source A is less than the
value of source B. If this condition is fulfilled, the instruction is logically true, if
the value at source A is greater than or equal to the value of source B, the
instruction is logically false.
The LEQ instruction is used to test whether one value (source A) is less than or
equal to another (source B). If the value at value at source A is less than or equal to
the value at source B, the instruction is logically true if the former is greater than
the latter, the instruction is logically false.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 54
The GRT instruction is used to test whether one value (source A) is greater than
another (source B). If the value at value at source A is greater than the value at
source B the instruction is logically true but if the former is equal to or less than
the latter, the instruction is logically false.
The GRT instruction is used to test whether one value (source A) is greater than or
equal to another value at source B. If the value at value at source A is greater than
or equal to the value at source B the instruction is logically true but if the former
is less than the latter, the instruction is logically false.
The MEQ instruction is used to compare data of the source address to data of the
reference address, by using the instruction portions of the data can be masked by a
separate word.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 55
Source is the address of the value you want to compare.
Mask is the address of the mask through which the instruction moves data. The
mask can be a hexadecimal value.
Compare is an integer value or the address of the reference.
The LIM instruction is used to test whether certain values are within or outside a
specified limit.
Exercise 1: Motor 1(M1) starts as soon as the PLC starts. After 10 seconds, motor
1 goes off and motor 2 starts. After 5 seconds, M2 goes off and M3 starts. After
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 56
another 10 seconds, M2 restarts and after 5seconds it stops, and M1 starts and the
cycle is repeated. Prepare the logic diagram for the process.
Mathematical Instructions
ADD Instruction (ADD)
The ADD instruction is used to add a numerical value in source A to another
numerical value in source B. The result is then placed into a destination register.
With This
The Processor:
Bit:
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 57
the unsigned, truncated overflow remains in the destination.
The SUB instruction is used to subtract a numerical value from source B to another
numerical value in source A. The result is then placed into a destination register.
With This
The Processor:
Bit:
sets if a borrow is generated; otherwise resets (integer). For floating point it is
Carry (C)
cleared.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 58
sets if an underflow is detected at destination; otherwise resets. On underflow, the
minor error flag is also set. For floating point the overflow value is placed in the
Overflow destination. For an integer, the value -32,768 or 32,767 is placed in the destination.
(V) Exception: If you are using an SLC 5/02, SLC 5/03, or SLC 5/04 processor or a
MicroLogix 1000 controller and have S:2/14 (math overflow selection bit) set, then
the unsigned, truncated overflow remains in the destination.
Zero (Z) sets if the result is zero; otherwise resets.
Sign (S) sets if the result is negative; otherwise resets.
The MUL instruction is used to multiply a numerical value from source A with
another numerical value in source B. The result is then placed into a destination
register.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 59
Bit:
Carry (C) always resets
sets if an overflow is detected at destination; otherwise resets. On overflow, the
minor error flag is also set. The value -32,768 or 32,767 is placed in the destination.
Overflow Exception: If you are using an SLC 5/02, SLC 5/03, or SLC 5/04 processor or a
(V) MicroLogix 1000 controller and have S:2/14 (math overflow selection bit) set, then
the unsigned, truncated overflow remains in the destination. For floating point
destinations the overflow result remains in the destination.
Zero (Z) sets if the result is zero; otherwise resets.
Sign (S) sets if the result is negative; otherwise resets.
The DIV instruction is used to divide a numerical value from source A by another
numerical value in source B. The rounded quotient is then placed into a destination
register. If the remainder is 0.5 or greater, a round up occurs in the destination
register. The unrounded quotient is stored in the most significant word of the math
register and the remainder is placed in the least significant word of the math
register.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 60
With This
The Processor:
Bit:
Carry (C) always resets.
sets if division by zero or overflow is detected; otherwise resets. On overflow, the
minor error flag is also set. The value 32,767 is placed in the destination. Exception:
Overflow If you are using an SLC 5/02, SLC 5/03, or SLC 5/04 processor or a MicroLogix
(V) 1000 controller and have S:2/14 (math overflow selection bit) set, then the unsigned,
truncated overflow remains in the destination. For floating point destinations the
overflow result remains in the destination.
Zero (Z) sets if the result is zero; otherwise resets; undefined if overflow is set.
Sign (S) sets if the result is negative; otherwise resets; undefined if overflow is set.
When this instruction is evaluated as true, the square root of the absolute value of
the source is calculated and the rounded result is placed in the destination.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 61
With This Bit: The Processor:
Carry (C) is reserved (integer). For floating point it is always cleared.
Overflow (V) always resets.
Zero (Z) sets when destination value is zero.
Sign (S) always resets.
Programming Problem
Develop a ladder rung that when the rung conditions are true, a stored binary value
is converted to BCD and stored in the destination.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 62
In this example, when the binary bit B3:0/1 is set the stored binary value of 10 in
the Source word N7:0 is converted to the equivalent BCD value and is stored in the
destination N7:1.
The N7 data file shows that the binary equivalent is shown in the N7:0 words and
the BCD equivalent is shown in the N7:1 word. The N7:0 word shows 10 as a
binary number, with the 3 bit, being equivalent to 8 added to the 1 bit which is
equivalent to 2. In the N7:1 word, Bits 4-7 represents the first BCD digit. The 4 bit
set to 1 show that the first digit in BCD is a 1. Bits 0-3 represent the second BCD
digit. With all bits being set to 0 means that the second BCD value is 0. The
resulting value of this is 10 in BCD.
The FRD instruction is used to convert 16-bit integers into BCD values.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 63
Programming Problem
Design a ladder program that will convert a value entered from two BCD switches
to a binary number. For example, if a 26 is selected on the BCD switches it will be
converted to the binary equivalent.
This example shows that when a 26 is entered using two BCD switches and the
binary bit B3:3/1 is set, the BCD equivalent is stored in the word address N7:0.
The BCD value is then converted to the binary equivalent and stored in the word
address N7:1.
The N7 data file shows that the BCD equivalent is shown in the N7:0 words and
the binary equivalent are shown in the N7:1 word. Bits 4-7 represent the first BCD
digit. The 5 bit set to 1 show that the first digit in BCD is a 2. Bits 0-3 represent the
second BCD digit. The 1 and 2 bits set to 1 show that the 1 bit being 2 added to the
2 bit which is 4, results in the second digit in BCD which is 6. The final value in
BCD therefore is 26. The N7:1 word shows 26 as a binary number, with the 4 bit,
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 64
being equivalent to 16 added to the 3 bit which is equivalent to 8 added to the 1 bit
which is equivalent to 2.
CPT instruction
The CPT instruction is used to perform copy, arithmetic, logical, and conversion
operations. The user defines the operation in the Expression and the result is
written in the destination. Use indexed or indirect addressing.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 65
The NEG instruction is used to change the sign of the source and then
place it in the destination.
Programming Example:
When a water valve is opened a negative angle is read. Design a ladder program
that will convert this negative value to a positive value so that it can be converted
to radians.
LN instruction
The LN instruction is used to take the natural log of a number in the source
location and store the result in the destination location.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 66
Programming Example:
Develop a ladder rung that will use a value located in N7:0 and take the natural log
of it, storing the result in N7:10.
LOG instruction
The LOG instruction is used to take the log to the base 10 of a number and then
store the result in the destination output.
Programming Problem
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 67
Develop a ladder rung that will use a value located in B3:0/8 and takes the log base
10 of it, storing the result in B3:2/3.
Use this instruction to convert radians (source) to degrees and store the result in the
destination. The following formula applies:
Source * 180/Pi
where Pi = 3.141592
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 68
Destination is the address of the word where the data is to be stored.
XPY instruction
The XPY instruction is used to raise a value to a specified power and then store the
result in the destination location.
Programming Problem
Develop a ladder rung that will take the value located in N7:0 and raise it to the
value located in N7:2, while storing the result in N7:10.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 69
Trigonometrical Mathematics Instructions
The SIN instruction is used to take the sine of a number and then store the result in
the destination output.
Programming Problem
Develop a ladder rung that will use a value located in N7:0 and take the sine of it,
storing the result in N7:10.
The COS instruction is used to take the cosine of a number and then store the result
in the destination output.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 70
Programming Problem
Develop a ladder rung that will use a value located in N7:0 and take the cosine of
it, storing the result in N7:10.
The TAN instruction is used to take the Tangent of a number and then store the
result in the destination output.
Programming Problem
Develop a ladder rung that will use a value located in N7:0 and take the Tangent of
it, storing the result in N7:10.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 71
The ASN command takes the arc sine of a number (source in radians) and stores
the result in the destination.
Programming Problem
Develop a ladder rung that will take the Arc sine of a number and display the result
in the destination. Floating point values must lie within {-1.0, 1.0}
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 72
.
The ACS command takes the arc cosine of a number (source in radians) and stores
the result in the destination.
Programming Problem
Develop a ladder rung that will take the Arc cosine of a number and display the
result in the destination. Floating point values must lie within {-1.0, 1.0}.
The ATN instruction is used to take the arc tangent of a number in the Source
location and display the result in the destination location.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 73
Programming Problem
Develop a ladder rung that will use a value located in N7:0 and take the arctangent
of it, storing the result in N7:10.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 74
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 75
LAB 13: Exercise Based on
Counter, Timer, Compare and Math Blocks
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 76
LAB 14: File Instruction
• File Instructions
• Interrupts
• Program Control Instructions
• Scaling Instruction
File Instructions
Copy Instruction (COP)
The COP instruction copies blocks of data from one Source address location into a
Destination address.
There are three parameters, Source, Destination (Dest), and Length associated with
the copy command:
Source is the address of a word (such as I:1, S:3, N7:0, B3:3, or T4:0.ACC)
of the file you want to copy.
Dest is the address of a word (such as I:1, S:3, N7:0, B3:3, or T4:0.ACC)
that you are copying the source file to.
Length is the number of elements, or addresses in the file you want to copy.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 77
FIFO Load (FFL) and FIFO Unload (FFU)
FFL and FFU instructions are used in pairs. The FFL instruction loads words
into a user-created file called a FIFO stack. The FFU instruction unloads
words from the FIFO stack, in the same order as they were entered.
When rung conditions change from false-to-true, the FFL enable bit (EN) is
set. This loads the contents of the source, N7:10, into the stack element
indicated by the position number, 9.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 78
FFU Instruction Operation:
When rung conditions change from false-to-true, the FFU enable bit (EU) is
set. This unloads the contents of the element at stack position 0 into the
destination, N7:11.
LFL and LFU instructions are used in pairs. The LFL instruction loads
words into a user-created file called a LIFO stack. The LFU instruction
unloads words from the LIFO stack in the opposite order as they were
entered.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 79
When rung conditions change from false-to-true, the LFL enable bit (EN) is
set. This loads the contents of the source, N7:10, into the stack element
indicated by the position number, 9. The position value then increments.
LFU Instruction
When rung conditions change from false-to-true, the LFU enable bit (EU) is
set. This unloads data from the last element loaded into the stack (at the
position value minus 1), placing it in the destination, N7:11. The position
value then decrements.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 80
Shift Registers
A bit shift register is a register that allows the shifting of bits through a
single register, or group of registers. The bit shift register shifts bits serially
(from bit to bit) through an array in orderly fashion.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 81
Bit Shift Left Instruction
It Load a bit of data array, shifts the pattern of data through the array to the
left and unloads the last bit of the data in the array.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 82
Bit Shift Right Instruction
It Load a bit of data array, shifts the pattern of data through the array to the
Right and unloads the last bit of the data in the array.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 83
LAB 15: Program Control Instruction
The JSR, SBR, and RET instructions are used to direct the controller to
execute a separate subroutine file within the ladder program and return to the
instruction following the JSR instruction.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 84
Master Control Reset (MCR)
Use MCR instructions in pairs to create program zones that turn off all the non-
retentive outputs in the zone.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 85
Temporary End (TND)
This instruction, when its rung is true, stops the processor from scanning
the rest of the program file, updates the I/O, and resumes scanning at
rung 0 of the main program (file2).
If this instruction’s rung is false, the processor continues the scan until
the next TND instruction or the END statement.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 86
Suspend (SUS)
When this instruction is executed, it causes the processor to enter the Suspend Idle
mode and stores the Suspend ID in word 7 (S:7) of the status file. All outputs are
de-energized.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 87
In this example when I:1/0 is False or I:1/1 is TRUE the suspend command
stops the
program scan, de-energizes the outputs and activates the status bit.
By using multiple SUS commands allows the ladder programmer the ability to
section the ladder into section that may be stop at anytime. This command allows
the ladder programmer to easily debug a program by progressively stop the ladder
section to finds an incorrect result.
Enter a suspend ID number from -32,768 to +32,767 when you program the
instruction.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 88
When the SUS instruction is executed, the programmed suspend ID, S:7 (word 7),
as well as the program file ID, S:8 (word 8), from which the SUS instruction
executed is placed in the system status file.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 89
One of the common uses of the SCP instruction is to take the value from an analog
input and scale it to an engineering value. In RSLogix 500, double-click on 0000.
This opens up the ASCII editor.
Type SCP in the box and press enter. SCP stands for “Scale with Parameters”. It
allows you to take an analog input from a sensor and scale it to the output units you
want. The SCP instruction starts out looking like this.
Setting up an SCP
The Input parameter is the value that will be scaled. Let’s use this SCP instruction
for the Scales. The input we will use is the address we assigned to the analog input
card; that is, I:1.0(let us consider).
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 90
The Input Min parameter is the value that is read by the analog card when there is
no liquid in the tank.
The Input Max is the value that is read by the card when the tank is full .
The Scaled Min parameter is the lowest value you want the SCP to calculate in the
units you want.
The Scaled Max parameter is the highest value you want the SCP to calculate.
The Output parameter is typically an address where you want to store the result of
the SCP.
RSlogix 500 V1.0 Arist automation Pvt. Ltd.(Confidential-For Internal Use Only Page 91