1194
« on: May 03, 2015, 01:53:47 PM »
NO you CANNOT call a sub from a macro as it has nowhere to return to as the Gcode side cannot SEE the M98 that is in the macro. You will get an erro"SUB called with no return" But that does not mean you cannot redirect the end of the sub back to another Sub call line. basically back to the line after the macro. You just have to be clever.
SO more notes on Macros.
When you read or write to dros or variable give it a bit of sleep time to get it all done
SetOemDro(10,GetVar(24)) I use 100ms for each function(read/write)
sleep(300)
Group your motion code and use WHile Ismoving() to wait untill Mach3 is done with it. This will HOLD the macro until motion stops. Use it with ANY and all motion codes. Use it with a single call or a group call for motion.
Code"G0 X0Y0"
Code" X10"
Code" Y10"
Code"X0"
Code"Y0"
While Ismoving()
Wend
Hope that helps, (;-) TP