You are on page 1of 23
UNIT 18 INSTRUCTOR'S MANUAL, OUTPUT SEQUENCING Output sequencing requires a great deal more paperwork than other types of programming. Be sure to allow the students ample time to complete the program design and entry in the Experiment, You may ‘want to plan on two instructional sessions for this unit. ‘To understand how the sequencer is more efficient than cascading timers, this is a sequencer program to replace the cascading timers program used in Unit 15. While the sequencer may take a litle more ‘ime to plan and program, it uses only one relay within the PLC. This ‘means thatthe remaining relays can be used to control other parts of a large program. UNITi8 OUTPUT SEQUENCING biectives ‘Upon completion ofthis unit the student wil be able to: 1. Explain the operation of an output sequencer. 2 Explain the difference between a time driven sequencer and an event driven sequencer 3, Weitea program using an event driven sequencer. 4. Writea program using atime driven sequencer. 5. Bstersequencer programs into the PLC, In previous units cascading timers were used to control sequences of outputs This programming strategy required the use of many timers. limited how many timers could be used elsewhere in the program. To overcome these limitations of cascading timers, the sequencer function was developed. ‘The sequencer is special relay function which has many cascaded timers or ‘counters within a single relay element. It allows the PLC usrto activate output elements, in spocified series at predetermined time intervals or after 8 eset umber of events. A typical equencer may have up to 100 steps and ean cont at least six outputs. A specialized addressing system i used and willbe discused in the keystroke sections. ‘There are two basic types of sequencers Time driven sequencers use preset ime interval to control when outputs are activated and de-ativated. Like cascading timers ‘which reset, a time driven sequencer program runs continously until the controling, input is tumed off. A time-driven sequencer operates similarly to @ mechanical drum sete that increments automatically at a preset ime period Event driven sequencers can be thought of as cascading counters. Similar to a counter, taming the controling input on and off preset numberof times increments the sequencer to the next step in its internal series. An eventdriven sequencer operates similarly to-a mechanical stepper switch that increments one step foreach pulse applied toit 1 ‘The use of soquencers greatly simplifies the ladder loge digrama, Instead of 104 sung representing the 104 steps inthe sequencer, one rung is used (see Figure 18-1). oo [assem Looe an Figure 18-1 Output Sequencer Rung All ofthe commands are steps within the sequencer itself. They donot need to be represented on the nung. However, the exact operation of the sequencer must be programmed, A sequencer programming, chart contains the information conczming futputs and time delays or event counts. A sequencer programming chart is shown in Figure 18-2. Procedures for coding the sequencer program and entering it to the PLC vill be covered inthe keystroke section To program a sequencer, instructions take the form of a single high level instruction, a memory location is designated within the PLC that forms the desired pater ofthe outputs during the programmed sequence. ‘When 1 sequencer operates on a entire output word, there may be outputs associated with the word that do not need to be controled by the Sequencer. They could Se used eleewhere inthe program, ‘To prevent the sequencer from controlling these bits of the output word, 2 mask word is used. ‘The use of a mask word is illustrated in Figure 18-2. The mask word selectively sereens out the data from the sequencer word file tothe output word. In thi sxample, for each bit of output word 050 that the sequencer ie to contol, the sorresponding bit of mate word O40 must beset to 1. All ater bits of output word 050 are set to 0 and can be used independently ofthe sequencer. The advantage of sequencer programming over conventional programming is the significant savings of memory words. Typically the sequencer program does in 20 words corlese what e standard program does in 100 words or more. 6s M4132 9 87 6 5 4 Workoso Jo To Jo To Joo Jo Jofo folo Jo [o]o [oo] Output Wort 040 ToTo[o-fo-f1 to fo fifi oloti [i foo} [Mask Wont 060 [o[o[o-[o [1 [o fo Jolo fofo fo [olo lotr] step Wordosi fo [oto-fo tito fo Joli fofo[o[o]o[»|1| step? ‘Word 062 [0 fo [o fo [o[o{o |i fo fofo{o [1 {0 ]0{0| steps Word 063 [0 To foto To foto Tro foto ti fr foto tolsteps Figure 18-2 Use of a Mask Word Sequencers may also be used to control the onder in which the PLC responds to ‘input elements. Input sequencers are beyond the soope of the unit. All discussions of input Sequencing is reserved for advanced PLC programming techniques. Programming Kevstrokes ‘There are types of sequencers in the Allen-Rradley Micrl agi Controller 1. Sequencer Output -($Q0)-- 2 Sequencer Compare ~{ SOC )~ 3. Sequencer Load ~( SQL)= ‘The output sequencers operate as described, They are addressed with the numbers # B3:0/0 to # BHOG1 or # N70 to # 7/103, All ouput sequencer ‘programming depends upon conversion of binary numbers to hexadecimal numbers, as you did in Unit 4, If you need to review the conversion method. The rest ofthis unit willbe easier to understand if you are sure of your conversions. ental Output (St 1d Sequential Compare (5 ‘These instructions wansfer 16-bit data to word addresses for the control of sequential machine operations. Entering Parameters Ener the following parameters when programming thes instructions: 1+ File is the address of the sequencer file, You must use the file indicator for this suddess. (Computer) Sequencer file data is used as follows: Tastruction_[ Sequencer Fle Sores 'SQ0 ata controlling outputs SOC Reference data for moniioring inputs ‘+ Mask ($Q0, $QC) is 2 hexadecimal code or the address of the mask word oF file ‘through which the instruction moves data. Set mask bits to pase data and clear mask Dits to prevent the instruction from operating or coresponding destination bits. Use & ask word of file if you want to change the mask according to application requirements. Ifthe mask isa file its length will equal to the length ofthe sequencer file The two files track automaticaly *+ Source isthe address ofthe input word or file for a SQC ftom which the instruction ‘obtains data for comparison to its sequencer fle. ‘+ Destination i the addres ofthe output word or file fora SQO to which the instruction moves data from it sequencer file Important: You can addcest the mask, souree or destination ofa sequencer ‘instruction a8 word or file. Ifyou address ita file (using file indicator #), instruction automatically steps through the souree, mask or destination fle. the Control (SQO, $QC) is the contol strusture that stores the status byte of the instruction, the length of the sequencer file and the curret position inthe fle. You should not use the contol address for any other instruction 184 1s 13_ 08. 0 Word0 [ENDNER—FD. Word! [Length of sequencer Sie Word2 [Position 1 bi inde theo > Found bit FD (bit 08)- SQC only. When the status of all non-masked bts inthe source address match those of the comesponding reference word, the FD bit is set. ‘This biti assessed each time the SQC instruction is evaluated while the rang is nue > Err bit ER (bit 11) is et when the controller detects a negative position value or 4 negative while the rang is tue. > Done Bit DN (bit 13) is set by the SQO or SQC instruction afer it has operated on the last word in the sequencer file. It is reset on next filse-to-tne ung transition after the rung goes false. > Enable EN (bit 15) eset bya false-tosrue-rung transition and indieates the SQO ‘or SQC instruction is enabled + Length is the number of steps of the sequencer file staring at position 1. The ‘maximum number you enter is 104 words. Position O is the startup position. ‘The instruction resets (raps) to position | at each eyele completion. Position isthe word lecation or step in the sequencer fle fom or to which the instruction moves data. A postion value that points pat the end of the programmed file causes «runtime eror. Usine SOO ‘This output instruction steps through the sequencer file whose bits have been set to control various ouput deviees. \Whea the rung goes from fals-to-truc, the instruction increments tothe nest step (word) in the sequencer file. Data sored there ie transferred through mask to the | Figure 18-6 (uipat Sequencer with reset and Cycle Count 1813 ‘The MicroLogix 1000 is an event driven sequencer. Time sensitive events can be executed by using the done bit of a timer ar the tigger event for the sequencer Unfortunately this creates a condition where cach time eyee is constrained tothe time of the shores event. As an example ifit takes one second fo a robot gripper to close, but three seconds for the arm to rotate Between postions, the programmer would need to sllow one eyele forthe gripper event, but three cycles for the rotational event. An ‘example ofthis is provided below. Notice thatthe mask for an event will stay the same for several steps before changing, In this case the gripper event is assigned a mask of (100, andthe rotational event is asigned a mask of 0001. Sept 000 000. ‘D000 0000 1000) Step? ‘00- ‘0000- ‘0000 ‘0000 1001, ‘Step 3 ‘0. (000- ‘0000. ‘000 1001 ‘Sep 4 ‘000- (000000001 ‘0000 [__10or Table 183 ‘Time Driven Sequencer Table Monitoring Output Seavencers ‘Ousput sequencers are monitored in much the same way at timers and counters, Once the element is located use the arrow keys to access sequencer data and steps. Each step i identified and must be monitored separately EXPERIMENT Purpose “To design, enter and run an output sequencing program. Procedure 1, Im Unit 15 you used cascading timers to control a robot arm. You will now develop a program to control the same robot arm using output sequencing First, carefully review the time listing forthe arm (Table 15-4, Page 15-12). ‘Alto, «program tn contol the tame rt ar sing est anquencing. wet ‘The motions of the robot arm will now be controlled as in Table 18-1, The robot's ome position is up, arm in and let, with the gripper open ‘Quipat ON | Maton 0:00 [Arm out (0:02 | Arm down (0.0/4 | Gripper close ‘0-05 | Arm sight, ‘Table 18-1 Outputs Controlling Robot Arm Motions Refer to Tables 15-4 and 18-1 as you work. Design the sequencer portion ofthe ‘rogram to contol the arm, Keep the exact same motion sequence asin Unit 15. Draw the ladder logic diagram forthe entire sequencer program. Input I-00 must, sctivate the sequencer, latching it on. Input O/T must rest the sequencer. Input THO? should be used to stop the sequencer Lge oe Ee efan Ll) bi aa ‘ : ee ( Relay addresses may vary within their acceptable ranges) 1845 4, The motions ofthe robot am wil be controlled inthe Data File The Data fe is located on the left side of the sereen in the Project tee. Under the Data Files select BS ~ BINARY. The Data File Bi (bi) - BINARY window will show the ‘ops of the sequencer. Refer to Figure 18-7. Turning on the outputs can be sccomplished by changing 2 00 1 oF 1 to 0. In stp 2 (822) output #2 turns on In step 3 (23:3) output #2 i off and output #8 turns on Saree eater 3 cowie f crvate rope roc Se {ocnaraen Fe ore ongrsn ator Ca horenten 3G oer {By Cross Reference B oo-cumer Dranr D sass D Dite-mer 1 cs-coune Drs-comret Dw -necen feos Dooce Drown 52 cotendun tos cove vane a concent ‘races tone some 5. As you di in Unit 15, use lights to represent the tree arm motions and the tipper (ete Table 18-2) [Output [ight (0:00 [Red 0:02 | Yellow (0:04 —| Green, (0:05 | White Table 18-2 Simulation Outputs 1e16 Use the two normally open momentary switches and one normally open maintain switches to contol the sequencer's operation. Make all of the necessary connections. Identify the switch to be used with each input element: 100 Either normally pen momentary switch, b. LQ Theother normally epen momentary switch © 1402 Either normally en maintain switch 6. _Enterand test your sequencer program. ‘What wll happen when you activate input 0/1 Inia the input 1.0/1 wail unlatch the sequencer. The scovencer will rest 1 7. Test the operation of input 10/1 and make sure your explanation in step $i comect. 8 Monitor the sequencer at ie step 5. When the sequencer iz executing Step 5, energize input 1:0/2. What happens to the sequencer? ‘The sequencer stops at ite step $. Outputs are held on an setin step 5, 18.17 9. 10 nL Restart the sequencer 2 Record thestep on which the sequencer begins operation _8. 1b, What mustyou do to stp the sequencer mid-cycle and then restart it at the ‘beginning of ts cycle? First actiate input [:022 to stop the sequencer. Next activate and deactivate input tivate input L002 to resart the sequencer, Test your answer to Step 85 Enter the program and pat the controller in RUN mode. Access File #B3:0 so that you ean modify it. In binary, the modifications willbe: 3:0 0000 0000 0000 0000 83:1. 0000 0000 0000 0000 'B 3:2 0000 0000 0000 0001 'B 3:3 0000.0000 0000 0010 'B 34 0000 0000 0000 0100 3:5 0000 0000 0000 1000 ‘This bit configuration sets up the sequencer to pass one dough temas rele 12, Access Element B3 and prepare to modify it ‘4. What would happen if B3:6remgined at its current value? Note its Tpexadecimal mask value. . roweh th would not be activated. ', What should the hexadecimal mask be if you want to use outputs O: 2/0 through 0-2/5 ? Show the mask in 16 bit binary as wel, ‘003-0000 0000 0011 1411 ‘Modify the mask value to O00Fb. Describe what happens tothe outputs? Outputs 4 and 4 are masked o m 13. When you are comfortable withthe sequence’s operation, put aside the hardware, ‘Then answer the Questions below. Questions 1, Whatadvantages does a sequencer have over cascading timers? 7 man» timers which mieht be needed elsewhere i program 2. What are some important considerations when programming an SQC instruction? vent driven or time driven ‘Bxaot mask requiremenss; Length must be one longer than numberof bls to be sequenced: in which ouputs are o operate 1.19 (Can step data be changed while a sequencer is running? es Why is it necessary to mask unused outputs in a sequencer group ? unused outputs are not masked inthe sequencer, they cannot he uted anywhere lsein the program while the sequencer in operation, low ave Fle and Mack weed ina sequencer? Ele identifies which bits re held rue at each step in che sequence, This x determined by the conversion of outputs o be activated at each step. The mask is 16 precise le: 1 18.20 UNIT 19 INSTRUCTOR'S MANUAL SHIFT REGISTERS Shift registers are a complex function of the PLC. Sequencers are ‘combined with the use of zone control relays to make a shift register operational. Different programming strategies are used for sequencers which operate in conjunction with shift registers. These should be covered with great care before the students are asked to complete the Experiment. ‘The Experiment gives the students the opportunity to test shift register operation. It also provides experience in both let type and right type registers. Make certain the students understand the differences in the set and shift inputs, Note that the solution to Question 2 in the Questions excludes part of, the problem program. You may have to review the use of relay addresses with the students if they have incorrect answers to the problem.

You might also like