Sei sulla pagina 1di 5

Developing a Ladder Program in Logic Developer - PC

Developing a Ladder Program in Logic Developer - PC

In Logic Developer - PC, a ladder program is intended as a control algorithm that


operates on data acquired from a process to generate new data to affect the process.
Developing a ladder program with Machine Edition Logic Developer - PC is fast and easy.
The tools available in the Machine Edition environment allow you great flexibility in how
you work; few restrictions are placed on the order you proceed. Help is available at any
time. The following is an overview of the development cycle.

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

„ Editing a ladder program

„ Configuring I/O

„ Validating a ladder program

„ Configuring the Controller

„ Running a ladder program

„ Debugging run time problems

Creating a Project
Before developing a ladder program you must open a project that contains a Logic
component.

To create a project using a template:

1. In the Manager tab of the Navigator, right-click on My Computer and


select New. The New Project dialog box appears.
2. Type a name for your project in the New Project box.
3. From the Project Template list, select a template that suits the component and
platform requirements of your project. A description of the template is provided as
you scroll through the list.
4. Click OK. The components of the new project appear in the Project tab of the
Navigator.

To add a Logic component to an existing project:

z In the Project tab of the Navigator, right-click a target, point to Add


Component, and then choose Logic. The Logic folder with a sample ladder
program and SFC appears under the target node.

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.

Wednesday, April 10, 2013 Page 1 of 5


Developing a Ladder Program in Logic Developer - PC

Now that the preliminaries are out of the way you can get to the nuts and bolts of
building a ladder program.

Editing a Ladder Program


Rungs | Branches | Instructions | Variables | Subroutines | Actions |
fxClasses
When you open a new ladder program it is empty, except for a program description and
the default START, and END labels that every program must contain. You insert the main
part of your ladder logic between the START and END labels. Initialization logic is
inserted before the START rung. Subroutines and actions are separate blocks of logic
referenced from the main ladder program or its associated SFC, and each is opened
in a separate editor window.
You can edit the program description that appears at the top of 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

Wednesday, April 10, 2013 Page 2 of 5


Developing a Ladder Program in Logic Developer - PC

by an associated SFC, or more specifically by the multi-action included in an SFC. Each


action is opened for editing in a separate window.

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

folders in the Project tab of the Navigator.

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.

Install and Configure an Interface Card


Each I/O driver added to a project generally requires the installation of a specific
interface card into the target computer. When installing, various hardware settings are
made on a card, usually to specify the address the card resides at in the workstation.
While configuring an I/O driver, any hardware settings you make on a card must agree
with the settings specified in the driver software.

Wednesday, April 10, 2013 Page 3 of 5


Developing a Ladder Program in Logic Developer - PC

Add and Configure I/O Equipment


After a driver and interface card have been added and configured, you can add and
configure equipment racks, modules and devices using the Control I/O tool. Each added
item is shown graphically in the I/O tree in the InfoViewer. The equipment you select
mirrors the actual I/O network installed in your plant or process.

Map I/O Terminals


The lowest level of the I/O tree is a representation of I/O terminals. The number and
type of these terminals depends on the equipment you have specified. In order to share
data between ladder programs, ST blocks, FBDs, IL blocks, and your physical
plant, you map parameters to the I/O terminals. You simply drag a variable from the
Variables tab of the Navigator (or anywhere else it appears) to an appropriate I/O
terminal. Expressions can also be mapped to I/O terminals.

Validating a Ladder Program


A ladder program must be free of syntax errors before it can be downloaded to the
Controller. You validate a ladder program to detect syntax errors. Errors and warnings
are listed in the Build tab of the Feedback Zone. Simply double-click an error or warning
message to locate the problem in your project.
Note: A validation is automatically performed when you download a project.

Configuring the Controller


You must configure the Controller to specify its location, behavior, and performance,
before downloading a ladder program to it (often the default properties are acceptable).
After running the ladder program you may want to tune the Controller to ensure top
efficiency from the target workstation.
Note: Controller properties are a subset of Target properties and can be set in the Inspector.

Running a Ladder Program


When a ladder program is free from syntax errors you can download it to the
Controller. Then you have options such as:

„ starting the Controller,

„ enabling I/O,

„ single-scanning your program,

„ resetting the Controller, and

„ 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

Wednesday, April 10, 2013 Page 4 of 5


Developing a Ladder Program in Logic Developer - PC

„ 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.

Debugging Run Time Problems


Even a validated ladder program can cause faults to occur when running in the
Controller. Logic Developer - PC provides system variables you can monitor in the Data
Watch tool to help debug run time problems. Of particular interest are:

„ #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.

Help us improve our documentation! Send feedback to doc@ge.com


Need more help? Get online support at http://ge-ip.com/support
Machine Edition 6.50
© 2010 GE Intelligent Platforms, Inc. All Rights Reserved.
* Trademark information

Wednesday, April 10, 2013 Page 5 of 5

Potrebbero piacerti anche