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 9th, 2010, 09:17 PM   #16
harrydeharry
Member
India

harrydeharry is offline
 
Join Date: May 2008
Location: Delhi
Posts: 183
----||-----(P)-----(#)-------|/|-------(s)m1.0
pb M1.2 #temp m1.0

----||-----||--------|/|----------------(r)m1.0
#temp m1.0 pb
  Reply With Quote
Old April 9th, 2010, 10:15 PM   #17
Eric Nelson
Lifetime Supporting Member + Moderator
United States

Eric Nelson is online now
 
Eric Nelson's Avatar
 
Join Date: Apr 2002
Location: Randolph, NJ
Posts: 4,080
First let's get the labels lined up...
----||-----(P)-----(#)-------|/|-------(s)m1.0
pb M1.2 #temp m1.0

----||-----||--------|/|---------------(r)m1.0
#temp m1.0 pb

Now, I'm not understanding how this can work. Normally, you alternate on the leading edge of an input, yet your reset rung uses a --]/[-- for the pushbutton. Therefore, M1.0 can only reset when the pushbutton is released. My next concern is the #temp bit. Won't that be on for only one scan when the pushbutton is initially pushed? If so, then how can it be on when the pushbutton is released, allowing M1.0 to reset?



-Eric
  Reply With Quote
Old April 10th, 2010, 12:13 AM   #18
ArikBY
Member
Israel

ArikBY is offline
 
ArikBY's Avatar
 
Join Date: Oct 2003
Location: Oranit Israel
Posts: 1,433
Take a look

http://www.plctalk.net/qanda/showthread.php?t=7945
__________________
Arik

Barak Control Israel
  Reply With Quote
Old April 10th, 2010, 06:18 AM   #19
andreapg
Member
Italy

andreapg is offline
 
Join Date: Feb 2010
Location: Perugia
Posts: 5
In that pdf file you can find a ladder diagram which I created using step7 mw.
When I press the button (I0.6) M0.0 and M0.1 turn on.
When I press the button again that merkers turn off.
http://electronline.it/doc/sist.movim..pdf
  Reply With Quote
Old June 29th, 2010, 08:11 AM   #20
signal
Member
Indonesia

signal is offline
 
signal's Avatar
 
Join Date: Oct 2007
Location: surabaya
Posts: 1
Quote:
Originally Posted by Alaric View Post
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.
that's interesting.., thanks
  Reply With Quote
Old June 21st, 2012, 08:07 PM   #21
primadisetiawan
Member
Indonesia

primadisetiawan is offline
 
Join Date: Jun 2012
Location: surabaya
Posts: 1
Quote:
Originally Posted by TConnolly View Post
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.
You help very much.. thanks
  Reply With Quote
Old June 22nd, 2012, 09:02 AM   #22
Calistodwt
Member
South Africa

Calistodwt is offline
 
Calistodwt's Avatar
 
Join Date: May 2003
Location: George, South Africa
Posts: 141
The boolean expression plus a OSR as suggested by TCONNOLLY seems to work fine and is the simplest solution I have seen yet on this forum
  Reply With Quote
Old June 22nd, 2012, 02:15 PM   #23
VAN
Member
United States

VAN is offline
 
Join Date: Apr 2012
Location: IDAHO
Posts: 46
I'm with TC, but I would have the ctr reset when it reaches 2, so when the

acc = 0 -> off,
acc = 1 -> on,
acc = 2 -> rst -> acc = 0 -> off.

That way you don't have the ctr some how getting beyond a dint or sint or whatever data type you are going to have it setup as. This also allows for more options, such as confirmation options.

acc = 0 -> off,
acc = 1 -> confirm on,
acc = 2 -> on,
acc = 3 -> confirm off,
acc = 4 -> rst -> acc = 0 -> off.

(Note - you would have to setup a timer so the confirm is only an option for a couple of seconds, then force the acc back to its last state. A subtract function might work for this, or move statements depending if 1 or 3.)

Oh, and I like having an indicator over lay my pushbuttons. This allows the pushbutton to do what it is intended to do and the indicator can change depending on what is going on in the machine.

Last edited by VAN; June 22nd, 2012 at 02:18 PM.
  Reply With Quote
Old June 22nd, 2012, 02:36 PM   #24
jkerekes
Member
United States

jkerekes is offline
 
jkerekes's Avatar
 
Join Date: Aug 2007
Location: NJ
Posts: 1,317
I made a Toggle AOI using the JK flip-flop FB instruction in 5000. I know this doesn't help if your using a different platform.
  Reply With Quote
Old June 22nd, 2012, 07:55 PM   #25
chavak
Member
Malaysia

chavak is offline
 
chavak's Avatar
 
Join Date: Jul 2002
Posts: 534
OP mentioned DIFU, so I guess he may be using Omron, I have seen this version which is suitable for CJ series and up, [credit is not mine]


Oops, just noticed this thread is 2 year old, sorry.
Attached Images
File Type: jpg Flip Flop.JPG (9.1 KB, 97 views)

Last edited by chavak; June 22nd, 2012 at 07:57 PM.
  Reply With Quote
Old June 23rd, 2012, 12:50 AM   #26
gryskop
Member
South Africa

gryskop is offline
 
Join Date: Feb 2008
Location: Gauteng
Posts: 21
To the original OP this might be homework, but I had exactly the same problem with ControlLogix and RSLogix5000 software.

The Pushbutton in this case is an input signal from FactoryTalk. The operator needs to press a button to change the duty state of the duty controller.

In RSLogix the [One Shot] is an [ONS] object, but you can replace this with whatever your system allows.

X1 and X2 are two memory bits I use in my code. X2 will be the toggled bit you connect to whatever function you require.

A simple but effective bit of coding. Not my own though. Also had to ask somebody how they've done it in the past.


Pushbutton X1
---| |---------[One Shot]---------( )--

X1 X1 X2
--+--| |----+----+--|/|----+------( )--
| | | |
| | | |
| X2 | | X2 |
+--| |----+ +--|/|----+



I too would have used a D-Latch flip flop, but unfortunately in my coding this function is not available in Ladder logic.
  Reply With Quote
Old June 23rd, 2012, 10:08 AM   #27
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 2,147
Quote:
Originally Posted by gryskop View Post
To the original OP this might be homework, but I had exactly the same problem with ControlLogix and RSLogix5000 software.

The Pushbutton in this case is an input signal from FactoryTalk. The operator needs to press a button to change the duty state of the duty controller.

In RSLogix the [One Shot] is an [ONS] object, but you can replace this with whatever your system allows.

X1 and X2 are two memory bits I use in my code. X2 will be the toggled bit you connect to whatever function you require.

A simple but effective bit of coding. Not my own though. Also had to ask somebody how they've done it in the past.


Pushbutton X1
---| |---------[One Shot]---------( )--

X1 X1 X2
--+--| |----+----+--|/|----+------( )--
| | | |
| | | |
| X2 | | X2 |
+--| |----+ +--|/|----+



I too would have used a D-Latch flip flop, but unfortunately in my coding this function is not available in Ladder logic.
Infortunately this logic will revert back to the "un-toggled" state in the event of power-loss, or a change from RUN to PROG and back to RUN, which I doubt is what you want to happen to the "duty" pump selection.

As I have stated already, a "toggle" should not be affected by any other event than the logic that drives it.

If you want a toggle to reset on restart, then program it in the start-up section of the code for all to see.....
__________________
___________________________
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 June 23rd, 2012, 08:41 PM   #28
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 2,147
Quote:
Originally Posted by daba View Post
Infortunately this logic will revert back to the "un-toggled" state in the event of power-loss, or a change from RUN to PROG and back to RUN, which I doubt is what you want to happen to the "duty" pump selection.

As I have stated already, a "toggle" should not be affected by any other event than the logic that drives it.

If you want a toggle to reset on restart, then program it in the start-up section of the code for all to see.....
Of course, for start/stop toggle circuits, you mostly WANT it to reset if the processor restarts, but not always... for some control (example : ventilation) it would be ok to restart automatically, others a definite no-no.

So the idea of using a common "toggle" (whichever way you do it), and having specific startup resets, actually documents or reinforces the reasoning behind why you are resetting specific toggles, in exactly the same way you sometimes have to write start-up code that resets or presets numerical data.
__________________
___________________________
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 June 23rd, 2012, 09:51 PM   #29
DwSoFt
Member
Canada

DwSoFt is offline
 
Join Date: Mar 2012
Location: Alberta
Posts: 202
Quote:
Originally Posted by daba View Post
Of course, for start/stop toggle circuits, you mostly WANT it to reset if the processor restarts, but not always... for some control (example : ventilation) it would be ok to restart automatically, others a definite no-no.

So the idea of using a common "toggle" (whichever way you do it), and having specific startup resets, actually documents or reinforces the reasoning behind why you are resetting specific toggles, in exactly the same way you sometimes have to write start-up code that resets or presets numerical data.
+1
i agree
  Reply With Quote
Old June 24th, 2012, 07:42 PM   #30
daba
Lifetime Supporting Member + Moderator
United Kingdom

daba is offline
 
daba's Avatar
 
Join Date: Jul 2004
Location: uk
Posts: 2,147
Quote:
Originally Posted by DwSoFt View Post
+1
i agree
glad someone else thinks like i do...
__________________
___________________________
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
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 06:42 PM.


.