View Full Version : Please help with small CNC jogging program


loco
06-03-2006, 12:21 PM
I have just started out in trying to write a visual basic program to toggle the pins on the printer port and use direction buttons to jog 3 axes around.

I have managed to read/write the port, use buttons to move a step/direction board i put together (orbit picstep) but i am having some problems with finding a good way of timing, im using sleep function in kernel32 from a different thread but that seems to freeze the whole program rather than just time the pulses.

to get to the point i dont know how i would do something so, that when i click a direction button it steps once, but if i click and hold it continuously, say after 1 second it will start to jog at a defined timing?

I use visual basic 6 and the files are zipped so anyone can have a look and help me out..

Thanks,
Mike

fkaCarel
06-03-2006, 12:37 PM
The buttons have mouse up and mouse down properties. So you can start a vbtimer to generate pulses by button_mouse_down and disable the timer with button_mouse_up. For pulse accuracy and frequency: don't expect heaven. I don't read programs of other people, I've trouble enough reading my own.

Carel

Switcher
06-04-2006, 09:47 AM
Look at the last link, on the list. Hope it helps. :)



http://www.boondog.com/tutorials/dlltutor/dlltutor.htm

http://www.boondog.com/page1/page1.htm

http://www.pages.drexel.edu/~pyo22/mem800WebPage.html

http://www.pages.drexel.edu/~st95dwng/Project.html

http://www.pages.drexel.edu/~st95dwng/vbcode1.html




.

Switcher
06-04-2006, 09:57 AM
I think this guy has more info than Google!

http://www.beyondlogic.org/

loco
06-04-2006, 11:05 AM
Wow! i couldnt find anything this good on google, im about to go to sleep for tonight, i will have a good read tomorrow for sure!
thanks guys, ill see how i go..

Switcher
06-06-2006, 10:53 AM
Google tip.

Most sites link to other sites that share the same subject, when you find an interesting site (on Google) try this.

In the Google search add this before any website address ( link: ), so If I search, ( link:http://www.cnczone.com ) in a google search. It will display every website that connects to cnczone, that is listed with Google. :)

That should produce better hits.


.

frog
12-07-2007, 09:09 AM
The buttons have mouse up and mouse down properties. So you can start a vbtimer to generate pulses by button_mouse_down and disable the timer with button_mouse_up. For pulse accuracy and frequency: don't expect heaven. I don't read programs of other people, I've trouble enough reading my own.

Carel

I have used VB timer not fast enough pulse, try RS timer it is a little faster but still not fast enough. kernel timer seems to be the way to go like you are.