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.

---------->>>>>Get FREE PLC Programming Tips

New Here? Please read this important info!!!


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

PLC training tools sale

Reply
 
Thread Tools Display Modes
Old April 5th, 2010, 10:27 PM   #1
james84
Member
Australia

james84 is offline
 
Join Date: Apr 2010
Location: melbourne
Posts: 16
start/stop using one push button

hi guys,

i have just started learning plc programming and stuck with one tutorial question.

question is:

using DIFU create a programe to start and stop motor using same push button.

can any one give me some idea???????

thanks in advance.........
  Reply With Quote
Old April 5th, 2010, 11:30 PM   #2
dmroeder
Lifetime Supporting Member
United States

dmroeder is offline
 
dmroeder's Avatar
 
Join Date: Apr 2006
Location: Vancouver, WA
Posts: 1,169
James, you have asked the number one most asked question in this forum. Spend some time searching for the term "flip flop".
__________________
Get 2 GB of free space from Dropbox using my referral.
  Reply With Quote
Old April 5th, 2010, 11:31 PM   #3
hanqin
Member
China

hanqin is offline
 
Join Date: Jun 2009
Location: JS
Posts: 19
For example:

LD M100
ALT Y000
END
  Reply With Quote
Old April 6th, 2010, 10:00 AM   #4
TConnolly
Lifetime Supporting Member
United States

TConnolly is offline
 
TConnolly's Avatar
 
Join Date: Apr 2005
Location: Salt Lake City
Posts: 5,409
Greetings James and welcome to the forum. We don't do homework for you but we will help you.

The problem sounds simple enough on the surface, when we push a button we want the output to be the opposite of what it was, ie,

if button then output = not output

If only it were that simple. The first difficulty we encounter when trying to solve this problem is that the PLC can complete dozens of scans while a button is being pressed. Even if the operator is really fast, he is slower than the PLC. Even Wyatt Earp doesn't stand a chance. The output will change state ever scan and the final state of the output would be indeterminate. So what we need is a way to program that we don't want to respond to the button state, just the initial pressing of the button.

The DIFU, or differential up, instruction will turn on its addressed bit on the rising edge of the input. The bit remains on for only a single scan of the PLC. This is called a one shot. After that the bit will go false and remain false until the input goes false and then true again. One shots are incredibly useful and you will find that they have thousands of applications. Note that even though Omron calls it differential up, other PLC makers may call the equivalent a one-shot, or a one-shot-rising or a one-shot-falling (DIFD).

If input A has a push button wired to it, this rung will create a one shot pulse at bit B that will be true for one scan only when button A is pressed.

A
--] [----------+----+
|DIFU|
+----+
|B |
+----+



Lest I do all of your homework for you and you learn nothing, I'm not going to complete the ladder, rather, lets express what we want to have happen in words.

If b and not output then turn on the output.
If b and output then turn off the output.


This takes care of describing what happens when a pulse causes the output to change state. The rest of the time, the times when we don't have a pulse (ie, the time between the instant the button is pushed and the instant it is pushed again), we want the output to remain in whatever state it was in. We can express that this way:

If !b and output the leave the output on.
If !b and not output then leave the output off.


The first two statements can be expressed in Boolean math as
C = (B AND NOT C)

The second two statements can be expressed as
C = (NOT B AND C)

Combining the two we get

C = (B AND NOT C) OR (NOT B AND C)

I hope that helps.
__________________
True craftsmanship is only one more power tool away.

That's the beauty of processors, they don't have emotions they just run code - The PLC Kid.

Last edited by TConnolly; April 6th, 2010 at 10:20 AM.
  Reply With Quote
Old April 6th, 2010, 08:05 PM   #5
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 2,143
The forum world would be a much less populated place if plc manufacturers added a "toggle" output instruction....

example, in A-B world ---(T)--|, executed for a false to true rung transistion, of course !

no more homework posts.....
__________________
___________________________
ControlLogix & SLC Training
a-b train ltd.
abtrain@tiscali.co.uk
www.abtrain.co.uk
tel: 07506 73 9999
self-help and help-yourself often get confused - ancient daba proverb


  Reply With Quote
Old April 6th, 2010, 08:26 PM   #6
Mickey
Lifetime Supporting Member
United States

Mickey is offline
 
Mickey's Avatar
 
Join Date: May 2003
Location: Palmdale,Ca
Posts: 7,508
Quote:
Originally Posted by daba View Post
The forum world would be a much less populated place if plc manufacturers added a "toggle" output instruction....

example, in A-B world ---(T)--|, executed for a false to true rung transistion, of course !

no more homework posts.....
Make sure it has a build-in de-bounce filter setting.
__________________
Mickey

If you want happiness for an hour-take a nap. If you want happiness for a day-go fishing. If you want happiness for a month-getmarried. If you want happiness for a year-inherit a fortune. If you want happiness for a lifetime-help someone else.
----- Chinese Proverb

Last edited by Mickey; April 6th, 2010 at 08:33 PM.
  Reply With Quote
Old April 6th, 2010, 08:35 PM   #7
Brodin
Member
United States

Brodin is offline
 
Brodin's Avatar
 
Join Date: Mar 2010
Location: Spartanburg, SC
Posts: 16
I don't remember who posted it. Several years ago, someone posted using the PB as the input for a counter and using the ".0" bit of the counter as the Start/Stop for the motor.
I loved it and have been using it ever since.
  Reply With Quote
Old April 8th, 2010, 12:10 AM   #8
Sergei Troizky
Member
Canada

Sergei Troizky is offline
 
Join Date: Oct 2004
Location: Montreal
Posts: 522
Quote:
Originally Posted by Brodin View Post
I don't remember who posted it. Several years ago, someone posted using the PB as the input for a counter and using the ".0" bit of the counter as the Start/Stop for the motor.
I loved it and have been using it ever since.
This looks elegant at first glance, but:
- Not every PLC allows bit-level access to word data.
- The counter must be reset sometimes to prevent saturation or overfill. This is simple unless the abovementioned limitation applies.

Actually, bit toggle may be programmed using only 4 contacts + the bit coil.
Hint: with toggle condition active, the bit switches to opposite state, with toggle condition inactive it self-retains.
  Reply With Quote
Old April 8th, 2010, 05:56 AM   #9
milldrone
Member
United States

milldrone is offline
 
milldrone's Avatar
 
Join Date: Mar 2005
Location: in the dog house
Posts: 1,201
Quote:
Originally Posted by Brodin View Post
I don't remember who posted it. Several years ago, someone posted using the PB as the input for a counter and using the ".0" bit of the counter as the Start/Stop for the motor.
I believe it's the honorable Alaric .

I found this post from April 2005
http://www.plctalk.net/qanda/showpos...65&postcount=6

Using the counter method also allows more than two states to be controlled by one button.
__________________
Vaughn

If you can read this, thank a teacher.
  Reply With Quote
Old April 8th, 2010, 07:53 AM   #10
bernie_carlton
Lifetime Supporting Member + Moderator
United States

bernie_carlton is offline
 
bernie_carlton's Avatar
 
Join Date: Apr 2002
Location: Yakima, Washington
Posts: 4,593
Quote:
Originally Posted by daba View Post
The forum world would be a much less populated place if plc manufacturers added a "toggle" output instruction....

example, in A-B world ---(T)--|, executed for a false to true rung transistion, of course !

no more homework posts.....
The point of the training exercise is not the toggle itself but to increase understanding about the scan, its possible uses and intricacies.
__________________
Controlling outputs is the PLC's way of getting its inputs to change.

www.thePLCguy.com
  Reply With Quote
Old April 8th, 2010, 08:28 AM   #11
JHarbin
Member
United States

JHarbin is offline
 
Join Date: Sep 2009
Location: NC
Posts: 382
Quote:
Originally Posted by daba View Post
The forum world would be a much less populated place if plc manufacturers added a "toggle" output instruction....

example, in A-B world ---(T)--|, executed for a false to true rung transistion, of course !

no more homework posts.....

FYI - the Honeywell HC900 has a Toggle Block - it uses function block programming only.
  Reply With Quote
Old April 8th, 2010, 09:24 AM   #12
TConnolly
Lifetime Supporting Member
United States

TConnolly is offline
 
TConnolly's Avatar
 
Join Date: Apr 2005
Location: Salt Lake City
Posts: 5,409
One of our forum members, Doug_P has an animated avatar that shows a simple flip flop that will work with most PLCs.



This flip flop can be programmed on pretty much all PLCs. Assuming P is an unbuffered push button input it cannot be guaranteed to always work on a ControlLogix platform - most of the time it will work but there could be instances when the CLX IO updates between the first and second rung of Doug's flip flop.

I've been more partial to the Counter.ACC/0 method the last few years to create toggles. I don't bother with counter roll over, it will go on toggling just fine - if it is an issue then unconditionally unlatch counter.acc/14 and it will never roll over. With the counter.acc/0 method you also need to program something so the toggle is in the right state at go to run conditions.

However the OP is working with an Omron PLC and had to use the DIFU instruction. Maybe for the fun of it our Omron gurus could point out how to use the LSB of a counter and whether roll over is an issue or not.
__________________
True craftsmanship is only one more power tool away.

That's the beauty of processors, they don't have emotions they just run code - The PLC Kid.

Last edited by TConnolly; April 8th, 2010 at 09:33 AM.
  Reply With Quote
Old April 8th, 2010, 09:26 AM   #13
naag_slet
Member
India

naag_slet is offline
 
Join Date: Apr 2010
Location: bangalore
Posts: 65
Arrow

Please find attached the sreen shot for your reference.
Thanks in advance for your better understanding.


its very simple to build/use.

Nagaraj.
Attached Images
File Type: jpg ON_OFF_PB.jpg (44.4 KB, 670 views)
  Reply With Quote
Old April 8th, 2010, 10:59 AM   #14
TConnolly
Lifetime Supporting Member
United States

TConnolly is offline
 
TConnolly's Avatar
 
Join Date: Apr 2005
Location: Salt Lake City
Posts: 5,409
Greetings Naag_slet.

Thank you for posting that. I see one problem with it however. Lets start with CTU1.ACC = 0. When the button is pressed CTU1.ACC increments to 1. The bit On_Latch is turned on in rung 71. When the button is pressed again CTU1.ACC increments to 2. The bit On_Latch is turned off by rung 72. So far so good. Next time the button is pressed CTU1.ACC increments to 3. The counter is then reset in rung 73. The bit On_Latch however does not change state. To get the bit On_Latch to turn back on the button must be pressed again. Each time there after when the bit is turned off the button must then be pressed twice to get the bit to turn back on. This is not a true toggle.

This counter method is much simpler

Button
---] [-----------+-CTU-------------+-(CU)-
|Counter ToggleCTR+-(DN)-
|Preset 0|
|Accum 0|
+-----------------+

ToggleCTR.ACC.0 OUT
---] [---------------------------( )---


The least significant bit of a binary number changes state whenever the number increments. It doesn't matter if the binary is positive or negative or if it rolls over.
When ToggleCTR.ACC is an even number ToggleCTR.ACC.0 is 0.
When ToggleCTR.ACC is an odd number ToggleCTR.ACC.0 is 1.

Hope that helps.
__________________
True craftsmanship is only one more power tool away.

That's the beauty of processors, they don't have emotions they just run code - The PLC Kid.
  Reply With Quote
Old April 9th, 2010, 12:39 AM   #15
naag_slet
Member
India

naag_slet is offline
 
Join Date: Apr 2010
Location: bangalore
Posts: 65
Arrow

you can put 2 in the preset of counter.
  Reply With Quote
Reply
Jump to Live PLC Question and Answer Forum

Bookmarks


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
Troubleshooting basic code johnfarrugi LIVE PLC Questions And Answers 10 January 27th, 2009 06:41 PM
push button as a toggle switch kaushikelectrical LIVE PLC Questions And Answers 15 December 7th, 2008 10:22 AM
RSView ME - Momentary Push Button Stuck? sthays10 LIVE PLC Questions And Answers 20 January 18th, 2006 10:29 AM
motor on and off with single push button saurabh_bmit LIVE PLC Questions And Answers 30 August 11th, 2005 02:12 PM
using ^C in BASIC module ettikudiappan LIVE PLC Questions And Answers 9 November 24th, 2003 09:10 AM


All times are GMT -5. The time now is 12:13 AM.


.