Previous in Forum: Area Monitoring   Next in Forum: smoke vision
Close
Close
Close
6 comments
Rate Comments: Nested
Member

Join Date: Apr 2008
Location: sharjha
Posts: 9

could any one help me in writing one plc program

06/30/2008 3:50 AM

the condition is that I have one start switch (push button ) I:1/1,

and 5 outputs o:2/0, o:2/1 ,o:2/2 , o:2/3, o:2/4.

when switch is pressed for the first time o:2/0 should be one , when i press again the switch o:2/1 should be one and the previous one will be off and so on . but after o:2/4 o:2/0 should be on that is the process is rotating.

the plc is allen bradley .

my mail id is md.hilal@hotmail.com

__________________
Mohammed Hilal
Register to Reply
Pathfinder Tags: plc program
Interested in this topic? By joining CR4 you can "subscribe" to
this discussion and receive notification when new comments are added.

Good Answers:

These comments received enough positive votes to make them "good answers".
Guru
United Kingdom - Member - Indeterminate Engineering Fields - Control Engineering - New Member

Join Date: Jan 2007
Location: In the bothy, 7 chains down the line from Dodman's Lane level crossing, in the nation formerly known as Great Britain. Kettle's on.
Posts: 32175
Good Answers: 839
#1

Re: could any one help me in writing one plc program

06/30/2008 3:58 AM

Have a look at counters and shift registers.....

__________________
"Did you get my e-mail?" - "The biggest problem in communication is the illusion that it has taken place" - George Bernard Shaw, 1856
Register to Reply
Member

Join Date: Apr 2008
Location: sharjha
Posts: 9
#2
In reply to #1

Re: could any one help me in writing one plc program

06/30/2008 4:41 AM

sir i know abt counters in alenbradely plc but not the shift registers

__________________
Mohammed Hilal
Register to Reply
3
Guru
United Kingdom - Member - Not a New Member Hobbies - Musician - New Member Hobbies - Fishing - New Member

Join Date: May 2006
Location: Reading, Berkshire, UK. Going under cover.
Posts: 9684
Good Answers: 468
#3
In reply to #2

Re: could any one help me in writing one plc program

06/30/2008 4:57 AM

If you don't want to find out about shift instructions (which would be the most efficient way to do it), just use your pushbutton input to increment a counter from 1 to 5 (or 0 to 4), remembering to reset it on the next push after maximum count. Follow this with a series of EQU and NEQ ladder rungs to turn the outputs ON or OFF as required. You can save instructions here by using EQU and OTE (instead of OTL and OTU).

Remember to use an ONS instruction after the button-pressed test, so it is only 'seen' once per push.

__________________
"Love justice, you who rule the world" - Dante Alighieri
Register to Reply Good Answer (Score 3)
Member

Join Date: Apr 2008
Location: sharjha
Posts: 9
#4
In reply to #3

Re: could any one help me in writing one plc program

06/30/2008 5:48 AM

thank u john dg.

__________________
Mohammed Hilal
Register to Reply
Member

Join Date: Apr 2008
Location: sharjha
Posts: 9
#5
In reply to #3

Re: could any one help me in writing one plc program

06/30/2008 7:19 AM

again thank u john dg . i have written the program .

__________________
Mohammed Hilal
Register to Reply
2
Guru

Join Date: Jul 2006
Location: Eastern Kansas USA
Posts: 1503
Good Answers: 128
#6

Re: could any one help me in writing one plc program

07/01/2008 12:38 AM

mdhilal,

Another way is to treat the outputs as a word with an arithmetic value multiplied by two each time the input button is pressed, and reset to 1 when the value exceeds the maximum for the number of outputs used. You would have to initialize it of course. Be careful to note that zero (0) is not the letter O, nor one (1) the letter I.

Rung-0: XIC S:1/15 MOV 0 O:2

Rung-1: XIC I:1/1 OSR B3/1 BST MUL O:2 2 O:2 NXB EQU O:2 0 MOV 1 O:2 BND

Rung-2: GRT O:2 16 MOV 1 O:2

Comments: In rung-0, in the first pass when the processor goes to run, the outputs are all turned off. In rung-1, each time the input button is pressed, the value of O:2 (the outputs) is doubled, but if it is zero, it is set to one. (The doubling is the basic "shift register" function of the program; the setting it to one is to turn it on the first time the button is pressed. In rung-2, if the value of O:2 is greater than 16 (which would occur when O:2/5 tries to be turned on), it is reset to 1, which turns on O:2/0. If the input had a tendency for a contact to "bounce", you could use a timer to require a minimum elapsed time before a second input closure would be accepted. If you wanted the lights to all go off for one button pressing after the highest one, rung-2 would move 0 to O:2.

If you want the program to start with the first output on when the processor goes to run, then rung-0 and rung-1 need to be changed so the program reads as follows:

Rung-0 XIC S:1/15 MOV 1 O:2

Rung-1 XIC I:1/1 OSR B3/1 MUL O:2 2 O:2

Rung-2 GRT O:2 16 MOV 1 O:2

If you are unfamiliar with the mnemonic codes for entering the program, which I am using above, just get to the rung and try typing the code as I listed it. You will see a text window on the rung, and when you hit the ENTER key at the end of each line of code you will see the completed code in its more common "ladder" format.

This version of the program allows a very easy adjustment to the number of outputs being turned on/off. All you need to do is change the value in rung-2 from 16 to the proper multiple of 2 (using 2(n-1)) for n<8 being the highest output being sequenced.

Have fun--JMM

Register to Reply Good Answer (Score 2)
Register to Reply 6 comments

Good Answers:

These comments received enough positive votes to make them "good answers".
Copy to Clipboard

Users who posted comments:

jmueller (1); JohnDG (1); mdhilal (3); PWSlack (1)

Previous in Forum: Area Monitoring   Next in Forum: smoke vision
You might be interested in: Programmable Logic Controllers (PLC), Switch Boots

Advertisement