Section 3 Sec3

User Manual: Section 3 DirectSOFT Quick Start

Open the PDF directly: View PDF PDF.
Page Count: 5

Example Program
6
Building an Example Program
The pages that follow will explain how to do the following:
Dcreate a project
Duse the tool palette to enter instructions and build a ladder program
Duse “hot keys” to work faster
Denter nicknames and add comments
Dsetup an internal timer
Dsetup a self-resetting internal counter
Dcut and paste rungs of logic
Dsave your program to disk
Dcommunicate with your PLC
Dload your program into PLC memory
Dmonitor your program with the Data View
NOTE: The following program is given only to illustrate how some of the key features
of the software operate. This is not intended to teach you how to write ladder logic.
This example has four basic tasks:
1. Load a value into memory of your PLC that can be used as a preset for a timer.
2. Setup a self-resetting timer.
3. Use a counter to count the number of times the timer reaches the preset value
and resets.
4. Use Comparative Boolean relays to turn ON an internal coil when the counter
current value equals 5, and turn ON a second internal coil when the counter
current value equals 6.
END
OUT
OUT
OUT
OUT
DL105,
DL205
or
DL405
SP0
C2
CTA0
C1
DL305
LD K10
V2000
C0 TMR
T0
K100
CNT
CT0
V2000
CTA0
SP0
CT0
T0
END
K5
K6
=
=
C374
C162
CT601
C161
DSTR
K10
R400
C160 TMR
T600
K100
CNT
CT601
R400
CT601
C374
CT601
T600
K5
K6
=
=
OUT DOUT
The ladder logic shown below is the same program for the DL105/DL205/DL405
and DL305 families. As you work through the
Direct
SOFT screens to enter this
program in the pages that follow, the DL105/DL205/DL405 will be shown. If you
have a DL305 family PLC, substitute the proper elements and memory locations.
For example instead of entering SP0, you would enter C374.
T0 T600
What You Will
Learn
Example
Ladder Logic
Example
Example Program
77
When you click on the
Direct
SOFT icon from the
Direct
SOFT Windows Group, a
screen similar to the one shown below appears. You will notice a programming icon
in the upper left-hand corner. Click on this icon to enter your new project.
Click here to start
programming
You should now see the New Project window. You can name your project using any
combination of 8 characters (no spaces). Use “EXAMPLE1” for this example. Move
the selection bar to the PLC Family and CPU Type. For this example, use a PLC
belonging to the DL105/DL205/DL405 families. Click on OK after you have made
your Family and Type selections. If you have a DL305 type PLC, be sure and select it
instead from the choices. Keep in mind the available mnemonics, processing rules
and even the tool bar characteristics are tailored to the Family and Type selections
that you make.
New Project
Window
Type in a name
for your project
..then click on
OK
Select the
PLC Family..
Select the
CPU Type..
Step 1:
Enter the
Programming
Mode
Step 2:
Start a New Project
Example Program
8
After clicking OK to enter your project name, PLC family and CPU type, you will see
the skeleton ladder logic template. You are in the View Only Mode at this point. In
this mode, the cursor is always hollow and all you can do is browse.
View Only
Mode
(cursor is hollow)
You will want to use the Edit Mode for entering programs. This is accomplished by
holding down the control key and simultaneously pressing the letter E key (CTRL +
E). You could also click Edit on the top menu bar and then selected Edit Mode.
Direct
Soft indicates the Edit Mode is active when the cursor becomes solid and a
Tool Palette appears in the lower right portion of the screen.
In order to facilitate clear printing reproduction in this manual, you will also at this
time turn off the default 3-D Token for the ladder logic. You do this by clicking on View
and then Options. This is followed by clicking on the box labeled 3-D Token. This
removes the X in the box. To exit and record your selections, click on OK.
Edit Mode
(cursor is solid)
Tool Bar
Deselect this feature
to turn off the 3-D
ladder view look.
Step 3:
Switch to the
Edit Mode
Example Program
99
The Tool Palette can be very helpful, especially in the beginning while learning to
program in
Direct
SOFT. Later, you may prefer to use the faster Hot Keys instead of
clicking on the tool buttons themselves. The Hot Keys are shown below each
element symbol on the icon button. The expanded list is provided in the main
Direct
SOFT User Manual.
The Tool Palette shown below may not be exactly like the
one you have on your computer screen.
The tool palette shown depends on which
CPU your PLC is using. In this example, you will be using only the elements common
to all CPUs, therefore this will not be a problem.
Normally Open Contact Normally Closed Contact
Normally Open Immediate
Contact
Equal-To Contact
Greater-Than or
Equal-To Contact
Display Contact Setup
(Instruction Browser)
Display Box Setup
(Instruction Browser)
Wire Connection to Output
Normally Closed
Immediate Contact
Not-Equal-To Contact
Less Than Contact
Display Coil Setup
(Instruction Browser)
Element Browser
Wire Connection to Stage
Use the Tool Palette to enter the first instruction of the program. First move the
cursor to the desired location of the first element. A normally open contact needs to
be placed in the selected position to load the preset on the first scan. To do this, click
on the button that shows the normally open symbol. This will open a small input
window for setting up the contact.
Click here to
open input
window for
Normally Open
Contact
Move cursor to
where you want
the instruction
positioned.
The Tool Palette
Step 4:
Using the Tool
Palette to Enter
the First Element
Example Program
10
Use contact SP0 as the first element to load a preset into the PLC memory. SP0 is
used because you only need this rung to execute once, i.e. the first scan. Notice the
green/red indicator in the box. It will display the validation of each input. For
example, if you typed the letter O instead of the digit 0, the indicator would turn red
and stay red until you correct your mistake.
Enter SP0 to have
a contact that will
close on the first
scan only
Notice the Er-
ror Indicator
will glow green
if you enter a
valid contact
Click on the check mark (3) in the upper part of the input box when you have finished
typing in the element and have the green light. At that point, the instruction will be
entered. Notice the yellow vertical bar that appears next to the rung.
Since this is not
a color manual, you see a light gray vertical bar in the screen example shown below.
The yellow bar indicates you have entered an Instruction or instructions, but that you
have not compiled the rung yet by selecting Accept from the Edit menu. Rungs that
have already been accepted into compiled memory will have a green bar instead.
Without being compiled, you will not see the icons for Save to Disk or Save to PLC
enabled. This means in order to save your program anywhere you will have to
Accept your editing first. For example, if you wanted to stop working with
Direct
SOFT right now, you would first want to accept all the edited rungs so that you
could save the revised program to disk.
Yellow color coded
bar indicates the
rung has not been
accepted yet
The Save to Disk
icon is not available
because you have
not accepted your
editing yet
Step 5:
Using the SP0
Relay in Our
Program.

Navigation menu