Hello Guest it is April 20, 2024, 10:58:35 AM

Author Topic: Setting a button as a timed momentary switch  (Read 613 times)

0 Members and 1 Guest are viewing this topic.

Setting a button as a timed momentary switch
« on: February 06, 2021, 07:03:57 PM »
Hi all, I've been trying to set a momentary switch to turn on a vacuum table.

I have previously had two switches set as toggles. One was set as "ON' and would energise the output on the controller and subsequently energise the relay that controlled the "OPEN" vacuum solenoid at the table. Once pressed, this button would then need to be pressed again to turn off the output. The solenoid would remain in the "OPEN" state which was fine.
There was another button that operated the same way but in reverse. It would operate the "CLOSE" vacuum solenoid.
This system did work, but it did mean that there was potential for he both the "OPEN" and "CLOSE" solenoids to be energised at the same time, which is not ideal.

I found a post here https://www.machsupport.com/forum/index.php?topic=34968.0, that seemed to cover what I was trying to do, however I wasn't able to make it work.
I borrowed a bit of Daz the Gas' code and tried to get that working, but it looks like I'm missing some coding basics.

I was wondering of someone might be able to explain to me what I've done wrong.

I've attached a screenshot of the code I was trying to use.

Thanks

Re: Setting a button as a timed momentary switch
« Reply #1 on: February 06, 2021, 08:51:50 PM »
The PMC is the way! It is so good at this! 
Fixing problems one post at a time ;)

www.newfangledsolutions.com
www.machsupport.com
Re: Setting a button as a timed momentary switch
« Reply #2 on: February 11, 2021, 03:48:19 AM »
Thanks Brian, I'll give it a go.