Developing A Ladder Program in Logic Developer - PC PDF
Developing A Ladder Program in Logic Developer - PC PDF
Tip: To go back to the previous page or to return to this page after selecting a link, click in the InfoViewer
toolbar.
Creating a project
Configuring I/O
Creating a Project
Before developing a ladder program you must open a project that contains a Logic
component.
Note: You can import a Waltz ladder program (.wll file) into a project. When imported a .wll either adds or
replaces a target's Logic component.
Now that the preliminaries are out of the way you can get to the nuts and bolts of
building a ladder program.
Rungs
Begin by inserting one or more rungs. A rung can have one or more ladder instructions
placed on it. A rung is a simple execution path for the instructions placed on it. Each rung
executes before subsequent rungs.
A rung description can be added above each rung.
Branches
A rung can be expanded to be a more complex execution path by inserting branches, and
then inserting instructions on them. A branch can be inserted around one or more
instructions on a rung. The order of execution depends on the placement of a branch;
instructions on a branch are executed after those within the branch.
Instructions
The instructions you insert on a rung or branch must have parameters assigned to them.
Each instruction performs some kind of logical or arithmetic operation on or with the
parameters.
A parameter description can be displayed above any parameters that appear at the top of
an instruction.
Note: An instruction's parameters are usually simple variables but can also be expressions. You have the option
of choosing or creating parameters when you insert instructions or you can assign them later.
Variables
When editing a ladder program, variables are usually created as a step when you assign
parameters to instructions or insert objects from the Toolchest. You can also create them
in the Variables tab of the Navigator at any time. You can use any variables that already
exist in your project, regardless of the source. Every variable can have a description
attached to it.
Subroutines
If you have a section of ladder logic that is repeated within your ladder program, you can
insert a subroutine instead. Each time you need to repeat the ladder logic you simply call
the subroutine. Using subroutines reduces development time.
Actions
Actions are similar to subroutines in that they are separate, named blocks of logic.
Actions are not called directly from the main ladder program. Rather they are referenced
fxClasses
If you need multiple sections of ladder logic that are the same except for the parameters
assigned, you can use fxClasses. You create or add to fxClasses by dragging complete
sections of logic (any number of rungs) from a ladder program into the Toolchest.
When the fxClass is dragged from the Toolchest to a ladder program you have the
options of:
Pasting. Insert an exact copy of the original ladder logic using the original
parameters .
Embedding. Insert a copy of the original ladder logic using parameters that are
elements of a structure variable you define when you insert. The result is a fully
editable section of logic that has no links to the fxClass.
Linking. Insert a copy of the original ladder logic using parameters that are
elements of a structure variable you define when you insert. The result is a linked
object that can only be modified by editing the original fxClass. When the fxClass is
modified all linked instances of it are also modified.
Note: Subroutines and actions can be dragged to the Toolchest from the Subroutines or Actions
Configuring I/O
Drivers | Interface Cards | I/O Equipment | I/O Terminals
Ladder programs, ST blocks, FBDs, and IL blocks operate on data acquired
from a process to generate new data to affect the process. The data acquired and
generated is transferred between the process and a PC logic block via some type of
physical I/O system. Logic Developer - PC supports a wide variety of popular I/O systems
with a library of I/O drivers. These drivers provide an interface between the Logic
Developer - PC Controller and third-party equipment of your choice.
Note: Although the general operation of all Control I/O drivers is similar, each driver has specific requirements
and functionality. See each driver's Help system for details.
Add a Driver
I/O drivers are added to a project with the Control I/O tool. Right-click the Control
I/O node in the Project tab of the Navigator and choose New Driver. Up to nine
drivers can be added to a single target. Each added driver is represented as part of a
tree structure in the Control I/O tool.
enabling I/O,
enabling forces.
When running the Controller you can view the execution of your ladder program by going
online. You can also edit an online ladder program.
Notes
While online or offline, you can display ladder logic inside a UDFB.
While online only, viewing ladder logic inside a UDFB causes all variable values to automatically display.
#FaultCode: a DINT that contains the code of any runtime errors that may have
occurred in the Controller.
#Status: each bit of this DINT indicates an aspect of the Controller's runtime
status.
#IOStatus: a DINT array that contains a status word for each I/O driver
configured. Each driver updates its own status word with codes specific to that
driver.
Tip: When online to a Controller, you can generate a Control Diagnostics report to provide a summary of the
Controller's status including platform, run-state, fault state (if any) and fault details. Details about each configured
Control I/O driver are also provided.