PLC Programming with RSLogix 500 Guide
PLC Programming with RSLogix 500 Guide
January 2008
Index
Team information
PLC Micrologix 1200
Inputs 14 24 Vcc
Outputs 10 Relay
Next we will see how to use the RSLogix 500 software, which will allow us to create the
control programs in Ladder language of the MicroLogix 1200 programmable logic controller.
It shows us a window where we have to select the PLC we are going to work with,
in this case we will select the model
And we accept.
And we arrive at the main screen, where we are going to edit our programs in language of
contacts or Ladder.
Menu bar: It allows performing different functions such as retrieving or saving programs,
help options, etc. Here we find the basic functions such as those of any
other software.
Icon bar: Encompasses the most frequently used functions in program development.
Processor status bar: It allows us to view and modify the operating mode of the
processor (online, offline, program, remote), upload and/or download programs, as well as
view the controller used.
Project tree: Contains all the folders and files generated in the project, these are
They are organized into folders, the most important ones are the following:
Controller
Program files
-Data Files
Provides access to the program data to be used as well as the cross-references.
We can configure and query outputs, inputs, binary variables,
timers, counters, etc.
Results panel: Programming errors that arise when checking the correction appear
of the program executed (located in the icon bar)
By double-clicking on the error, the cursor will automatically position itself on the window.
of the Ladder program in the position where the error has occurred.
- OffLine: It consists of running the program on the PC, without any need to access the
PLC to later download the program once it is finished and verified.
processor.
- OnLine: The programming is done directly on the PLC's memory, in a way
that any change made to the program will directly affect the
processor, this method allows us to make modifications in real time.
Now, after the menu descriptions we saw earlier, we will see how to edit
a ladder program for the PLC, for this we must be located on the main screen,
selecting the correct PLC model that we are using.
As we mentioned, the different instructions of the Ladder language are found in the
next instructions bar:
Within this menu are the instructions we will use to create our
programs, which are described below, for now only the
instructions, with the purpose of locating which menu they are contained in, later on
we will make examples using these instructions.
Check if the binary variable is active (value=1), and if it is, allow the signal to pass to the
next element of the branch. The binary variable can be either an internal variable of
memory, a binary input, a binary output, the variable of a timer, among others.
Check if the binary variable is inactive (value=0), and if it is, allow the signal to pass to
next element of the branch.
If the prerequisites of the branch are true, the variable is activated; if they cease to be true,
conditions or in a later branch the instruction is reused and the condition is false, the
variable is deactivated.
If the preconditions for the branch are true, the variable is activated and remains activated even though
the conditions cease to be true. Once this instruction is established, it will only be deactivated the
variable using the complementary instruction that appears below.
This instruction is usually used to negate the effect of the previous one. If the conditions
The branch previews are true, the variable will be deactivated and will remain deactivated even though the
conditions cease to be true.
This instruction combined with the normally open contact activates the variable.
output only when the contact variable transitions from 0 to 1 (rising edge
ascending). In this way, the behavior of a pushbutton can be simulated.
Instruction that serves to delay an output, starts counting time intervals when
the conditions of the line become true, the timer increments its accumulator
until reaching the preselected value. The accumulator is reset (0) when the conditions
The lines become false.
It is used to increment a counter with each transition of the row from false to true.
Exercises
Already on the main screen, we check that the instruction bar is selected.
USER tab.
The first step will be to add a new rung, we just need to click on the icon. and it
a new rung will be added to our program.
The first element we will add is our input, we just select it with the icon.
, and we drag it to where we want to place it, without releasing the mouse button.
We see that when selecting the element and dragging it, the software indicates to us through a
green box, where we can place the element correctly. To accept and place
The element just releases the button of the tangerine and it stays in its place.
For now, our entry shows us a question mark, this is because we have not...
addressing of this entry has been done.
Next, we provide our output, we select with the icon and we drag it
where do we want to place it.
We already have the necessary elements for this exercise, now we just need to do the
addressing, that is, indicating which input and output number we are using.
First we will address the input, in the project tree we look for the DATA FILES folder.
and we double click on I1-INPUT, and the following dialog box will open:
Here we can see the entries we have available, in this case I:0.0 from 0 to 13, for the
for example we will use number 0, we select 0 and drag it to where our is
entry.
For the output, we do the same procedure now, we open O0-OUTPUT, and at 0:0.0
we select the 0 and drag it to where our output is.
We already have the program ready, now before loading it into the PLC, we must configure the
communication between the PC and the PLC, since if we want to load it like this, the software will send us the
next signal, where it indicates that the communication is not configured.
We return to RSLogix 500 on our main screen, and we look for the status bar of the
processor
And we selected:
Here we have successfully loaded our program, and we are in ONLINE mode, for
What we are monitoring is where there is signal in our program.
If we activate the input, the output will be activated and our elements will turn green, in
In the PLC, each output and input has an LED that indicates its status.
2.- Normally Open Contact (XIC Examine If Closed) in series with
the Normally Closed Contact (XIO Examine If Open), add
descriptions of the elements.
To start this example, we will add a Normally Closed Contact (XIO Examine If
Open) in series with the contact we already had and we will direct it with a different output.
to the normally open contact.
Now to make it easier to identify each entry or exit, we will add a comment.
In this case, we will label the normally open contact as START, for the normally contact
open STOP and at the exit LIGHT.
We follow the same procedure until we have our diagram in the following way.
This tool will be very useful for easily and quickly identifying elements in programs.
extensive or complex, where we have several inputs or outputs, or in programs where
let's use the same input or output in several rungs.
For this we need to use virtual contacts and coils, that is, contacts and coils that
they do not exist physically, they do not have any connection or physical terminal where to wire, without
embargo in our program we make the connection as if these existed, these elements
are simulated by the PLC.
For this circuit, we will use two inputs from the PLC, one for a normally open button without
interlocking (START) and the other for a normally closed button without interlocking
(STOP), a coil and its normally open virtual contact, and a real output of the PLC.
(MOTOR), where we can connect a contactor, a motor, an indicator light,
etc., in this case we will simply call it MOTOR.
As a first step, we put our START, STOP buttons and the MOTOR output, note that
that we drag all the elements from the USER tab.
Now to be able to use the virtual inputs and outputs, we switch to the bit tab and see that
we also have contacts and coils on this menu.
From this menu, we select the elements that we will use as contact and coil.
assistant, we should also place the loop in parallel with the START button that we
erase the memory of the circuit.
We already have the elements we will use, now we just need to direct them.
for this in the program tree we click on DATA FILES B3 -BINARY and we
the following window appears:
From this window we will drag B3:0 into the coil and the auxiliary contact, as the
Auxiliary contact corresponds to the auxiliary coil, its addressing is the same.
Later we will see how to add more auxiliary elements.
Al direccionar todos los elemntos auxiliares nuestro programa quedara de la siguiente
way
Note that the addressing of the auxiliary elements is different from that of the
real outputs and inputs.
Now we upload the program to the PLC, and upon activating the output I:00 (START), in the simulator.
from the PLC inputs, we only give a pulse and return it to the off position,
and we see how the memory is made in the circuit, to deactivate, we cut the
memory with the entry I:01.
4.- Timers.
The main purpose of using timers in automation is to control the time that
it activates an element or deactivates it when a certain time has passed.
The first example we will see to learn how to use timers for the Micrologix PLC,
it will be the simplest case, to prolong the activation of an output for a determined time,
with a single input pulse.
To start, we begin with the previous problem, only this time we eliminate the actual output.
And we go to the TIMER/COUNTER menu, we select the icon and it
we dragged it to the place where our exit was, resulting in the following:
So far, we have only set the timer; we still need to make its contact.
exit that will be activated after the scheduled time passes, we will define before
What data do we need to input in the timer for it to work?
function.
Selected value, here we define the time it will take for the timer to activate the
output, for example, if we set 50, when the timer is energized, it will wait 50 s
to activate your contact.
Accumulator, when the timer is energized, we will see how many seconds
They have elapsed.
To complete our program, we added the contact of the timer and an output.
real.
Now we will define the timer and set a PRESET value of 10s to define.
the timer and its contact we open T4 - TIMER in the program tree in the
DATA FILES folder, and we have the following window:
We will define the timer by selecting Offset T4:0, and dragging it to the timer.
to define the contact, we select DN 0 and drag it to the contact of
timer.
We have defined the value of PRESET, we define the actual output of the PLC that
we will activate and load it into the PLC.
We then set the value of PRESET, we define the actual output of the PLC that
we will activate and load into the PLC. When 10 seconds pass, the contact of
the timer will be activated as long as the timer is powered on, for
to deactivate it, we stop sending a signal to the timer, that is, with the STOP button we cut it off
the memory and the auxiliary contact opens, causing the timer to stop receiving
the signal and its contact opens, causing the output to deactivate.
There is another timer, similar to TON, only in this timer its contact does not
deactivates when it stops receiving signal, otherwise to be able to deactivate it we need to associate it.
a RESET function, this timer is RTO Retentive On Delay.
To create an example with this timer, we use the previous program.
we only changed the TON timer for an RTO, and we set the same to 10 s,
and we load it into the PLC. It should look like this:
When running the program, we see that it performs the function in the same way as a
TON timer, only that when pressing the STOP button, the output does not deactivate, to
to be able to deactivate it we need to put a RESET in our program for that
timer, this is found in the same menu as the timer , and it works
like a coil, so to activate it we will need to use an input, the
the complete program falls as shown:
When testing the program, we see that the only way to deactivate our output O:0 is
mediante el boton de Restablecer, otra manera seria en lugar de activarlo con una
additional input, program the same STOP button as a reset for the
timer, as shown below:
5.- Counters.
Defined as memory positions that store a numeric value, the same that
it increases or decreases according to the given configuration of that counter.
For example, if the counter has a preset of 15 and the count value is at 14, it is said
that the counter is inactive, without implying that it is not present.
counting. But at the next pulse, when the value reaches 15, it is said that the counter
It is active because it has reached the preset value.
The most basic purpose of a counter is to allow the passage of signal to an element.
but only a certain number of times, when counting these pulses and reaching the value
the contact associated with this counter will be activated, this counter corresponds to
COUNT UP type , and is found in the Timer/Counter menu.
The following example consists of activating an output by programming a preset value to the
3 counter, when running the program, we give three pulses to the counter, that is, we activate
the assigned entry (START) three times to activate the timer contact and
this will activate our exit.
By activating and deactivating our START button, we see that the counter increases.
your accumulator, depending on the times we have sent a signal to the meter.
When the number in the accumulated value equals the preset value, the contact of
The timer is activated, so the signal can reach our output.
High-speed counter
HSL, RAC ± The high-speed counter instructions (along with the function file
HSC) allow for the control and monitoring of high-speed physical outputs. Generally, it
they use with CC tickets. 5-1
High-speed output PTO, PWM ± The high-speed output instructions (along with
the PTO and PWM function files allow monitoring and controlling the high physical outputs
speed. Generally used with FET outputs (BXB units) 6-1
Relay type instructions (bit) XIC, XIO, OTE, OTL, OTU, OSR, ONS, OSF ± Relay type instructions (bit)
they monitor and control the state of the bits. 7-1
Timer and counter TON, TOF, RTO, CTU, CTD, RES ± The instructions of
Timer and counter control operations based on time or the number of events.
8-1
Comparison EQU, NEQ, LES, LEQ, GRT, GEQ, MEQ, LIM ± The instructions of
Comparison compares values through a specific comparison operation.
9-1
Mathematics ADD, SUB, MUL, DIV, NEG, CLR, ABS, SQR, SCL, SCP, SWP ± The
Mathematical instructions perform arithmetic operations. 10-1
DCD, ENC, TOD, FRD, GCD conversion ± The conversion instructions perform the
multiplexing and demultiplexing of data and perform conversions between binary values and
decimals. 11-1
AND, OR, XOR, NOT logic ± Logical instructions perform bitwise logical operations
in the words. 12-1
Transfer MOV, MVM ± The transfer instructions modify and move words.
13-1
File CPW, COP, FLL, BSL, BSR, FFL, FFU, LFL, LFU ± File instructions
perform operations on file data. 14-1
Program control JMP, LBL, JSR, SBR, RET, SUS, TND, MCR, END ± The instructions of
program flow changes the execution flow of the ladder logic program. 16-1
Input and Output IIM, IOM, REF ± The input and output instructions allow for updates
selectively data without waiting for the input and output scans. 17-1
User interrupt STS, INT, UID, UIE, UIF ± User interrupt instructions
they allow interrupting the program according to the defined events. 18-1
PID process control ± The process control instruction provides loop control.
closed. 19-1
ASCII ABL, ACB, ACI, ACL, ACN, AEX, AHL, AIC, ARD, ARL, ASC, ASR, AWA, AWT ± The
ASCII instructions convert and write ASCII strings. They cannot be used with the MicroLogix
1500, processors 1764-LSP Series A. 20-1