Hello all, How was your Christmas? I think I took three naps and late last night I finished the MPG Translation part of my project!
I ended up using a different hook library and through the free visual basic studio 2008 download write a little app that translated my cw/ccw quadrature sequence into three buttons:
MPG Pulse - VKF0
MPG CW - VKF2
MPG CCW - VKF4
My VB app traps the events from the encoder so no window is confused by hundreds of key presses a second when the MPG is being spun. Now I am working on the final VBS script to tie this into Mach3 like this:
I put two buttons on the screen labled MPG CW and MPG CCW and assigned them the shortcut keys VKF2 and VKF4 then wrote a little if block like this:
If getORMLED(59) Then 'If X Axis Selected
doOEMButton(307) 'X+
End IF
But then I realized that while mach is in MPG control the standard jog buttons do not work anymore. So to test I removed the if and just kept the doOEMButton(307) and the same for the CCW button. Now I see what Chaoticone is talking about not stopping on release! If I move my MPG it will just move the axis untill it trips a limit or I estop... So now that I understand what Chaoticone is talking about Ive got some ideas on how to fix it.
In the meantime feel free to check out my 'code' below, I say code lightly as its about 8 if statements and thats it lol
----------------------------------------
Here Is my VB Studio ProjectEDIT:
I am thinking if making my own jog screen that I will have my X/Y/Z/A DRO's as well as a DRO for a MPG jog step size and axis selection. Sence I cannot jog in Mach's standard MPG mode im just going to make my own little version that accepts keyboard inputs instead.
Does anyone have any recommendations on what choices you find invaluable in MPG mode?