related with logic

Join Date
May 2005
Posts
9
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.
 
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:
Use Latches:

logic1.JPG


Sorry jvcande, I actually was uploading the pic when you sent your post. o_O
 
Last edited:
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,
 
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,
 
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.
onsflowchart.gif
 
Last edited:


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
 
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,
 
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
 
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.
 

Similar Topics

I need to know how to take a schematic like this and solve it for let’s say a run time of 5 seconds By solve I mean determine which rungs are...
Replies
33
Views
8,976
We got one installation that have most of the Win10 PC in a rack above the control room. In the past they always used various flavor of KVM...
Replies
7
Views
2,939
What's your favourite source of PLC/SCADA-related news? Maybe some of you still read printed magazines?
Replies
4
Views
2,049
... yesterday I removed the plastic liner on the tail-gate of my Kia Soul to get at the broken reversing camera... It has 12 of those plastic...
Replies
17
Views
7,221
Good morning all, this is not PLC related so if not allowed just delete. But i have a problem with my RV that has got me stumped big time. I have...
Replies
12
Views
3,684
Back
Top Bottom