You are on page 1of 33

Direct Logic 205

PLC Lab Exercises

Direct Logic 205

1. Lab Exercise #1 - The PLC ..................................................................................................... 5 1.1. Getting Started................................................................................................................... 5 1.2. PLC Communications ....................................................................................................... 6 1.3. PLC Time and Date information...................................................................................... 7 1.4. System Information............................................................................................................ 7 1.5. Scan Time .......................................................................................................................... 8 1.6. Messages........................................................................................................................... 9 1.7. PLC I/O Configuration....................................................................................................... 9 1.8. PLC Memory Map ...........................................................................................................10 1.9. Memory Editor..................................................................................................................11 1.10. Mapping PLC I/O...........................................................................................................12 2. Lab Exercise #2 - I/O Logic and Analog Card.....................................................................14 2.1. Ladder Logic....................................................................................................................14 2.2. Single Rung ......................................................................................................................14 2.3. OR Rung ...........................................................................................................................15 2.4. AND Rung.........................................................................................................................15 2.5. XOR Rung.........................................................................................................................16 2.6. Simple Motor Starter Rung .............................................................................................16 2.7. FlipFlop Rung ...................................................................................................................17 2.8. 3-way Switch Rung ..........................................................................................................17 2.9. The Challenger.................................................................................................................18 2.10. Analog Input/Output Module Specifications ................................................................18 2.11. Analog Module Operation.............................................................................................19 3. Lab Exercise #3 - Operator Interface OP 1500..................................................................22 3.1. Introduction .......................................................................................................................22 3.2. Optimation Panel Configuration.....................................................................................22 3.3. Operator Panel Memory Map.........................................................................................23 3.4. Operator Panel Support Code .......................................................................................25 3.5. Operator Interface Exercise............................................................................................29 4. Lab Exercise #4 - PID Loops ................................................................................................29 4.1. Introduction .......................................................................................................................29 4.2. Exercise............................................................................................................................30 5. Lab Exercise #5 - The Drum Sequencer..............................................................................30 5.1. Introduction .......................................................................................................................30 5.2. Example ............................................................................................................................31 5.3. Exercise............................................................................................................................32 6. Final Exercise..........................................................................................................................32

Direct Logic 205

Introduction to Direct Logics DL - 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). Operator Panel - OP 1500 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.

Direct Logic 205

Introduction:
Tools required for all of the exercises in this series are: PLC Trainer A PC with DirectSoft32 and Optimate configuration software loaded Digital Multimeter

Terminology and instruction style used for these exercises: Select - means to double click the item unless told otherwise. Press - means to type the key or key sequence that follows. Depress - means to single click a pushbutton or object. IF ELSE Identifies there are two more paths to take and you need to read ahead to see which path is correct.

1.

Direct Logic 205

Lab Exercise #1 - The PLC 1.1. Getting Started


1. 2. 3. 4. 5. Attach the programming cable to the PCs serial port Plug the telephone type RJ-11 connector into the PLC (top plug) Plug-in the PLC power cord. Start the DirectSoft32 software Turn ON the PLC power switch

This window should come up on the screen momentarily.

and then the next screen will look like:

Enter a New Project name, then Select Type DL 250 and OK. The following screen will appear.

Direct Logic 205

II.

1.2. PLC Communications


Select PLC from the upper tool bar or Press ALT P. Select Connect or Press ALT C. ADD a new Link by Selecting ADD, then COM2, then DL 05/1/2/4/350 Family (from the list), then K sequence and Address 1. Enter a name for the Link (i.e. Intro1.PRJ), then a description of the link (not required). Fill- in the following table from the screen when it appears.

Then Select FINISH. 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.

1.3.

PLC Time and Date information

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.

1.4.

System Information

Select PLC from the toolbar, then Diagnostics and then System Information.


OR

Direct Logic 205

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

Verify the PLC Type, Mode, and Hardware Switch

Note: Errors are stored in scratch pad memory that can be erased by selecting Initialize Scratch Pad from PLC and Setup menus.

1.5.

Scan Time

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.

The data presented will inform the programmer of the time required to scan the program. If the Maximum Scan Time gets to long in a time critical application the closing and opening of a switch maybe completely missed. Fill-in the table at the left with the current data.

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.

1.7.

PLC I/O Configuration

This screen displays the I/O configuration as detected by the PLC. Select PLC from the toolbar and then Configure I/O.

Direct Logic 205

Fill-in this table with the data from the PLC Trainer. The PLC Trainers all have different I/O configurations. This table will be used when programming to address the various switches and lights located on the control panel. Record the trainer ID number: EWU: (the I/O Configuration is only valid for this trainer)

1.8.

PLC Memory Map

Retrieve the Memory Map for the 250 PLC. Select PLC from the toolbar and then Memory Map. Note the 8PT Input MDL card Addr In value. For example 20. From the table at the left we would find the Input range from X0 - X777 (octal). The this PLCs inputs would be X20 thru X27 (this uses the starting address from the previous table and the fact that it is an 8 PT card yielding these unique 8 address) The outputs might be at Y20 thru Y27.

10

Direct Logic 205

1.9.

Memory Editor

This screen displays the contents of the memory of the PLC. Select Tools from the toolbar and then Memory Editor or Press CTRL and Y. 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.
MEMORY MAP FOR PLC TYPE: 250 Element Global Element Type Range Program Memory WORD Timer Accumulator WORD TA0 - TA377 Counter Accumulator WORD CTA0 - CTA177 Variable WORD System Status WORD Variable WORD System Status WORD Input BIT X0 - X777 Output BIT Y0 - Y777 Variable BIT CO - C1777 Stage Status BIT SO - S1777 Timer Status BIT TO - T377 Counter Status BIT CT0-CT177 System Status BIT SP0- SP777 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 Global Range 00000 - 07679 V0 - V377 V1000 - Vl177 V1400 - V7377 V7400 - V7777 V10000- V17777 V37000- V37777 V40400 - V40437 V40500 - V40537 V40600 - V40677 V41000 - V41077 V41100 - V41117 V41140-V41147 V41200 - V41237 Addresses for Nicknames V Bit Range Range BOO - B377.15 B1000.0 - B1177.15 V1400 - V7377 B1400,0 - B7377.15 V7400 - V7777 B74C)0.0 - B7777.15 V10000- V17777 BI0000.0- B17777.15 V37000- V37777 B37000,0- B37777,15 VX0 - VX760 B40400,0 - B40437.15 VY0 - VY760 B40500.0 - B40537.15 VC0 - VC1760 B40600.0 - B40677.15 VS0 - VS1760 B41000.0 - B41077.15 VT0 - VT360 B41100.0 - B41117.15 VCT0-VCT160 B41140.0-B41147.15 VSP0- VSP760 B41200.0- B41237.15 Pointer Range PTA0 - PTA377 PCTA0 - PCTA177 P1400 - P7377 P7400 - P7777 P10000- P17777 P37000- P37777 Pointer to Bit Range

PB0.0 - PB377,1 PB1000.0 - PB1 PB1400.0 - PB7 PB7400.0 - PB7 PB10000.0 PB17777.15 PB37000,0- PB3

1.10. Mapping PLC I/O


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. Press and the following screen will appear.

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. Address Red Pushbutton X Yellow Pushbutton X Green Pushbutton X White Pushbutton X Nickname Red Light Yellow Light Green Light White Light Address Y Y Y Y Nickname

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

2.

Direct Logic 205

Lab Exercise #2 - I/O Logic and Analog Card

2.1. Ladder Logic


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.

2.2. Single Rung


Logic Table - Light is ON when switch is closed.

Single Line Diagram PB1 0 1 Truth Table LT1 0 1 PB1 LT1

()
(END)

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 Check code for Syntax errors Change PLC Mode System Information

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

2.3. OR Rung
Logic Table - Light is ON when either switch is closed.

OR Diagram

()
(END)
Truth Table

2.4. AND Rung


Logic Table - Light ON when both switches are closed.

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

2.6. Simple Motor Starter Rung


Logic Table - Start Pushbutton energizes the output which stays ON until the Stop Pushbutton is pushed (recommend the REDPB for the stop pushbutton).

Motor Starter Diagram

()
(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

2.8. 3-way Switch Rung


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

2.9. The Challenger


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)
2.10. Analog Input/Output Module Specifications
The F2-4AD2DA Analog Input/Output module provides several hardware features: _ On-board 250 ohm, 1/2 watt precision resistors provide substantial over-current-protection for 420mA current loops. _ Analog inputs and outputs are optically isolated from the PLC logic. _ The module has a removable terminal block so the module can be easily removed or changed without disconnecting the wiring. _ With a DL250 CPU, you can update all input and output channels in one scan. _ On-board active analog filtering and RISC-like microcontroller provide digital signal processing to maintain precision analog measurements in noisy environments. _ Low-power CMOS design requires less than 80mA from an external 1826.4 VDC power supply. 4-Ch. In / 2-Ch. Out The following tables provide the specifications for the F2-4AD2DA Analog Input/Output Module: Number of Input Channels 4, single ended (one common) Range 4 to 20 mA current Resolution 12 bit (1 in 4096) Input Impedance 250 1%, 1/2W, 25ppm/C current input resistance Maximum Continuous Overload 40 mA, each current input Input Stability 1 count Crosstalk 70 dB, 1 count maximum Common Mode Rejection 50 dB at 800 Hz Active Low-Pass Filter 3 dB at 50Hz, 2 poles (12 dB per octave) Step Response 10 mS to 95% Full Scale Calibration Error 12 counts maximum, at 20 mA current input Offset Calibration Error 8 counts maximum, at 4 mA current input Maximum Input Inaccuracy 0.3% @ 25C (77F) 0.45% @ 0 to 60C (32 to 140F) Number of Output Channels 2 single ended (one common) 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 1830VDC, 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% @ 25C (77F) 0.3% @ 0 to 60C (32 to 140F) 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

2.11. Analog Module Operation


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). Input channel assignment: Minimum channel value: Channel Nickname assigned Data address: Maximum channel value:

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:

these terminals are connected to one of the two analog output from the module. Note the meter should read either 4ma or 1 volt dc. Press and set the element to the first output address that you pointed to in the rungs you entered to setup the analog module. In this example V2004. Now enter 4095 into New and the write this to the PLC by pressing . If the multimeter reads 20ma or 5 volts DC then this is the active channel. If no then change the address to next address, for example V2005 and repeat sending 4095 to the channel.

Output channel assignment: Minimum channel value: Channel Nickname assigned

Data address: Maximum channel value:

21

3.

Direct Logic 205

Lab Exercise #3 - Operator Interface OP 1500 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.

3.2. Optimation Panel Configuration


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.

3.3. Operator Panel Memory Map

23

Direct Logic 205

Enter nicknames for the addresses associated with the operator panel. V1400 - Line1 V1401 - Line2 V1402 - Line1Data V1403 - Line1DP V1404 - Line2Data V1405 - Line2DP B1406.0 - F1 B1407.0 - L1 B1406.1 - F2 B1407.1 - L2 B1406.2 - F3 B1407.2 - L3 B1406.3 - F4 B1407.3 - LF1 B1406.4 - F5 B1407.4 - LF2 B1406.5 - DA B1407.5 - LF3 B1406.9 - EN B1406.9 - DAK B1406.10 - UP B1406.9 - BEEPOFF B1406.11 - DN

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.

Lab Exercise #4 - PID Loops 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 cant 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.

Lab Exercise #5 - The Drum Sequencer 5.1. Introduction

The drum sequencer is a box instruction that has four configurations that simulate an electromechanical 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. 1) 2) 3) 4) Current step counts Timer value Points to the preset step Points to the current step

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 + 10F) delivered at 40 gallons per minute and cold (60 + 5F) 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. Water Step Level 1 Flush H 2 Wash L 3 Drain 4 Wash L 5 Drain 6 Wash L 7 Drain 7 Rinse H 8 Drain 9 Spin - L 10 Rinse H 11 Drain 12 Rinse L 13 Drain 14 Spin - L 15 Spin -H Temp (F) White Color PermPress 80 65 65 120 80 65 120 120 100 80 80 80 80 80 65 80 80 80 65 Product Amount (oz.) Time (Min) White Color PermPress White Color PermPress 3 3 3 S-80 S-65 S-60 7 7 4 2 2 2 S-30 S-30 S-30 5 5 4 2 2 2 S-15, B-45 4 2 5 5 3.5 2 2 2 2 2 2 3 3 3 2 2 2 SS-70 SS-50 SS-45 5 5 5 2 2 2 4 4 3 8 8 8

33

You might also like