Plc5 Allen Bradley

cmcc60

Member
Join Date
Jun 2002
Location
carthage,TX
Posts
3
I am new to plc's and was wanting to know how I can program a pushbutton to turn on 16 lights one at a time and each one stay on after the pushbutton is released at present I have the stop, start with seal in contacts and an internal coil that operates each rung. By putting my pushbutton switch on each rung with a light when I activate the pushbutton all 16 lights come on.
 
The PLC teachers are learning...they are getting trickier. From your question I "think" you want to turn on 16 lights sequentially.

If you have studied plc's at all you should note that they used 16 lights in this equation. Why was that done?

My opinion for 2 reasons...to better acqauint you with word files(which uses 16 bits per word file) and used a drum sequencer or sequential operation.

THE HOW is plc dependent on manucfacturer how its done in sequential operation in some case BUT using timer(s) its possible to create your own sequence.
 
BTW if you just need to turn on 16 lights when pushing the button there are numerable options concerning the button but the simplest is:
Code:
|   Stop  Pushbutton                  16 lights
|---|/|----| |-------------------------( )--|
|       16 lights |
|----------| |----|

Pushbutton ( normally open ) will turn them on...Stop P.B. (normally closed will turn them off).

Note the lights must be wired in parallel if of the same voltage...ie one output is used and all lights wired in parallel to that output.
 
cmcc60,

There are at least a half-dozen different ways to do what you are trying to do. The simplest one that comes to mind is as follows...


Code:
                +-----------------+
                | UP/DOWN COUNTER |
     PB1        |                 |
 ----| |--------+ Up              |
     PB2        |                 |
 ----| |--------+ Down            |
     PB3        |                 |
 ----| |--------+ Reset           |
                |                 | 
                +-----------------+

      CNT
  ---| = |--------------------( LT-1 )
       1

      CNT
  ---| = |--------------------( LT-2 )
       2

      CNT
  ---| = |--------------------( LT-3 )
       3

   ETC.

Everytime you push PB1 the count increments. Only the count-specified light goes ON; 1, 2, 3,... etc. All others are OFF.

Everytime you push PB2 the count decrements; ...3, 2, 1, 0.

When you push PB3 the counter is reset to zero and all lights go OFF.

You would probably have to build a "de-bouncer" to keep your counter from mis-counting.


There are also methods using Adders, Shift Registers, Pointers...

There is another method which decides which light to turn ON based on which light is currently ON...

...if 5, then 6, NOT 5
...if 6, then 7, NOT 6
...if 7, then 8, NOT 7

This one is a little tricky in that the pseudo-code should really look like this...

...if 7, then 8, NOT 7
...if 6, then 7, NOT 6
...if 5, then 6, NOT 5

The examinations proceed backward from 16 to 1 rather than from 1 to 16. Can you understand why this is necessary in this particular code?

The whole point of this exercise, regardless of the method you use, is to figure out how to trap (detect) the OFF-to-ON transition and make it work for you. Can you see why simply looking to see if the PB is ON is problematical?
 
food for thought

Look what happens to the bit pattern of a word when you multiply its decimal value by 2.

dec 1 = bin 0000000000000001
dec 2 = bin 0000000000000010
dec 4 = bin 0000000000000100
dec 8 = bin 0000000000001000
dec 16= bin 0000000000010000

do you see a pattern here?

Now if you assign each bit to a light output, and each push of the button multiply the dec value of the word by two............
 
whoops

Important - if you multiply 16,384 (bit 14 on) by 2 you get 32,768 which is larger than the maximum value allowable in an AB PLC5. The AB uses bit 15 as the sign bit. I don't have a PLC handy right now to test this to see how it reacts. I know that it will set the overflow bit, but I don't know what the bit pattern would look like after 16,384 X 2. Anybody have any thoughts on this?

You may be better off using the Bit Shift Left instruction.
 
Just FYI,

The PLC5 rolls over when an overflow occurs.

16384 x 2 = -32768 or the following bit pattern:

1000000000000000

Different PLCs react differently to an overflow. This is simply what the PLC5 does.

The PLC5 also sets the arithmetic overflow bit (S:10/14) when this occurs.

OG
 
Which PLC are you using?

If you are using an AB SLC500 you could use instructions BSR, BSL or SQO. Either of these should give you a sequential output.

Ben
 
Use a counter & latch each output on.Then unlatch with stop button &
reset counet with stop button.(ctr)
 
Here is a solution to the problem that you posted. Just copy the text and insert it into RSLogix. You'll have to supply the adresses in case it's not the default project. I've used an input, an internal bit, a counter, a greater than compare and the 16 outputs. Try filling in the blanks and post your answer here. Good Luck!

SOR XIC ? BST XIO ? OTE ? NXB OTE ? BND EOR SOR CTU ? 0 0 EOR SOR BST GRT ? ? OTE ? NXB GRT ? ? OTE ? NXB GRT ? ? OTE ? NXB GRT ? ? OTE ? NXB GRT ? ? OTE ? NXB GRT ? ? OTE ? NXB GRT ? ? OTE ? NXB GRT ? ? OTE ? NXB GRT ? ? OTE ? NXB GRT ? ? OTE ? NXB GRT ? ? OTE ? NXB GRT ? ? OTE ? NXB GRT ? ? OTE ? NXB GRT ? ? OTE ? NXB GRT ? ? OTE ? NXB GRT ? ? OTE ? BND EOR

P.S. The question marks are the program wanting the addresses for the instructions. This is where your brain has to kick in.
 
Turn on and off all at once?

Ladder:
ladder8709503294.jpg
 
If I understand the post correctly, you want to sequence thru the lights this way each time the button is pushed.

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 X
0 0 0 0 0 0 0 0 0 0 0 0 0 X X
0 0 0 0 0 0 0 0 0 0 0 0 X X X
.
.
0 X X X X X X X X X X X X X X
X X X X X X X X X X X X X X X

Here is a quick and dirty way to do it on the PLC5, however this method uses simple instructions that are available on almost all PLCs (just for you Terry). It is important that you understand what is occuring on the binary level here.


al112906a.JPG


Question for you: How do you think you might keep additonal presses of the start button from messing up the sequence once all 16 lights are on? Hint: You can do it by coding in an XIC instruction to look at a single bit.
 
I'm fairly new to this PLC programming but I am enjoying it. Here's something that I learned a few months ago. It's called a ratcheting relay.


You use the pushbutton (momentary contact) to be the input to a counter. Use the counters ACC word least significant bit 0 to control the outputs. As the pushbutton is pushed it will cause the ACC vale to rise (or fall if you use a countdown) in increments of 1. The pattern will be

0000000001
0000000010
0000000011
0000000100
0000000101

Do you see the pattern? The value C5:0.ACC/0 goes high and then low every other time the pushbutton is closed. If you choose you can rest the counter but I don't believe you have to because the overflow will be set when ACC>Preset but it doesn't affect the function of your pushbutton. The ACC value will just wrap around.
 

Similar Topics

Does anyone have the installation files only (not the license) for the Allen-Bradley 6200 software for the PLC 5/250 (also known as Pyramid...
Replies
3
Views
1,190
Today I was making an online edit to a 5/40 Series E Rev K.2 with about 14% free memory. I was removing one branch in a large rung. Accept...
Replies
4
Views
3,129
I am using a legacy Allen Bradley PLC5/40E Series F CPU Having issue with compute instruction syntax with the expression Doing a divide by...
Replies
7
Views
1,719
I have been working within a file for several days and this morning I am getting a "Access Violation to Current Processor" error? I was just in...
Replies
1
Views
1,895
Hello, We use 4 racks with 1785-L80B, 1785-BCM and 1785-BEM in them. I am looking to purchase secondhand a few spares as we have had some...
Replies
4
Views
2,175
Back
Top Bottom