15. VisualBasic
®
macros
On our website: www.cs-lab.eu you can download standard scripts for automatic tool-length meas-
urement and for automatic tool change. These are usually the most desirable functions and make work
easier. We encourage advanced users to learn more about macros, which provide great opportunities for
self-expanding functionality of Mach3 program.
15.1 Automatic tool-length measurement
Automatic tool-length measurement is one of the most implemented function,
e.g. because mechanically it is very easy to do. If high measurement accuracy is
required, the sensor must be good quality. In CSMIO/IP-A controller – specialy for
G31 command (used during the measurement) – we implemented completely
autonomous movement operation and ultra-fast logic to assure measurement
precision at the highest level.
The measurement is made through the following stages:
• Raising Z axis at the maximum high (absolute zero)
• Going in a fast mode (G0) at XY sensor position.
• Quick exit (G0) by Z-axis to so-called - safe Z
• Going down in the measurement mode (G31) at "1" speed until signal receiving from the sen-
sor.
• Raising Z-axis with small value (preparing to more accurate measurement).
• Going down in the measurement mode (G31) at "2"speed, until signal receiving from the sen-
sor.
• After measurement is finished– raising Z-axis maximally.
CS- Lab s.c. – CSMIO/IP- A - CNC controller
Page 104