You are not registered yet. Please click here to register!


 
 
plc storereviewsdownloads
This board is for PLC Related Q&A ONLY. Please DON'T use it for advertising, etc.
 
Try our online PLC Simulator- FREE.  Click here now to try it.

New Here? Please read this important info!!!


Go Back   PLCS.net - Interactive Q & A > PLCS.net - Interactive Q & A > LIVE PLC Questions And Answers

Reply
 
Thread Tools Display Modes
Old May 27th, 2005, 10:14 AM   #1
jayesh.monpara
Member
India

jayesh.monpara is offline
 
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.
  Reply With Quote
Old May 27th, 2005, 10:22 AM   #2
jvdcande
Member
Belgium

jvdcande is offline
 
jvdcande's Avatar
 
Join Date: Apr 2002
Location: Menen
Posts: 2,178
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
  Reply With Quote
Old May 27th, 2005, 10:29 AM   #3
manmeetvirdi
Member
India

manmeetvirdi is offline
 
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.
  Reply With Quote
Old May 27th, 2005, 10:30 AM   #4
POWER_PACKED
Member
Canada

POWER_PACKED is offline
 
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
  Reply With Quote
Old May 27th, 2005, 11:24 AM   #5
jvdcande
Member
Belgium

jvdcande is offline
 
jvdcande's Avatar
 
Join Date: Apr 2002
Location: Menen
Posts: 2,178
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
  Reply With Quote
Old May 27th, 2005, 12:37 PM   #6
POWER_PACKED
Member
Canada

POWER_PACKED is offline
 
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,
  Reply With Quote
Old May 27th, 2005, 12:58 PM   #7
Unregistered
Guest
 
Posts: n/a
anon

who's gonna tell him
  Reply With Quote
Old May 27th, 2005, 01:05 PM   #8
Steve Bailey
Lifetime Supporting Member + Moderator
United States

Steve Bailey is online now
 
Steve Bailey's Avatar
 
Join Date: Apr 2002
Location: The boondocks of Western Massachusetts USA
Posts: 8,027
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!
  Reply With Quote
Old May 27th, 2005, 01:57 PM   #9
rsdoran
Lifetime Supporting Member
United States

rsdoran is offline
 
rsdoran's Avatar
 
Join Date: Apr 2002
Location: Birmingham, AL
Posts: 7,372
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.
  Reply With Quote
Old May 28th, 2005, 09:32 AM   #10
manmeetvirdi
Member
India

manmeetvirdi is offline
 
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
  Reply With Quote
Old May 28th, 2005, 10:24 AM   #11
jvdcande
Member
Belgium

jvdcande is offline
 
jvdcande's Avatar
 
Join Date: Apr 2002
Location: Menen
Posts: 2,178
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
  Reply With Quote
Old May 28th, 2005, 10:33 AM   #12
rsdoran
Lifetime Supporting Member
United States

rsdoran is offline
 
rsdoran's Avatar
 
Join Date: Apr 2002
Location: Birmingham, AL
Posts: 7,372
Quote:
Then first two lines of my code will take care of your fear.
This type of application isnt going to be accomplished easily unless a one shot is used. Your second try incorporates a one shot but not sure the method you used will work, seem to me that M1 would never actually become true.

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."
  Reply With Quote
Old May 28th, 2005, 11:27 AM   #13
Terry Woods
Member
United States

Terry Woods is offline
 
Join Date: Apr 2002
Posts: 3,170
Power Packed...
Can you not see the sequence of events in your code?


Rung-1

PB LIGHT
---| |-------|/|-------{ SET ) LIGHT


Rung-2

PB LIGHT
---| |-------| |-------{ RST ) LIGHT


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 LIGHT
---| |-------| |-------{ RST ) LIGHT


Rung-2

PB LIGHT
---| |-------|/|-------{ SET ) LIGHT


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.
  Reply With Quote
Old May 28th, 2005, 02:12 PM   #14
POWER_PACKED
Member
Canada

POWER_PACKED is offline
 
Join Date: Apr 2004
Posts: 48
Forgive my ignorace. Thank you
  Reply With Quote
Old May 28th, 2005, 03:02 PM   #15
DanielCamacho
Lifetime Supporting Member
Mexico

DanielCamacho is offline
 
DanielCamacho's Avatar
 
Join Date: Mar 2005
Location: Querétaro
Posts: 208
Lightbulb This will work...

And why not look at this?

__________________
"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.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Topics
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


All times are GMT -4. The time now is 09:37 AM.


.