Welcome, Guest. Please login or register.
Did you miss your activation email?
May 26, 2012, 04:40:18 PM

Login with username, password and session length
Search:     Advanced search
* Home Help Search Calendar Links Login Register
+  Machsupport Forum
|-+  Mach Discussion
| |-+  General Mach Discussion
| | |-+  dispenser suckback script - incremental move in macro
Pages: 1   Go Down
Print
Author Topic: dispenser suckback script - incremental move in macro  (Read 265 times)
0 Members and 2 Guests are viewing this topic.
ASC
Active Member

Offline Offline

Posts: 64



View Profile WWW
« on: August 01, 2010, 02:02:09 PM »

Hey guys, doing my best at this VB programming thing but still quite new to it.  I'm using my C-axis as a fluid dispenser which is mounted on a linear actuator to move it in and out of the work area.  Currently, I have it set up as M802 to extend the actuator (output 2 in Mach) and M902 to retract it.  On the retract command, M902, I want to add a few lines to incrementally step the dispenser back a set amount.  Here is what my current script looks like:

'M902
'raises dispenser actuator
DeActivateSignal(Output2)
code("G91")
code(G01 C-.005 F50")
code("G90")

This script does work in testing, but I'm worried that the G91 command is going to affect the g-code I am running by switching it momentarily to incremental mode and then back to absolute.  Is there a way to make the g91 only affect the c-axis, or a way to momentarily inhibit movement on the other 5 axes?  It seems like there should be a really obvious solution here but I can't figure it out for the life of me!
Logged

Mr. Creosote
BR549
Active Member

Offline Offline

Posts: 2,553


View Profile
« Reply #1 on: August 01, 2010, 03:07:59 PM »

ASC, the way you are doing it IS the way it is done. Switching back and forth should have NO effect on accurary. You just have to make sure all your moves are correct.

The one thing you may want to consider is to add sleep() and  while ismoving() statements to insure the macro thread stays in sync with itself.

'M902
'raises dispenser actuator
DeActivateSignal(Output2)
Sleep(10)
code"G91"
Sleep(20)
code"G01 C-.005 F50"
While Ismoving()
Sleep(100)
Wend
code"G90"
sleep(20)
« Last Edit: August 01, 2010, 03:10:46 PM by BR549 » Logged
ASC
Active Member

Offline Offline

Posts: 64



View Profile WWW
« Reply #2 on: August 01, 2010, 03:17:18 PM »

thank you again!  You've cured both of my big headaches today!  If only I could email you a beer....
Logged

Mr. Creosote
Pages: 1   Go Up
Print
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.16 | SMF © 2011, Simple Machines Valid XHTML 1.0! Valid CSS!