![]() ![]() ![]() ![]() ![]() ![]() |
||
![]() |
||
![]() ![]() ![]() ![]() This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc. |
||
![]() |
![]() |
#1 |
Member
![]() ![]() Join Date: May 2005
Posts: 9
|
related with logic
hello everybody,
i am newly joined member having simple question. I want a logic in ladder. i am having s7-200 plc of siemens and micro/win software version 4.0 for programming. My logic is: i am having one PB(pushbutton). If i press it first time, my lamp should be on and when i press it second time, it should be off. you will have only one PB. you can use your memory bits. please, reply me as soon as possible. |
![]() |
![]() |
#2 |
Member
|
jayesh.monpara,
please read this first. Then return here and rephrase your question accordingly. Kind regards,
__________________
Jean Pierre Vandecandelaere Subject matter expert industrial maintenance & cooling VDAB Hoofdbestuur Gasthuisstraat 31 - 10e verd B-1000 Brussel Belgium |
![]() |
![]() |
#3 |
Member
![]() ![]() Join Date: Oct 2004
Location: India.
Posts: 750
|
a toggle switch problem
hi there
Your problem relates to simple toggle switch. aaaaai1aaaa m2aaaaa m1 -----()----(/)------() aaaai1aaaaaaaaaaaaaaam2 ----()--------------() aaaaLampaaam1aaaaaaaaam3 ----()-----()---------() aaaam1aaaaaaaaaam3aaaaaaaalamp ----()---------(/)--------() aalampaaaa | ---()------ i1--->your push button lamp--->lamp m1,m2,m3 --> are flags have a nice day manmeet Last edited by manmeetvirdi; May 27th, 2005 at 10:50 AM. |
![]() |
![]() |
#4 |
Member
![]() ![]() Join Date: Apr 2004
Posts: 48
|
Use Latches:
Sorry jvcande, I actually was uploading the pic when you sent your post. ![]() Last edited by POWER_PACKED; May 27th, 2005 at 10:37 AM. Reason: did see previous post |
![]() |
![]() |
#5 |
Member
|
Some reflections:
manmeet, you can do without m3. Can you figure out how? power_packed, what happens if you don't release the pushbutton? Now that's what learning is about: don't simply copy wwhat somebody showed you, but go beyond that. Kind regards,
__________________
Jean Pierre Vandecandelaere Subject matter expert industrial maintenance & cooling VDAB Hoofdbestuur Gasthuisstraat 31 - 10e verd B-1000 Brussel Belgium |
![]() |
![]() |
#6 |
Member
![]() ![]() Join Date: Apr 2004
Posts: 48
|
jvcande - Its a momentary PB, there is no reason why it shouldn't release, If it doesn't then there is a problem, and mind as well replace it.
Kinder regards, |
![]() |
![]() |
#7 |
Guest
Posts: n/a
|
anon
who's gonna tell him
|
![]() |
![]() |
#8 |
Lifetime Supporting Member + Moderator
|
Power Packed,
I can see how your logic would be very effective in turning the light OFF, but please explain how it could ever turn the light ON! |
![]() |
![]() |
#9 |
Lifetime Supporting Member
|
Actually I dont think either code examples would work. Scans take milliseconds or less so when you push a pushbutton the program may be scanned several times before you release it. The last scan will determine the output. As Steve mentioned since the unlatch is the last instruction what will be the last action?
What do you do to make sure that when you push the button it only works for one scan? Terrys flow chart helps explain this. ![]()
__________________
http://www.patchn.com Industrial Electrical & Maintenance @ www.patchn.com "Tell me and I forget, show me and I remember, involve me and I understand." Last edited by rsdoran; May 27th, 2005 at 02:00 PM. |
![]() |
![]() |
#10 |
Member
![]() ![]() Join Date: Oct 2004
Location: India.
Posts: 750
|
Mr JVCANDE :Hats off to you. I never before thought about it. Actually its my bad habit that when circuit starts working , I don,t think any more on that. Given below is circuit without m3. aaaaaaaaaaaaaaI1aaaaaaaaaaaa m2aaaaaaaaaaaaaaa m1 --------------( )----------(/)--------------( ) aaaaaaaaaaaaaai1aaaaaaaaaaaaaaaaaaaaaaaaaaaaa m2 --------------( )---------------------------( ) aaaaaaaaaaaaaaam1 aaaaaaaaalamp aaaaaaaaaaaaaaalamp -------------( )----------(/)------------------( ) aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa| aaaaaaaaaaaalamp aaaaaaaaaam1aaaa | -----------( )------------(/)----- But I found that we can do even without m2 ! Here it is:- aaaaaaaaaaaLamp aaaaaaaaaaai1 aaaaaaaam1 ----------( )------------(P)---------( ) aaaaaai1 aaaaaaaaaaaaam1aaaaaaaaaaa lamp -----(P)-------------(/)------------( ) aaaaaaaaaaaaaaa| aaaalamp aaaaaa| ----( )--------- Mr RSDORAN as far as your fear goes,i.e, What do you do to make sure that when you push the button it only works for one scan? Then first two lines of my code will take care of your fear. Mr POWER_PACKED solution won’t work,irrespective of whether push button is O.K or not |
![]() |
![]() |
#11 |
Member
|
manmeet,
there is one big advantage of the first solution (that's the one I usually use): a PLC trainee or even a maintenance tech without PLC training understands it, once I've explained it briefly. And about your hat off remark: after working 25 years in this field of experience (of which 12 years now as a trainer) I have seen programming from more than a few 100 different people. I have learned from those people too. I still do. Kind regards,
__________________
Jean Pierre Vandecandelaere Subject matter expert industrial maintenance & cooling VDAB Hoofdbestuur Gasthuisstraat 31 - 10e verd B-1000 Brussel Belgium |
![]() |
![]() |
#12 | |
Lifetime Supporting Member
|
Quote:
Since this was an obvious student question I thought it would make sense to have the student provide an effort first. I guess that isnt necessary so here are examples of flip flops ckts with an AB or GE http://www.patchn.com/flipflop.htm
__________________
http://www.patchn.com Industrial Electrical & Maintenance @ www.patchn.com "Tell me and I forget, show me and I remember, involve me and I understand." |
|
![]() |
![]() |
#13 |
Member
![]() ![]() Join Date: Apr 2002
Posts: 3,170
|
Power Packed...
Can you not see the sequence of events in your code?
Rung-1... if PB is ON (it is) and LIGHT is OFF (it is) then... SET LIGHT (ON) Rung-2... if PB is ON (it is) and LIGHT is ON (it is) then... RST LIGHT (OFF) While you hold the PB the sequence simply repeats... over and over... ON, then OFF... ON, then OFF... ON, then OFF... Having just pushed the button to turn the light ON... you have turned the light OFF. When you release the PB the Light remains in it's last state... OFF. The light will never go ON. . . . . Now, if you reverse the order of the rungs...
Rung-1: PB ON (it is) & Light is OFF (it is) so nothing happens at the output. Rung-2: PB ON (it is) & Light is OFF (it is) so SET LIGHT (ON) ...next scan... Rung-1: PB ON (it is) & Light is ON (it is) so RST LIGHT (OFF) Rung-2: PB ON (it is) & Light is OFF (it is) so SET LIGHT (ON) ...etc...etc...etc While you hold the PB the sequence simply repeats... over and over... OFF, then ON... OFF, then ON... OFF, then ON... When you release the PB the Light remains in it's last state... ON. Once turned ON, the light will never go OFF. |
![]() |
![]() |
#14 |
Member
![]() ![]() Join Date: Apr 2004
Posts: 48
|
Forgive my ignorace. Thank you
|
![]() |
![]() |
#15 |
Lifetime Supporting Member
|
![]()
__________________
"If there is a problem, there is a solution. If there is no solution, then there is no problem." - unknown ![]() Daniel Camacho Last edited by DanielCamacho; May 28th, 2005 at 03:21 PM. |
![]() |
![]() |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Non PLC related, but looking for your input | SLaubach | LIVE PLC Questions And Answers | 17 | January 17th, 2011 01:26 PM |
Allen-Bradley “Latches” vs. Direct Logic “Sets” ... round 1 ... | Ron Beaufort | LIVE PLC Questions And Answers | 38 | May 18th, 2005 09:52 AM |
FactoryLink ECS Interpreted Math & Logic?? | substrate | LIVE PLC Questions And Answers | 1 | January 5th, 2005 06:21 PM |
Pc Logic Vs Plc Logic | awilken | LIVE PLC Questions And Answers | 14 | May 23rd, 2004 04:14 AM |
Normally open or closed or... | Phil Melore | LIVE PLC Questions And Answers | 15 | February 3rd, 2003 09:14 PM |