2 file · web viewin figure 2.3r is a rung with a counter numbered as c12:2. this caused the...

14

Click here to load reader

Upload: trinhlien

Post on 01-Oct-2018

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 2 file · Web viewIn figure 2.3r is a rung with a counter numbered as C12:2. This caused the RSLogix software to create a new counter file C12. Figure 2.3r: New Counter in File 12

Data and Program Control Programmable LogicControllers

2.3.5 Exploration: Counters

The counter circuit is designed to allow the PLC to keep track of how many times and event has occurred. The PLC has two types of counter a count up counter, CTU, and a count down counter, CTD. Figure 2.3n shows the symbol used in the

Allan Bradley 500 and 1500 series. In the figure the counter number is C5:2 The C refers to the counter function, the 5 is the file number in the Allan Bradley system, and the number 2 refers to the specific counter of the 84 counters available.

Figure 2.3n: CTU counter

Program the ladder diagram in figure 2.3o into your PLC and Counter behavior. The table below is provided to record your observations.

Figure 2.3o: The Up-counter

Page 1

Page 2: 2 file · Web viewIn figure 2.3r is a rung with a counter numbered as C12:2. This caused the RSLogix software to create a new counter file C12. Figure 2.3r: New Counter in File 12

Data and Program Control Programmable LogicControllers

Item Description of Action or BehaviorCounter Number

Preset Value

AccumulatorActionCU Bit Behavior

DN Behavior

Reset Action

Table 2.3B: The Up-Counter

Questions:1. Double click the C5 file. What are the bits that you can monitor from this file? How do the file values change as you press the input button?

2. The counter has a preset of 5. Is it possible for the counter to count numbers larger than the preset?

3. Change the counter number to C5:12. Examine the C5 files (double click C5 folder) and describe how many counters the file holds.

4. Does the counter change number as the button is pressed or as it is released?

The count down counter, CTD, will count from zero down. The accumulator will register negative numbers. Again when the preset and accumulator are equal the Done bit will register. One primary use of the down counter is in conjunction with the up-counter. By using the same counter number for both an up and down counter it is possible to keep track of the number of parts on a conveyor or the number of people in a room. For example, a museum has a special display, but room for only five to view it at a time, figure 2.3p. Turnstiles at the entrance and exit of the room are set as input switches. When the count reaches five the Output locks the Entrance turnstile so no more can enter. In figure 2.3q is a program to carry out an occupancy counter operation. The preset is set at 5. Program this into your PLC and describe its operation.

Page 2

Page 3: 2 file · Web viewIn figure 2.3r is a rung with a counter numbered as C12:2. This caused the RSLogix software to create a new counter file C12. Figure 2.3r: New Counter in File 12

Data and Program Control Programmable LogicControllers

Figure 2.3p: The Museum Problem

Figure 2.3q: Up-Down Counter

Questions5. What function does the XIC labeled C5:2/DN perform in this ladder program?

6. Describe how the DN bit action is different in the CTU and CTD versus the TON.

Page 3

Page 4: 2 file · Web viewIn figure 2.3r is a rung with a counter numbered as C12:2. This caused the RSLogix software to create a new counter file C12. Figure 2.3r: New Counter in File 12

Data and Program Control Programmable LogicControllers

2.3.6 Dialog

There can be as many counters as the memory of the PLC will allow. The C5 file will hold 84 files. The RSLogix software will adjust the number of counters based on the counter number used. If additional files are needed any file number above 8 can be designated for counters. Each counter can count to a total of +32,767 or -32,768. This is also the maximum value in the accumulator of the timers. In figure 2.3r is a rung with a counter numbered as C12:2. This caused the RSLogix software to create a new counter file C12.

Figure 2.3r: New Counter in File 12

In figure 2.3s the files menu shows the new C12 at the bottom of the list. The contents of both the normal C5 file and the new C12 file are shown here as well. Although we created C12:2, the software built all counters up to the number 2 counter automatically. This demonstrates one of the great advantages of the PLC over the older systems of individual and mechanical timers. If we need additional counters (or timers), they can be created easily.

The maximum count of 32,767 may be seen as a limitation. However, it is possible to cascade the counters. This is a process of using two or more counters together. When counter one reaches its total the DN bit is input to the second counter. This second counter then counts the number of times the first has reached a total. For example, if the first counter is counting the number of items being place in a carton by a packaging process, say 12 to a carton, the second would keep track of the number of dozen items packaged or number of cartons.

The final example of the counters is to change the counter value "on-the-fly". There may be times when the same operation could be used for two or more functions. For example, a packaging line is designed to put 10 objects in a box. However, marketing has said that a large number of customers would like the objects packed 20 to a box. This would require us to stop the program, key in the new value to the preset of the counter and restart the process. A complex operation for the operator, and exposes the program to tampering.

Page 4

Page 5: 2 file · Web viewIn figure 2.3r is a rung with a counter numbered as C12:2. This caused the RSLogix software to create a new counter file C12. Figure 2.3r: New Counter in File 12

Data and Program Control Programmable LogicControllers

Figure 2.3s: File Menus and Contents of Counter files

The MOV instruction allows us to use a toggle switch on the control panel to select 10 or 20 items per box as part of the run time setup. In figure 2.3t is a section of a ladder program to allow a single counter to respond to two different Preset values. The MOV instructions take the source value, here the constant 10 or 20, and move it into the Preset of the C12:2 counter. A toggle switch is used her so the in one position the switch selects 10 items and the other position selects 20. the source could also be another file item. It is necessary when setting up the MOV to enter the source value and destination, the first and third item. The second and fourth entry of the MOV instruction is made by the RSLogix software and relates to the values in the destination file.

Page 5

Page 6: 2 file · Web viewIn figure 2.3r is a rung with a counter numbered as C12:2. This caused the RSLogix software to create a new counter file C12. Figure 2.3r: New Counter in File 12

Data and Program Control Programmable LogicControllers

Figure 2.3t: Example of MOV instruction

2.3.7 Application

Returning to our Vat Mixing Process, the product engineer has developed a new manufacturing sequence to again increase the quality of our product. The operators have been a bit careless at starting the Compound B and C input. This has slowed down the overall process time. He desires to have only a single start pushbutton and everything after that to be controlled by timers. When the mixing is finished the discharge valve will be opened automatically to send the product to the next stage of manufacturing. A cycle light will signal the operator that it is OK to start a new batch. An emergency stop button is provided in case the process must be shut down quickly.

He has provided you with an initial ladder logic program that, he believes, will accomplish the task. You job is to

1) Use a project Planning Sheet to analyze the program and establish a wiring diagram and a timing chart of the event.

2) Test the program.3) Implement two new operations on the ladder program to count five batch

cycles and signal the operator to refill the compound tanks.4) Implement a counter to keep track of the total number of batches run in a

shift.You may refer to the prior applications for picture, etc of the vat process.

Page 6

Page 7: 2 file · Web viewIn figure 2.3r is a rung with a counter numbered as C12:2. This caused the RSLogix software to create a new counter file C12. Figure 2.3r: New Counter in File 12

Data and Program Control Programmable LogicControllers

Figure 2.3u: Ladder Program for Improved Vat Mixing

Page 7

Page 8: 2 file · Web viewIn figure 2.3r is a rung with a counter numbered as C12:2. This caused the RSLogix software to create a new counter file C12. Figure 2.3r: New Counter in File 12

Data and Program Control Programmable LogicControllers

2.3.8 Dialog - Project Reporting

In the previous application you carried out an extensive amount of work. Testing of some one else's ideas, adding and modifying existing programs, and defining the wiring, switches and outputs to be used. But, does anyone other than you know what was done? Until the work has been documented, drawings filed, and all changes recorded the job is not complete. In industry record keeping of your control systems may be a matter of safety.

In the school situation reports may be the basis of judging your work for purposes of grading. Even in industry raises, bonuses, and promotions will be based on the quality of your work. Industry and business routinely list writing skills as an important skill for their engineering staff. In approaching the task of writing a report many students (and graduate engineers) appear at a loss of where to begin. Having a well defined process that can be applied to any reporting situation can give you a place to start. The Project Report will have five parts. Each part serves a specific purpose.

1) Cover Page2) Purpose3) Procedure4) Data5) Conclusion

The Cover Page should have the title of the project centered on the page. No fancy pictures or drawings are necessary. On the lower left quarter of the page should be the names of all who worked on the project. This may be lab partners or colleagues. If this was a solo project then no names are needed. Under this would be your name as the author of the report. On the right side of the bottom quarter of the page should be the date the work was done and the due date of the report. Figure 2.3v is a sample of a Cover Page. It is straight forward and "down to business".

The Purpose section should tell the reader why and what was done. It should be at least 15 sentences and no less than 1/2 typed page. If any theory is critical to understanding the report or conclusions it should be summarized in this section.

The Procedure section should have a detailed description of what was done to solve the problem. Wiring diagrams, flowcharts, and program listings, all should be here. This section may be the largest in the report with many attachments. Drawings, listing, etc. can be attached and referred to by figure number or as an appendix to the report. If there are any calculations used to arrive at the design, samples of the calculations should be included.

Page 8

Page 9: 2 file · Web viewIn figure 2.3r is a rung with a counter numbered as C12:2. This caused the RSLogix software to create a new counter file C12. Figure 2.3r: New Counter in File 12

Data and Program Control Programmable LogicControllers

The Three Compound Vat Mix System

Work Performed by:P. CunninghamW. ErevellesA. SimonsR. Morris

Work Done:January 7, 2004

Report written by:R. Morris

Report Date:January 15, 2004

Figure 2.3v: The Report Cover Sheet

Page 9

Page 10: 2 file · Web viewIn figure 2.3r is a rung with a counter numbered as C12:2. This caused the RSLogix software to create a new counter file C12. Figure 2.3r: New Counter in File 12

Data and Program Control Programmable LogicControllers

The Data section contains the items that resulted from the project or experiment. Charts, graphs, data values, calculations or program printouts that resulted from the execution of the procedures should be documented here.

The Conclusion section is the location of the report where the results from the data section are compared to the intended purpose of the project. Was the project successful? Did the data agree with the anticipated purpose. There may be reference in this section to limitations or changes that may be needed. The final sentence should be a strong conclusive statement on the project. It is you last chance to make an impression.

With the ready access of computers and programs like Microsoft Word, all reports should be typed. Don't use a unique or fancy font for the report it will distract from the work. No more that two or three fonts or two or three sizes should be seen in the total report. With spell check, there is also no excuse for a misspelled word. Typical type fonts that are easy to read are Times New Roman, Ariel, or Currier. Always use 12 point size font for the body of the report. Unless specified by school or company policy you can use the MSWord defaults of 1-1/4 inch left and right margins with 1 inch top and bottom margins. Use page numbers as needed.

2.3.9 Application - Project Reporting

The project for the Three Compound Vat Mixing System is very complex. Review the work done on this project. If you have sufficient notes you should be able to write a formal report following the guidelines above. If you did not keep good notes, you may need to rework parts of the project. Write a complete report on the final vat system, and turn in to your instructor for scoring.

Page 10