Single button Start Stop latching logic

powder78

Member
Join Date
Jul 2007
Location
Ontario
Posts
2
Does anyone have a sample of logic using one button to start and the same button to stop an output. I am trying to do this in RSLogix 500 and due to the scan time, the method of programming I am trying to use isn't working. Just looking for some thoughts as I need to step back from this.

Thanks!
 
Does anyone have a sample of logic using one button to start and the same button to stop an output.

Yep.

to the scan time the method of programming I am trying to use isn't working

You reckon? You could slow your scan time down to 2 seconds ( if that is possible ), and then your solution may work. But then every thing else will be too slow responding.


Humuor aside, do a search for flip-flop, jk or the like. There is also another thread about 'WAS' bits, this may help also.
 
once.JPG
 
I0/0 . . . .B3/1. . . B3/0
----| |------|/|--------(L)

I0/0 . . . . . . . . . B3/1
----| |-----------------( )

B3/0 . . .O 1/0 . . . O 1/0
----| |----|/|----------(L)
. . . . . . . . . .|
. . . . . . . . . .| B3/0
. . . . . . . . . .+-----(U)

B3/0 . . . O 1/0 . . . O1/0
---| |-----| |----------(U)
. . . . . . . . . .|
. . . . . . . . . .| B3/0
. . . . . . . . . .+-----(U)

This should work, When I0/0 goes on it sets B0/0 It also = B3/1 so B3/0 cannot set again while button is pressed, this sets O1/0
& resets B3/0 but cannot reset B3/0 on any futher scan as O 1/0 is on
As B3/0 is reset on set of O 1/0 this cannot reset O 1/0
If button is released B3/1 is off but on the button I 0/0 being pressed again & the last rung is true reseting O 1/0
you could use the oneshot bit in slc but I showed standard logic for this purpose
If you used mitsubishi there is an alt command that sets a bit on rising pulse then resets it again on next rising pulse
 
Last edited:
Stealing parky's ladder - only reference the input once.


I0/0 . . . .B3/1. . . B3/0
----| |---+--|/|--------( )
|
|. . . . . . B3/1
+-------------( )

B3/0 O:1/0 O:1/0
--| |--------|/|---+---( )
|
B3/0 O:1/0 |
--|/|--------| |---+

 
Stealing parky's ladder - only reference the input once.

Also, you have avoided using Latch/UnLatch instructions, and have created your own 1-shot. The way to go, some PLC's may not have
a true 1-shot.....
 
XIC Button CTU C5:0 10 0
XIC C5:0.acc/0 OTE Output

Works well but retains it's state I think (its a while since I used it)
 
scottmurphy said:
Also, you have avoided using Latch/UnLatch instructions, and have created your own 1-shot. The way to go, some PLC's may not have
a true 1-shot.....



sssshhhh... he stole the rest from me but who's keeping score..:nodi:
 
scottmurphy said:
Also, you have avoided using Latch/UnLatch instructions, and have created your own 1-shot. The way to go, some PLC's may not have
a true 1-shot.....

I am not so sure that Latch/Unlatch, SET/RESET, or any available instructions should not be used.

Not sure exactly what a true one-shot is, maybe someone could define it. I do understand it is more desireable to have it trigger rising edge.

That said AB has ONS or OSR, AD has PD (positive differential), Simatic S7 (maybe S5 too) offers a PD (I think an ND too), GE has POSCOIL and NEGCOIL, Simatic/TI Softshop has a one-shot that uses the # sign. Unitronics has -}P|- positive edge transition. Those are the programs I have on this desktop, my laptop has more but think all them have some form of positive edge triggered contact or coil that is only on for one scan.

S7-200 has a toggle function.

The instruction may not be called one shot, it may be differential, transition, positive edge and may be a contact or a coil.

Since we are on the subject what brand(s) do(es) not have a one shot?

May start a thread about using latch/unlatch, five years ago there is no way I liked them but things change and not sure there is no reason they should not be used.
 
rsdoran said:
Not sure exactly what a true one-shot is, maybe someone could define it.

A one shot is usually accepted as something that is high for 1 scan only. Rising or Falling edge, whichever you want (S5 never had one, so S7 has two just to be flash).

one shots and latches have their uses and are a major pain in the @rse when they are abused.

Nothing worse than the timing issues you can get when someone falls in love with one shots.
 
I am not so sure that Latch/Unlatch, SET/RESET, or any available instructions should not be used.

Neither, except in this application, are they really needed?

Not sure exactly what a true one-shot is

I used a small PLC (programmable relay infact) recently, and I thought that it only had a pulse instruction, but have jsut double checked, and it does have a one-shot.

One shots and latches have their uses and are a major pain in the @rse when they are abused.

I use them also, but when they are required. If I can avoid them I will, unless there is an absolute need, and there are plenty of cases in some of my projects where I use them
 
re:

1button_on_off_.JPG



Politly this must be the world's shortest 1 button on-off lad. code!

This is the smartest code i ever done, i used in seweral applications and newer failed or timeouted...

But it uses 17bits instead of I/O's..

Savaş; (Thx. M. Emin Dinc)
 
Last edited:
Thanks to all...

I appreciate everyones input...I knew that there were a variety of ways to do this and according to the posts, there are quite a few.
Again...thanks a bunch.
 

Similar Topics

Hello everyone, been awhile since I've posted..... As the title suggests, using Crimson 3.1 software (Red Lion) I cant seem to figure out if its...
Replies
4
Views
1,695
Hi, So I have one push button(non-latch momentary) and would like use it to trigger two function sequences with the short press for primary...
Replies
3
Views
1,972
I've used the simple momentary switch toggle logic for a few decades now. Now I need to find logic that allows the toggling to latch/unlatch a...
Replies
26
Views
9,798
I'm a beginner in PLC education, struck with a problem. Anyone can please help. The problem is: I have a single push button. When I press &...
Replies
30
Views
15,181
Hello, I have a SLC5/05 and am having problems writing code for a pushbutton (momentary) to start and stop a process. The problem is this... Due...
Replies
20
Views
15,988
Back
Top Bottom