One button -two outputs

More
9 years 8 months ago #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?

Please Log in to join the conversation.

More
9 years 8 months ago #88092 by bevins
Replied by bevins on topic One button -two outputs
I'll try with a counter.

Please Log in to join the conversation.

More
9 years 8 months ago #88099 by cmorley
Replied by cmorley on topic One button -two outputs
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

Please Log in to join the conversation.

More
9 years 8 months ago #88113 by BigJohnT
Replied by BigJohnT on topic One button -two outputs
You might use this single button toggle as a base for your needs.

Attachment not found



JT

Please Log in to join the conversation.

More
9 years 8 months ago #88114 by BigJohnT
Replied by BigJohnT on topic One button -two outputs
And a complete example that alternates between two outputs and only has them on for the duration of the timer.

Attachment not found



JT

Please Log in to join the conversation.

More
9 years 8 months ago #88277 by bevins
Replied by bevins on topic One button -two outputs
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.

Please Log in to join the conversation.

More
9 years 8 months ago #88281 by cmorley
Replied by cmorley on topic One button -two outputs
switch bounce?

Please Log in to join the conversation.

More
9 years 8 months ago #88305 by bevins
Replied by bevins on topic One button -two outputs

cmorley wrote: switch bounce?


I got bounce!!!!

lol.... Got Bounce?

Please Log in to join the conversation.

More
9 years 8 months ago #88308 by bevins
Replied by bevins on topic One button -two outputs

cmorley wrote: switch bounce?


I shortened the delay drastically and it seemed to have worked.

Please Log in to join the conversation.

Time to create page: 0.548 seconds
Powered by Kunena Forum