You are on page 1of 21

Choosing Bit-Level Ladder

Diagram Elements
Important User Information
This documentation, whether, illustrative, printed, “online” or electronic (hereinafter “Documentation”) is intended for use only as
a learning aid when using Rockwell Automation approved demonstration hardware, software and firmware. The Documentation
should only be used as a learning tool by qualified professionals.

The variety of uses for the hardware, software and firmware (hereinafter “Products”) described in this Documentation, mandates
that those responsible for the application and use of those Products must satisfy themselves that all necessary steps have been
taken to ensure that each application and actual use meets all performance and safety requirements, including any applicable
laws, regulations, codes and standards in addition to any applicable technical documents.

In no event will Rockwell Automation, Inc., or any of its affiliate or subsidiary companies (hereinafter “Rockwell Automation”) be
responsible or liable for any indirect or consequential damages resulting from the use or application of the Products described in
this Documentation. Rockwell Automation does not assume responsibility or liability for damages of any kind based on the
alleged use of, or reliance on, this Documentation.

No patent liability is assumed by Rockwell Automation with respect to use of information, circuits, equipment, or software
described in the Documentation.

Except as specifically agreed in writing as part of a maintenance or support contract, equipment users are responsible for:
• properly using, calibrating, operating, monitoring and maintaining all Products consistent with all Rockwell Automation
or third-party provided instructions, warnings, recommendations and documentation;
• ensuring that only properly trained personnel use, operate and maintain the Products at all times;
• staying informed of all Product updates and alerts and implementing all updates and fixes; and
• all other factors affecting the Products that are outside of the direct control of Rockwell Automation.

Reproduction of the contents of the Documentation, in whole or in part, without written permission of Rockwell Automation is
prohibited.

Throughout this manual we use the following notes to make you aware of safety considerations:

Identifies information about practices or circumstances


that can cause an explosion in a hazardous environment,
which may lead to personal injury or death, property damage, or economic loss.

Identifies information that is critical for successful application and understanding of the product.

Identifies information about practices or circumstances that can lead to personal injury or death, property
damage, or economic loss. Attentions help you:
• identify a hazard
• avoid a hazard
• recognize the consequence

Labels may be located on or inside the drive to alert people that dangerous voltage may be present.

Labels may be located on or inside the drive to alert people that surfaces may be dangerous temperatures.
Level 1: Logix - On Demand Choosing Bit-Level Ladder Diagram Elements

Before You Begin

About this Lab


Typically, when looking to program the fundamental logic for a Programmable Automation
Controller (PAC), we begin with the requirements stated in IF-THEN-ELSE format. From there, it
is a simple matter to convert these requirements into ladder diagram logic using bit-level
instructions. In this lab you will:
 Choose bit-level ladder diagram elements
This lab takes approximately 20 minutes to complete.

Hardware
To complete this lab, you will require the following hardware:
 Printed lab manual and pencil

Software
To complete this lab, you will require the following software:
 No software is required to complete this lab.

Files
To complete this lab, you will require the following files:
 No files are required to complete this lab.

Setup
To complete this lab, you will need to perform the following setup procedure:
1. No setup is required to complete this lab.

© Rockwell Automation, Inc. All rights reserved. 1


Choosing Bit-Level Ladder Diagram Elements Level 1: Logix - On Demand

Choose Bit-Level Ladder Diagram Elements


Bit-level ladder diagram instructions provide the necessary functionality for programming
fundamental, Boolean logic. In the example used here, we would like to program logic that
performs similarly to traditional, seal-in relay logic for motor control. In this section of the lab,
you will choose bit-level ladder diagram elements necessary for controlling a conveyor.
Our conveyors in this application are started and stopped by an operator using momentary
pushbuttons that are wired to a digital input module communicating with our PAC. The start
pushbutton is normally open (NO). Therefore, in its resting state (i.e., the button is not pressed),
no voltage is sent to the digital input module, which interprets the signal as a 0 and sends this
value to the PAC. In its pressed state, the button sends 24 VDC to the digital input module,
which interprets the signal as a 1 and sends this value to the PAC:

So, if the operator does not press the start button, the logical value is 0. If the operator presses
the start button, the logical value is 1. Thus, logical value 0 does not request a motor on output,
while logical value 1 does request a motor on output.

2 © Rockwell Automation, Inc. All rights reserved.


Level 1: Logix - On Demand Choosing Bit-Level Ladder Diagram Elements

Conversely, the stop pushbutton is normally closed (NC). Therefore, in its resting state (i.e., the
button is not pressed), 24 VDC is sent to the digital input module, which interprets the signal as
a 1 and sends this value to the PAC. In its pressed state, the button sends no voltage to the
digital input module, which interprets the signal as a 0 and sends this value to the PAC:

So, if the operator does not press the stop button, the logical value is 1. If the operator presses
the stop button, the logical value is 0. Thus, logical value 1 does not request a motor off output,
while logical value 0 does request a motor off output.
The use of an NC pushbutton for the stop signal is partially a fail-safe design. That is, if 24 VDC
to the pushbutton is lost (e.g., broken wire, failed power supply), or the circuit from the button to
the digital input module fails in the open state, the overall circuit goes to the off (safe) state
(logical value 0). It is only partially fail-safe because it only accounts for one possible failure (i.e.,
an open circuit failure), but not other failures, such as a short to 24 VDC.

© Rockwell Automation, Inc. All rights reserved. 3


Choosing Bit-Level Ladder Diagram Elements Level 1: Logix - On Demand

For our outputs, we intend on using a Variable Frequency Drive (VFD) to control the motor. This
drive will communicate with the PAC over an Ethernet network and it requires a start signal and
a stop signal. When the start data is 1 and the stop data is 0, the drive runs the motor. When the
start data is 0 and the stop data is 1, the drive stops the motor.
Additionally, we have two indicators wired to a digital output module that communicates with the
PAC. One indicator shows when the motor is on, while the other shows when the motor is off:

Our logic within the PAC must use the data from the pushbutton inputs to control the outputs to
the drive and indicators in the desired manner:

4 © Rockwell Automation, Inc. All rights reserved.


Level 1: Logix - On Demand Choosing Bit-Level Ladder Diagram Elements

Looking to the conditional, input logic for the start signal, we have two bit-level input instructions
from which to choose: The Examine On (XIC) and Examine Off (XIO) instructions:

Instruction Image Instruction State

Examine On (XIC) Instruction is false when data is 0


Instruction is true when data is 1

Examine Off (XIO) Instruction is false when data is 1


Instruction is true when data is 0

When the start pushbutton is not pressed, the data is 0 and we want the instruction to be false.
When the start pushbutton is pressed, the data is 1 and we want the instruction to be true.

1. Circle the input instruction that fulfils these requirements: XIC XIO

For the output, we can choose from the Output Energize (OTE), the Output Latch (OTL), or the
Output Unlatch (OTU) instructions:

Instruction Image Instruction State

Output Energize (OTE) Writes a 0 to data without logical continuity


Writes a 1 to data with logical continuity

Output Latch (OTL) Does nothing without logical continuity


Writes a 1 to data with logical continuity

Output Unlatch (OTU) Does nothing without logical continuity


Writes a 0 to data with logical continuity

When the rung does not have logical continuity to the output, we want the output instruction to
write a 0 to the output program parameter. When the rung does have logical continuity, we want
the output instruction to write a 1 to the output program parameter.

2. Circle the output instruction that fulfils these requirements: OTE OTL OTU

© Rockwell Automation, Inc. All rights reserved. 5


Choosing Bit-Level Ladder Diagram Elements Level 1: Logix - On Demand

Combining the conditions and outputs, what we are looking for in an IF-THEN-ELSE statement
is: IF Start_PB_01 is a one, THEN write a one to Motor_On_01, ELSE write a zero to
Motor_On_01.

3. In the box below, sketch logic that meets these requirements:

4. Turn to the next even page to check your work.

6 © Rockwell Automation, Inc. All rights reserved.


Level 1: Logix - On Demand Choosing Bit-Level Ladder Diagram Elements

© Rockwell Automation, Inc. All rights reserved. 7


Choosing Bit-Level Ladder Diagram Elements Level 1: Logix - On Demand

5. Your sketch should appear similar to the following:

So this is a good start to our logic. When the operator presses the start button, the motor on
command is sent. However, the logic is incomplete, because, since we are using momentary
pushbuttons, when the operator releases the start button, the motor on command goes back to
zero, whereas we need for it to remain on.
It is possible that we could solve this problem using the latch output in conjunction with an
unlatch output. Unfortunately, latch and unlatch outputs are retentive. This means that, should
the controller shut down and subsequently restart, the last value in the motor on data would
remain, potentially causing the conveyor to start running again on start up. This is obviously not
a good situation, so we will rule this solution out.
The alternative is seal-in logic. This logic was extremely common in earlier days of motor control
when relays were used prior to the advent of the programmable controller. The circuit would
have appeared similar to the following:

8 © Rockwell Automation, Inc. All rights reserved.


Level 1: Logix - On Demand Choosing Bit-Level Ladder Diagram Elements

6. In the box below, add seal-in logic to your current design:

7. Turn to the next even page to check your work.

© Rockwell Automation, Inc. All rights reserved. 9


Choosing Bit-Level Ladder Diagram Elements Level 1: Logix - On Demand

8. Your sketch should appear similar to the following:

Now that we have the start signal sealing in the motor on command, we need a way to turn the
motor on command off when the stop button is pressed. Looking back at our relay example, we
see that this functionality is included in the form of a stop pushbutton after the seal-in circuit:

10 © Rockwell Automation, Inc. All rights reserved.


Level 1: Logix - On Demand Choosing Bit-Level Ladder Diagram Elements

9. Being careful to choose the correct bit-level instruction, add the stop functionality to your
current design:

10. Turn to the next even page to check your work.

© Rockwell Automation, Inc. All rights reserved. 11


Choosing Bit-Level Ladder Diagram Elements Level 1: Logix - On Demand

11. Your sketch should appear similar to the following:

So, our motor on logic appears to meet our requirements. Now we need to add motor off logic.
This logic is fairly simple, as we simply need to command the motor off whenever the motor on
is not commanded. In IF-THEN-ELSE format, this would be: IF Motor_On_01 is zero, THEN
write a one to Motor_Off_01, ELSE write a zero to Motor_Off_01.

12 © Rockwell Automation, Inc. All rights reserved.


Level 1: Logix - On Demand Choosing Bit-Level Ladder Diagram Elements

12. Create a new rung of logic that meets the above stated motor off requirements:

13. Turn to the next even page to check your work.

© Rockwell Automation, Inc. All rights reserved. 13


Choosing Bit-Level Ladder Diagram Elements Level 1: Logix - On Demand

14. Your sketch should appear similar to the following:

Our design now meets all of our minimum requirements. However, let’s add one more common
requirement. Often, we would like for our system to only start when all of the elements of the
system are ready. For example, we may require that there be no faults in the I/O modules
before the machine can start. Conditions that prevent a machine from starting, but do not stop a
machine once it is running, are called permissives. Conditions that not only prevent a machine
from starting, but are also capable of stopping the machine while it is running are known as
interlocks. These permissives and interlocks are often “rolled up” into a single permissive and a
single interlock tag or program parameter.
For our design, we know that we will include permissives and interlocks, but, at this point, we
still do not know what all of those permissives and interlocks will be. So, we will simply include a
single permissive program parameter and a single interlock program parameter that may later
be connected to external program parameters that contains all of the permissive and
interlocking requirements.
Thus, we require an instruction in front of our first rung of code that will turn off the conveyor
when its input program parameter is not true (i.e., when it equals 0). This will meet the interlock
requirement, as it will both prevent the conveyor from starting, as well as stop the conveyor
while it is running.

14 © Rockwell Automation, Inc. All rights reserved.


Level 1: Logix - On Demand Choosing Bit-Level Ladder Diagram Elements

15. Add the appropriate instruction, with the program parameter ‘Machine_Interlocks’, to the
front of your first rung:

16. Turn to the next even page to check your work.

© Rockwell Automation, Inc. All rights reserved. 15


Choosing Bit-Level Ladder Diagram Elements Level 1: Logix - On Demand

17. Your sketch should appear similar to the following:

For permissives, we require an additional instruction that will be tied to the permissives program
parameter that can prevent the conveyor from starting, but will not stop the conveyor once it is
running. So, if Motor_On_01 is not on and machine permissives are not on, then the conveyor
cannot be started. However, if Motor_On_01 is on and machine permissives turn off, the
conveyor continues to run. If we think about it, this operation is very similar to the operation of
our start signal.

16 © Rockwell Automation, Inc. All rights reserved.


Level 1: Logix - On Demand Choosing Bit-Level Ladder Diagram Elements

18. Add the appropriate instruction, with the program parameter ‘Machine_Permissives’, to
your first rung of logic, such that it meets the previously stated requirements:

19. Turn to the next even page to check your work.

© Rockwell Automation, Inc. All rights reserved. 17


Choosing Bit-Level Ladder Diagram Elements Level 1: Logix - On Demand

20. Your sketch should appear similar to the following:

This completes our conveyor control logic, and we are now ready to program our logic within a
routine of our Studio 5000 Logix Designer® project. Our final design appears as follows:

18 © Rockwell Automation, Inc. All rights reserved.

You might also like