Vous êtes sur la page 1sur 7

Geanna Bowers ET 194-01 Lab 9 LAB 9 SEQUENCING AND REGISTERS IN THE PLC 5

ABSTRACT: The purpose of this lab is to become familiar with programming PLC (Programmable Logic Controllers) Sequencing and Registers. In this experiment the PLC 5 system is used. While there are many different kinds of PLCs and a vast number of programming possibilities with those PLCs, registers and sequencing are very commonly used in todays industrial environment. Learning how they work and being able to program them is a very useful skill to have when going into the Engineering Technology line of work.

INTRODUCTION: This experiment explores how the PLC sequencer and register functions operate. Our textbook states that the sequencer instruction evolved from the mechanical drum switch and it can handle complex sequencing control problems more easily than does the drum switch, and that registers are often used to track parts on automated manufacturing lines by shifting either status or values through data files. Programmed sequencers can perform the same specific on or off patterns of outputs that are continuously repeated with a drum switch, but are much more flexible and allow you to simplify your ladder logic. To program a sequencer, binary information is first entered into the sequencer file or register made up of a series of consecutive memory words. The sequencer file is typically a bit file that contains one bit file word representing the output action required for each step of the sequence.

EQUIPMENT: (1) PLC 5 Machine (1) Desktop computer for programming (1) RSLogix5 Computer program also for programming

Geanna Bowers ET 194-01 Lab 9 BACKGROUND: 3. Ensure that SW1 is off (not activated), then download and run the program. What do you see? What in the program is causing that effect? All lights are on when the program is first started. This is being caused by T4:0 not being DN, so it will not start timing. Also with the bit file it only does position 0 when the program first starts, and once the program advances it never goes back to that position. 4. Turn SW1 on. What do you see? What in the program is causing that effect? The lights go from left to right being lit momentarily then going back off in order. This is caused by the shift register programmed into the SQO. They start over every time the TON reaches its preset value. 5. Turn SW1 off. What do you see? What in the program is causing that effect? When SW1 is turned off the lights are lit at whatever stage the shift register was at because it is a retentive operation and when the power is lost it stays where it was. When power comes back on it starts where the program left off at. 6. Initially all the lamps were lit. With SW1 on, when are all the lamps on again? Never because the only time they are all on is at the original startup of the program. Once the program starts cycling through the positions in the shift register bit file, it never goes back to position 0 which is the only one that has all the lamps on at the same time. 8. For each step number (current position value in R6), specify the output that is displayed and the input required to advance past the step. a. Step 1: The PB lamps 2, 3, and 4 are on and the 1st lamp is on, and to advance the program SW1 has to be on and PB3 has to be pressed. b. Step 2: PB lamps 3 and 4 are on and lamps 1 and 2 are on; to advance the program SW1 and SW2 have to be on plus PB 4 has to be pressed. c. Step 3: PB lamp 4 is on and lamps 1, 2, 3, and 4 are on; to advance the program SW1, SW2, and SW3 have to be on and PB2 has to be pressed. d. Step 4: All 4 PB lamps are on and all 4 lamps are off; to advance the program SW1, SW2, SW3, and SW4 have to be on and PB1 and PB3 have to be pressed. 10. Based on this ladder, explain the purpose of the TON timer and what impact it has on the BSL instruction. The timer sets how quickly the lamps light. They start lighting at PB1 lamp and finish with lamp 4. The timer also sets how long it takes the register to complete a cycle with the BSL instruction.

Geanna Bowers ET 194-01 Lab 9 11. What data is shifted (or input) into the shift register? Where does it come from? A bit with the value of 1 to turn the lamp on is what is shifted into the register, and it comes from the step before it and shifts all the way through the register from PB1 lamp through lamp 4. 14. Explain what BTN1 and BTN2 do in the program. PB1 loads the data bits in and PB2 unloads the data bits. The first bit in is the first bit that goes back out. PB lamps 2 and 4 are on and lamp 1 is on. 15. Press BTN2 a second time. What happens? Why? Everything goes off because B3:0 is all 0s and the bit that went in was a 1 but it went back out so everything is off. 17. Indicate which lights are on after the following button presses. a. After BTN2 pressed the first time: PB lamp 4 and lamp 1 are both on. b. After BTN2 pressed the second time: PB lamp 3 and lamp 1 are both on. c. After BTN2 pressed the third time: PB lamp 2 and lamp 1 are both on. d. After BTN2 pressed the fourth time: PB lamp 1 and lamp 1 are both on. e. After BTN2 pressed the fifth time: All PB and regular lamps are off. 18. Does the fifth button press match the fifth input in step 16e? Why or why not? Yes because BTN1 is only putting in inputs, it doesnt make outputs show up. BTN2 makes the inputs show up as outputs and step 5 is all 0s. PROCEDURE:

1. The first thing one will need to do is create a new program in the RSLogix5 Program on the computer. The name of our program is GNBK, appropriately named for the group members involved.

2. Rung 0000 - The first input instruction in our ladder logic program is an XIC (Examine If Closed) instruction (Switch 1 or SW1) that allows the first rung to be energized. This instruction has the address of I:4/0 and is simply a switch that when

Geanna Bowers ET 194-01 Lab 9 turned on starts the output instructions of the timer. On the opposite side of this rung the output instruction is a RTO (Retentive Timer On) instruction that will count whenever Switch 1 is on. Its address within the program is T4:1, its time base is set at 1.0 which means it times in increments of 1 second, it has a preset value of 15 which allows the timer to time for 15 seconds, and the accumulated value is how much time has elapsed since the EN (Enabled) bit of the timer was energized when the switch was turned on. We used an RTO so that if power is lost to the PLC during its operation or the switch is turned off the accumulated value of the timer would start back up at the same value it was at when the power failure occurred or if SW1 was turned off. Also when the RTO reaches an accumulated value of 15 seconds, it resets and starts counting at zero again.

3. Rung 0001 - On our second rung of our ladder logic program, our first input instruction is the same as the first ladder an XIC with SW1. It is used here so that when Switch 1 is turned on it also energizes the second rung. The second input is an XIO (Examine If Open) instruction with the address of T4:0/DN which is the DN (Done) bit of the output on this rung. The second input is in series with the first so that both conditions have to be met for this rung to be energized. The output on this rung is a TON (Timer-On Delay) with an address of T4:0. Its time base is also 1.0. It has a preset of 3 seconds, and each time the accumulated value reaches the preset of 3, the DN bit of the timer is set, and the timer is reset to zero. This occurs because of the second input instruction on this rung, by programming the DN bit in this manner, it resets the timer. We used this timer so that when programmed with the SQO in the third rung it would count in increments of 3 seconds to allow our lamp outputs to be lit for three seconds each according to the bit file which is discussed later in this report.

4. Rung 0002 Our third rung has the same input instruction as the second input on the previous rung. This allows this rung to be energized when the TON has reached the preset value of 3. The output on this rung is a SQO (Sequencer Output) instruction that operates from a file containing a register with bits in it. The File address that it uses is #B3:0, it has a mask of 0FFH which is hexadecimal indicated by the H at the end and stands for the binary word 0000 1111 1111. Anywhere there is a 0 in the word the SQO ignores what is listed in the File word it is reading, and when it is a 1 it allows the value in the word from the file to be read whether it is a 1 or a 0. The SQO has a Destination address of O:6 which is where it stores the output values, it has a Control address of R6:0 which is the control for this program, a Length value of 4 which means it looks at 4 words in the file and then starts back with the first word,

Geanna Bowers ET 194-01 Lab 9 and then the Position is which word the SQO is currently looking at. For example, the first word in the file is Position 0, and the next word is Position 1 and so on. The SQO starts with Position 0 when the program is initialized before SW1 is turned on, and then repeatedly cycles through Positions 1, 2, 3, and 4. The 0s and 1s in the File are representing 4 lamps that will light according to a 0 being the lamp off, and a 1 being the lamp on.

5. The #B3:0 is a bit file with the following configuration: Offset O:000 O:001 O:002 O:003 O:004 7 1 0 0 0 1 6 1 0 0 1 0 5 1 0 1 0 0 4 1 1 0 0 0 3 0 0 0 0 0 2 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 Positions 0 1 2 3 4

The yellow portion is not actually included in the program; I put it there so that one could tell which position the SQO is looking at in the file. When the program is first initialized and the SQO reads position 0 all 4 lamps will be lit until SW 1 is turned on. During Position 1 Lamp 1 (L1) will be lit between 0 and 2 seconds, during Position 2 Lamp 2 (L2) will be lit between 2 and 5 seconds, during Position 3 Lamp 3 (L3) will be lit between 5 and 9 seconds, and during Position 4 Lamp 4 (L4) will be lit between 9 and 12 seconds. Then the SQO will cycle back to Position 1.

6. Rung 0003 This rung is simply showing that it is the end of the program.

Geanna Bowers ET 194-01 Lab 9 PROGRAM: A copy of the PLC RSLogix5 program has been provided below.

Geanna Bowers ET 194-01 Lab 9 CONCLUSION:

In this experiment we learned how to create a program for the PLC 5 use the RSLogix5 computer program that used sequencing and registers. It was a great experience for learning how the Sequencer commands in a ladder logic program will look at the information stored in a binary file and use that information to control how the outputs of the program behave. In the program we created it was a good feeling when we got it right and all 4 of our lights were behaving the way we needed them too. It isnt always easy trying to learn how to program a PLC, but once you get the hang of it, it can be an enjoyable learning experience. Its almost like building things with your hands, but instead of having a room built you can look at, its a program that controls how things work. Personally I find it quite rewarding and would recommend it to anyone who enjoys working with programming.

Vous aimerez peut-être aussi