try
Dobutton(13)
Hey guys, I'm working on a rather unique 5 axis dispensing machine and am still quite new to Mach and VB, so I'm having a difficult time with what is probably a simple problem. I have a dispenser controlled by my C-axis that is moved in and out of the work area via a linear actuator. This actuator is moved into place with the M-command M802 (switching output 1). My goal is to have the C axis reset to zero every time the actuator is activated. This is to simplify the g-code when programming the dispenser; Rather than accumulating a larger and larger value each time a small amount of fluid is dispensed, we want to start from zero each time. Can anyone help me with a VB script or any other approach to make my C axis zero each time I activate M802?
My M802 script currently looks like this:
ActivateSignal(output1)
code("G4 P1")
I just need some help on what lines to add to set the C axis to zero!
I would rather keep it simple. You will want to move the C axis incramental. So the g-code would look something like:
G91
C .01 f1.
G90
This way, you could move the actualtor back to the start when you are done. No need to reset zero. The C axis will move the set amount each time not a known postion each time.
Jim.