Professional Documents
Culture Documents
PLC Lab Exercises: Direct Logic 205
PLC Lab Exercises: Direct Logic 205
1
♦ Direct Logic 205
2
♦ Direct Logic 205
Objective: The student will learn the memory structure of the CPU, the programming tools
in Direct32 and understand the layout and function of the Student Learning Center (SLC).
Input/Output
Objective: The student will learn the function, addressing, and the operation of the DC I/O
module and the Analog I/O modules located in the Student Learning Center (SLC).
Objective: The student will learn how to program all of the features of the operator panel
and how to integrate the operator panel and the PLC .
PID
Objective: The student will learn the elements of a Proportional, Integral and Derivative
controller and write a program that uses the devices of the Student Learning Center to
simulate an industrial PID controller.
Drum Controller
Objective: The student will learn how to program a drum controller in the PLC and integrate
the devices of the Student Learning Center (SLC) in a simulation of an industrial
application.
3
♦ Direct Logic 205
Introduction:
• PLC Trainer
• A PC with DirectSoft32 and Optimate configuration software loaded
• Digital Multimeter
4
♦ Direct Logic 205
Enter a New Project name, then Select Type DL 250 and OK.
The following screen will appear.
5
♦ Direct Logic 205
II.
IF the PLC has no current program then Xref View will appear with NONE in the Element
column. For this lab open project Intro1.PRJ by Selecting File from the upper tool bar and
selecting Open Project or Depress CTRL O. Select Intro1.PRJ and Depress Open. The
following screen will appear.
6
♦ Direct Logic 205
ELSE Highlight the link you just created and Depress Select.
IF You want to use the program in the PLC then Depress Use PLC. This will load the data that
exists in the PLC.
ELSE Depress Use Disk. This will load the data from the disk.
The following exercises are to get you familiar with the PLC and the PLC software.
Select PLC from the toolbar, then Setup and then Calendar. The following screen will
appear.
Select Get PC Time and then Write to PLC. This will write the value of the time in you PC to
the memory of the PLC. Read from PLC will retrieve the current value of time from the PLC.
Reset the date and time to the correct time by filling in then screen boxes, then select Write to
PLC to update the PLC. Then select Read from PLC and fill-in the figure above with the
retrieved value. Select Cancel to end changing calendar.
Select PLC from the toolbar, then Diagnostics and then System Information.
7
♦ Direct Logic 205
OR
Depress the on the tool bar.
The following screen will appear. Fill-in the figure below with the retrieved values. Look at the
front panel of the PLC
Note: Errors are stored in scratch pad memory that can be erased by selecting Initialize
Scratch Pad from PLC and Setup menus.
8
♦ Direct Logic 205
This screen displays then PLC program scan time (the time it takes for the program to execute
one scan of the ladder program).
Select PLC from the toolbar, then Diagnostics and then Scan Time.
1.6. Messages
This screen displays the System Error and the Fault Messages recorded by the PLC.
Select PLC from the toolbar, then Diagnostics and then Messages.
9
♦ Direct Logic 205
EWU:
(the I/O Configuration is
only valid for this trainer)
10
♦ Direct Logic 205
1.9. Memory Editor
Each memory location is initially displayed as 16 bits and the address is in octal. You have the
ability to display the memory location in the various number formats. Highlight the address to
view and select a new format. Note the X to the left of the data changed to a B, O, D, or T,
depending on the selection.
The variable area identified in the memory map table is general purpose storage area for you,
the programmer, to use. You need to manage this area. The system will not restrict where in
these areas you place data, but if you spread data all over the area, it will be harder to view
and keep track of during program development.
One way of managing the storage area is to identify memory locations with names. The name
can be entered into the PLC through the Documentation Editor table. This screen displays the
names assigned to the memory of the PLC. Select Tools from the toolbar and then
Documentation Editor or Press CTRL and D.
The nickname field is used to identify the memory location and the description can be used to
hold additional information. The R pushbutton will advance the list to the next data type and the
button can be used to search for a specific address.
11
♦ Direct Logic 205
This table identifies all of the nickname addresses and the corresponding PLC memory
locations.
EXAMPLE
DECIMAL BCD/HEX OCTAL BINARY
V1400 = 4264 10A8 10250 0001 0000 1010 1000
V10250 = 4096 1000 10000 0001 0000 0000 0000
B1400.7 = THE SEVENTH BIT OF V1400 = 1
Pointer P1400 = VALUE OF DATA AT ADDRESS OF V10250 = 4096
Pointer PB1400.12 = TWELFTH BIT OF THE VALUE OF DATA AT ADDRESS OF V10250 = B10250.12 = 1 Pointers point through an
address obtained from the original address to get the value of data at the pointed to address
Using the data from PLC I/O Configuration table we will identify the I/O configuration for this
PLC. First locate the “8 PT INPUT MDL” in the table and note the Addr In (it will be a 0 or 20).
This example will assume 0.
12
♦ Direct Logic 205
Change the element to pointer to the
address and then change the format to
BCD/Hex (this allows you to see X0 to X17
in the Value Current display). Note that the
current value is not zero. Now depress the
Red Pushbutton and observe the value. It
should read 0. The number identifies the
value of the bit of the address of the Red
Pushbutton. For example if the element is
X0 and the current value is 8 when the red
pushbutton is released then that number
corresponds to the fifth bit which is X0 (0), X1 (1),
X2 (2), X3(4), X4(8).
For example if the element is X20 and the
current value is 32 when the red pushbutton
is released then that number corresponds to
the seventh bit which is X20(0), X21(1), X22(2),
X23(4), X24(8), X25(16), X26(32).
Now determine the address of the other pushbuttons and fill in the table. Note subtract the
value of the Red pushbutton from the current value when you depress another pushbutton
and then determine the address.
Next locate the “8 PT OUTPUT MDL” in the PLC I/O Configuration table and note the Addr Out
(it will be a 0 or 20). This example will assume 20. Change the format to Bit and change the
element to the first output address Y20. Note that the current status of the output ON or OFF.
Select the opposite state in the New area and send that data to the PLC by pressing the
pushbutton. Note the light on the Output Card associated with that address will turn ON or
OFF. One of the indicator lights may also light if this is its address. Cycle through the output
address until you have all the data filled-in in the table.
Assign nicknames to all of the pushbuttons and lights.
13
♦ Direct Logic 205
This exercise will use boolean logic and ladder logic to implement some simple
programs in the PLC. If you want to clear the previous program from the PLC follow the
following steps:
Clear Memory
Clear the PLC memory by selecting PLC from the toolbar and then Clear PLC
Memory. Select ALL and OK. Answer the question to Switch to Program Mode.
View the current ladder program by selecting View from the toolbar and then Ladder View.
Important
All programs must end with an END command. If you cleared memory, then you need
to add an end command to the ladder. The ladder editor is started selecting Edit from
the toolbar and selecting Edit Mode at the bottom of the list or Press CTRL and E. If
asked for a password it is “PLC DIRECT” all caps and a space between words.
For the following examples the pushbuttons are named PB1, PB2, PB3 and PB4 and the lights
are named LT1, LT2, LT3 and LT4.
The lines that connect the ladder elements are called wires and can be drawn using the key
strokes found by selecting EDIT and then Wire >.
14
♦ Direct Logic 205
Complete the following tables, draw the equivalent ladder logic and then enter into the PLC
and test the code. The following are some buttons that will be used in this process.
Read from PLC Write to PLC Change PLC Mode System Information
Check code for Syntax errors
After the ladder logic has been entered it must be tested for syntax errors by pressing
or F8. After a syntax check then the code must be written to the PLC by pressing or
SHIFT and F9. Once written to the PLC, the PLC must be in the RUN mode to begin
execution of the code. Select or CTRL, SHIFT and R to show the mode screen.
2.3. OR Rung
OR Diagram
()
(END)
Truth Table
AND Diagram
()
(END)
Truth Table
15
♦ Direct Logic 205
2.5. XOR Rung
Logic Table - Light is ON only when one switch open and the other is closed.
XOR Diagram
()
(END)
Truth Table
Logic Table - Start Pushbutton energizes the output which stays ON until the Stop Pushbutton
is pushed (recommend the REDPB for the stop pushbutton).
()
(END)
Truth Table
16
♦ Direct Logic 205
2.7. FlipFlop Rung
Logic Table - The output changes ON/OFF states on each closer of the switch. A new entity,
a positive differential also known as a one shot is needed to complete this rung. The one shot
is true or closed for only one scan following a transition from open to closed on SW1.
FlipFlop Diagram
()
(END)
Truth Table
Logic Table - These two switches are used in a house to turn ON and OFF a light from two
different locations. Each switch has a common leg connected to an normally open and a
normally closed contact.
3-way Diagram
()
(END)
Truth Table
Logic Table - The 4-way switch configuration starts with the 3-way circuit and adds a 4-way
switch between the 3-way switches. The 4-way switch either is straight through or
crisscrossed depending on the switch position (up or down).
17
♦ Direct Logic 205
4-way Diagram
()
(END)
18
♦ Direct Logic 205
2, Range 4 to 20 mA current
Resolution 12 bit (1 in 4096)
Peak Withstanding Voltage 75 VDC, current outputs
External Load Resistance 0Ω minimum, current outputs
Minimum, Loop Supply Voltage Range 18–30VDC, current outputs
Maximum Load / Power Supply 620Ω/18V, 910Ω/24V, or 1200Ω/30V current outputs
24V, 18V, 30V, Linearity Error (best fit) ±1 count (±0 025% of full scale) maximum
0.025% Settling Time 100 µs maximum (full scale change)
Maximum Inaccuracy ±0.1% @ 25°C (77°F)
±0.3% @ 0 to 60°C (32 to 140°F)
Full Scale Calibration Error ±5 counts at 20 mA current output
Offset Calibration Error ±3 counts at 4 mA current output
Digital Input and Output Points Required 16 point (X) inputs and 16 point (Y) outputs
Update rate for D2-250 is 2 output channels per scan maximum –1 input and 1 output channel
The address to configure, retrieve and send data to the F2-4AD2DA Analog Input/Output
module is dependent on the slot where it is located in the base.
19
♦ Direct Logic 205
The analog modules
slot number can be
retrieved from the I/O
Configuration. The
format for the number
of channels is shown
below. The following example is for a module located in slot 3. The SP0 address of the
contact is a special relay that is true only for the first scan of the code and will send this setup
information to the
module only once. The
K in the LD instruction
represents a constant
integer. The next
instruction outputs the
variable to address
V7663, which is the
module parameter
location for No. of
channels. The next
instruction is the Load
Address and the O tells
the PLC that it is an
Octal Address since it is
used as a pointer. The
values of the input and
output channels will be
stored in address as
shown.
The dial on the panel is connected to a potentiometer which will feed an analog signal to one
of the input channels. Type in the required code to access your F2-4AD2DA Analog
Input/Output module and change the mode from Run to Program and then back to Run. This
causes the SP0 to be activate for one scan and setup the module in the PLC. Determine the
input address assignment by pressing the will bring up the following screen. Change the
element to the first address that is assigned to an input. In this code example the first address
is V2000. If the Current value is > 0 the try turning the dial to change the number. If the
number changes then that is the channel and the element is the address. Repeat looking at
the input address until the channel for the potentiometer is identified (V2001, V2002, V2003).
20
♦ Direct Logic 205
Connect a multimeter on the milliamp scale across the red and black terminals on the lower
right side of the panel or if using a resistor use the volt scale. See below:
21
♦ Direct Logic 205
3.1. Introduction
The operator interface is a device that is programmed to provide a means for the operator to
interact with the PLC code. The interaction can include starting and stopping a process,
reporting system status, inputting data and setpoints, and modifying and altering the ongoing
process.
The Optimate 1500 is programmed using an Optimation Editor. This is offline program that is
configured and then the data is transferred to the panel. The panel is connected to the PLC
via two cables and a telephone type coupler. This is the configuration to transfer data to the
PLC. When transferring the program between the computer program and the panel the
programming cable is plugged into the other side of the coupler and the PLC is removed.
There are two switches on the right side of the panel. The top is power to the panel and the
lower switch when Program (UP) will allow a program to be transferred to the panel and in the
Run (DOWN) position the PLC can communicate with the panel. When ever the Program/Run
switch is moved up or down the panel needs to be reset by turning the panel OFF and then
back ON.
Start the software and the first screen will look like:
22
♦ Direct Logic 205
Ensure the Type is set to OP1500 and the Address is set to the area of memory you plan to
use. Then press the Configure Panel pushbutton and make entries to get the screen to
look like this picture. Double clicking a message number will open the next editor screen. A
message line is limited to a total of 20 characters. Both a data display and a data entry point
is programmed using the ^ character, all of the other characters will print on the screen as they
appear. Note the condition of the pushbuttons. Change the cable configuration and the
programming switch and the press Write to Panel.
23
♦ Direct Logic 205
Enter nicknames for the addresses associated with the operator panel.
24
♦ Direct Logic 205
3.4. Operator Panel Support Code
25
♦ Direct Logic 205
26
♦ Direct Logic 205
27
♦ Direct Logic 205
28
♦ Direct Logic 205
3.5. Operator Interface Exercise
Program the operator interface to have F1, F2 as alternate and F3, F4, and F5 to have
momentary action. When F1 is on then turn on the yellow light. When F3 is depressed then
turn on the green light keeping it on until there is a screen change and bring up two new lines,
one to display the value of the active analog input channel and one to display the value sent to
the active analog output channel. When F4 is pressed replace one of the lines with an value
input that will change the value sent to the active analog output channel. Using F2 switch
sources of data to the active analog output channel between the value set with F4 and the
value read from the active analog input channel.
4.1. Introduction
The DL250 PLC processor can support up to four proportional-integral-derivative (PID) loops.
The computing powered to support this algorithm is generally found in much larger processors.
The PID loop controller is used to control a process to a desired setpoint and is used when the
system response characteristics do not allow simple ON/OFF control to keep the component
at a specified setpoint. The PID loop uses one of two equations to evaluate the system
characteristics and provide an output to a device to attempt to bring the component to the
desired setpoint.
In this diagram the current tank level is converted by the analog input module. The level is
compared with the desired setpoint that resides in the PLC and an error signal is generated.
A proportional, integral, and derivative gain is applied to error signal to calculate a output that
is applied to a control valve via the output module. The details of setting up a PID loop can be
viewed by selecting PLC from the toolbar, then Setup and then PID. If asked to switch to
29
♦ Direct Logic 205
program mode respond Yes. Enter the Table Start Address, this is the starting address and
requires 32 words to contain 1 PID loop. Increase the number of loops to 1.
Press Update and Exit. Select Configure and set the Sample Rate to 1.0 sec. Select
SP/PV and note the address of the setpoint, this should be an address in the range used by
the PID loop. In the Process Variable select Auto transfer from I/O module and then enter the
slot and channel number of the active analog input channel (a number between 1 and 4). In the
Output enter 4095 in the Upper Limit and leave the lower limit at 0. Select Auto transfer to I/O
module and enter the slot and channel number of the active analog output channel (a number
between 1 and 2). In the Tuning enter 25 for Gain (proportional gain) and 10 for Reset (Integral
Gain) and select Freeze Bias. Close the PID screen and save both to the PLC and disk.
4.2. Exercise
Place the PLC in the run mode and enter 600 in the setpoint address. Selecting View from the
toolbar and then PID View. From this screen the Mode can be changed from Manual to Auto.
If the loop is in alarm and you can’t get it to clear and run correctly then reset the loop by writing
0 to the first word of the PID loop memory area.
Use the PID View, the multimeter connected to the output and the potentiometer that is the
Present Value to vary the parameters of the PID loop to learn the characteristics of the PID
loop. Adjusting the gains and/or setting the integral to 0 and see the response of the loop.
Additional information is available in the DL 205 PLC User Manual Section 8.
5.1. Introduction
The drum sequencer is a box instruction that has four configurations that simulate an electro-
mechanical drum sequencer. These instructions can be used to organize and step through a
repetitive sequence of outputs. A practical application would be the timer on a washer or
dryer. To implement a drum sequencer, 4 counters are used to control and advance the
sequencer. The counters are numbered sequentially from the first programmed counter and
provide the following functions.
Each of the sixteen steps can be programmed with a step duration and/or a condition to allow
the step to start timing. The event drum instruction will be presented in this lab.
In the following example CT0 will be the first counter and CT1, CT2, and CT3 will be used as
described above. The Step Preset is the step the drum start processing after the Reset has
been toggled. Using the nicknames for the inputs, outputs and events can make the instruction
very readable.
30
♦ Direct Logic 205
5.2. Example
This example shows a bread recipe sequence.
31
♦ Direct Logic 205
NOTE
When the drum instruction is first written to the PLC the PLC must be shifted to
PROGRAM mode and then back to RUN for the instruction to fully allocate memory.
The drum RESET must also be toggled in order to reset the instruction correctly.
Notice the use of nicknames to simplify the readability of the sequencer operation. Step 2 will
wait until 1 gallon of water has been added and likewise step 3 will wait until 5 additional
gallons have been added. Ladder logic will be added to support the sequencer output. For
example the water temperature maybe controlled to a specific temperature. The ladder logic
could require a minimum temperature or the water will be directed toward the drain until it is
suitable for the dough. The value in the field 0.01 sec/Count defines the time base for the
sequencer. In this example 6000 X .01 = 60 sec/count or 1 minute.
5.3. Exercise
Develop the code for a drum sequencer that will blink one of the four lights and when the
operator presses the same colored button the light will turn on solid for 5 seconds and then
sequence to the next programmed light and start blinking. Use the pushbuttons and lights on
the operator interface to START, STOP, and RESET the drum as well as using the green light
to show that it is running. Program the drum so that the nicknames are used to document the
instructions. Try to write the program so that the light pattern can be changed by only altering
the drum instruction. Extra effort would be to have the operator interface show which step the
drum was ON and what color of light was being operated.
NOTE
When the drum instruction is first written to the PLC the PLC must be shifted to
PROGRAM mode and then back to RUN for the instruction to fully allocate memory.
The drum RESET must also be toggled in order to reset the instruction correctly.
6. Final Exercise
Problem- Le Machine
Your task is to program a 500 lb. Commercial Washing Machine. The machine has a liquid product
dispenser for soap (S), bleach (B), sour/softener (SS). The customer wants the machine to have an
automatic cycle for white material, colored material, and permanent press. The machine rotates in
both clockwise and counterclockwise directions when washing or rinsing, changing direction ever 15
seconds. The machine has separate motors for wash, draining, Iow and high speed spin.
The drain valve is either open or closed and must be closed to fill, failing open on a loss of power.
The water supply is hot (200 + 10°F) delivered at 40 gallons per minute and cold (60 + 5°F) delivered
at 60 gallons per minute. The water fill time is not included in the time to perform a step (timer stops
until the water level is satisfied). Low water level requires about 60 gallons of water and high about
100 gallons. The product supply metering pumps are set to deliver a rate of 2 ounces per second.
Task:
32
♦ Direct Logic 205
Receive desired cycle type selection (1, 2, or 3) from the operator panel. Start, stop and abort cycle
switch are to be defined on the operator panel. The green, yellow, and red lights on the operator
panel will indicate the injection of soap, bleach, or sour/softener. The white indicator will be on during
the entire cycle, the green indicator will be on when the wash motor is running, the yellow indicator
will be on when drain valve is shut and flashing during a drain cycle, and the red indicator will be on
during Iow spin and flashing when the fast spin motor is running. Total elapsed cycle time will be
displayed on the operator panel.
Program a drum instruction to run the machine trough the first two cycles and program another
drum instruction to run the Permanent Press cycle.
33