One button -two outputs

More
16 Feb 2017 21:46 #88081 by bevins
I am trying to get when you push one button, one output fires momentary. Push the same button a different output fires momentary.

Basically it is a flip flop. the monostable is being depricated, so I have to try and do it with the new TM timers.

But classicladder if you have two outputs the same re: two Q4, it treats it as an and. push it once you get first output push it again you get the second output and only then would you get its child contact. With regulat PLC's you can have as many outputs and anyone of them fire you get the child contact.

So I am struggling with this. Anyone have such a ladder or can I do it in HAL?
More
17 Feb 2017 01:09 #88092 by bevins
I'll try with a counter.
More
17 Feb 2017 05:24 #88099 by cmorley
monostables are not going away anytime soon - maybe never.
classicladder in linuxcnc is so old and customized I would doubt it will ever be updated,
unless it can't be supported in a new library upgrade.
( I was the last one to port it into linuxcnc - two other versions were ported before that)

If you put the EIC timer in TP mode I believe it works the same as the mono.

This is similar to what you want I think:
wiki.linuxcnc.org/cgi-bin/wiki.pl?Classi...ret_indexing_counter

Chris M
More
17 Feb 2017 14:25 - 17 Feb 2017 14:25 #88113 by BigJohnT
You might use this single button toggle as a base for your needs.



JT
Attachments:
Last Edit: 17 Feb 2017 14:25 by BigJohnT.
More
17 Feb 2017 15:15 - 17 Feb 2017 15:16 #88114 by BigJohnT
And a complete example that alternates between two outputs and only has them on for the duration of the timer.



JT
Attachments:
Last Edit: 17 Feb 2017 15:16 by BigJohnT.
More
19 Feb 2017 16:48 #88277 by bevins
This kind of works but sometimes it doesn't flip it just energizes the same output. It will energize the same output twice and I cannot figure out why. The logic looks correct.
More
19 Feb 2017 18:11 #88281 by cmorley
switch bounce?
More
19 Feb 2017 22:06 - 19 Feb 2017 22:07 #88305 by bevins

cmorley wrote: switch bounce?


I got bounce!!!!

lol.... Got Bounce?
Last Edit: 19 Feb 2017 22:07 by bevins.
More
19 Feb 2017 23:03 #88308 by bevins

cmorley wrote: switch bounce?


I shortened the delay drastically and it seemed to have worked.
Time to create page: 0.194 seconds
Powered by Kunena Forum