Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: tony978 on June 08, 2019, 08:56:09 AM

Title: is there digitizing and point cloud in mach 4 ?
Post by: tony978 on June 08, 2019, 08:56:09 AM
I was wondering if there was  digitizing in mach 4 , I can't find anything on it besides stuff for mach 3 . I want to probe my run out on my 4th axis .
Title: Re: is there digitizing and point cloud in mach 4 ?
Post by: smurph on June 14, 2019, 01:28:18 PM
There is digitizing.  You can generate a point cloud with G31 in combination with some API functions.

Using the probe data file routines.
number rc = mc.mcCntlProbeFileOpen(number inst, string filename, string format)
The format argument is a printf style format with expanding macros for the axis values. AXIS_X, AXIS_Y, AXIS_Z, AXIS_A, AXIS_B, AXIS_C. It is used in the following manner:

rc = mc.mcCntlProbeFileOpen(inst, "myProbeFile.csv", "%.4AXIS_X, %.4AXIS_Y, %.4AXIS_Z")
This will produce a probe file in CSV format like so:

1.0000, 2.0000, -1.4356
1.0100, 2.0000, -1.4343
1.0200, 2.0000, -1.4324
...

A format of "X%.4AXIS_X, Y%.4AXIS_Y, Z%.4AXIS_Z" would yield:

X1.0000, Y2.0000, Z-1.4356
X1.0100, Y2.0000, Z-1.4343
X1.0200, Y2.0000, Z-1.4324
...

A format of "X%.4AXIS_X\tY%.4AXIS_Y\tZ%.4AXIS_Z" would yield a tab delimited file:

X1.0000 Y2.0000 Z-1.4356
X1.0100 Y2.0000 Z-1.4343
X1.0200 Y2.0000 Z-1.4324
...

To close the probe data file, use:
number rc  = mc.mcCntlProbeFileClose(number inst)

Steve