How to right sequence run - pause -stop

More
08 May 2011 02:14 #9646 by piasdom
cool thanks. i didn't know it would "make" a pin :)

Please Log in or Create an account to join the conversation.

More
08 May 2011 11:59 #9654 by BigJohnT
Yep, says so right here:

www.linuxcnc.org/docview/html/hal_pyvcp.html#r1_6_3

So it has gotta be true...

John

Please Log in or Create an account to join the conversation.

More
08 May 2011 15:51 #9658 by piasdom
i saw that but thought since i was creating pins in XML, it created the pin there also.
i need to start using the pyvcp section in the halui section better, don't think of looking there.
but this'll be a great reminder for me.
Thanks.

Please Log in or Create an account to join the conversation.

More
12 May 2011 10:06 - 12 May 2011 11:21 #9739 by piasdom
i find that the speed of my mouse click changes rather or not
the run/stop button works. below work except i get an error msg with the
stop. sometime i get an error msg with the run. no way to
change the effect of the mouse clicking ?


net run-prog pyvcp.run-prog == halui.program.run toggle.1.in halui.mode.auto
net stop-prog axisui.set-manual-mode == toggle.1.out halui.program.stop

or

net toggle pyvcp.run-prog and2.5.in0 halui.mode.auto halui.program.run
net stop and2.5.in1 halui.mode.manual
net run halui.program.stop and2.5.out
Last edit: 12 May 2011 11:21 by piasdom.

Please Log in or Create an account to join the conversation.

More
12 May 2011 12:04 #9742 by BigJohnT
My guess is you have set up a race track condition where sometimes it works and sometimes not. Each time you press pyvcp.run-prog halui.program.run is turned on... every other time halui.program.stop AND halui.program.run is turned on... so this is the source of your error.

The mouse click speed might be due to the race track condition where ever other press of the mouse EMC is trying to start and stop at the same time.

John

Please Log in or Create an account to join the conversation.

More
12 May 2011 13:12 #9759 by piasdom
"toggle" changes the value from true to false(or 1 to 0) without having to
have the opposite in the net connect ? i'm lost as to what toggle,
not, or and xor do. do they not change the state to the opposite of what
is being used? i tried to use not, but it slows emc a lot. changed back to
toggle and all is normal.
so i can just use halui.program.start and it will be toggled ?


net run-btn toggle.0.in == pyvcp.start-button
net stop-btn toggle.0.out == halui.program.run

Please Log in or Create an account to join the conversation.

More
12 May 2011 13:24 #9760 by BigJohnT
The not component reverses the logic of a pin.

So for example

net run-btn toggle.0.in <= pyvcp.start-button
net run-pgm toggle.0.out => halui.program.run
net run-pgm not.0.in
net stop-pgm not.0.out => halui.program.stop

The above "might" work as long as you don't stop the program via the esc key or the program has ended then your toggle is out of sync with EMC.

The only way it will really work is if your code only starts if the program is stopped and only stops if the program is running.

Is this just a mental challenge or do you really need a single input to be a run/stop button?

John

Please Log in or Create an account to join the conversation.

More
12 May 2011 13:36 - 12 May 2011 13:37 #9761 by piasdom
thanks, just a mental thing. it's how i learn. trial and error.(lots of errors)
been looking at classicladder, should i stay where i'm at for now.(your opinion).
can i use the ladder to get past where i'm at ?



p.s. plus i don't give up easily
Last edit: 12 May 2011 13:37 by piasdom.

Please Log in or Create an account to join the conversation.

More
12 May 2011 17:40 #9764 by BigJohnT
Ok, the only way I can see a start stop button working is to do something like the following. Component names might not be exact I'm shooing from the hip.

pyvcp.button > oneshot.0.in

oneshot.0.out > and2.0.in0 and2.1.in0

halui.is-running > and2.0.in1
halui.is-stopped > and2.1.in1

and2.0.out > halui.stop
and2.1.out . halui.run

Configure the oneshot like my pause resume example. The oneshot prevents from bouncing back and forth with run stop as each time you press the pyvcp button you only get one output pulse.

John

Please Log in or Create an account to join the conversation.

More
14 May 2011 13:29 #9804 by BigJohnT
Ok I was totally off the wall with the oneshot... must have been drinking :/

Take a look a the hal examples now for the pause resume.

It took a combination of toggle and 4 and2's to make it work...

John

Please Log in or Create an account to join the conversation.

Time to create page: 0.101 seconds
Powered by Kunena Forum