Example of Macro using JavaScript in gSender?

I’ve been investigating a simple probing idea for measuring relief of guitar or bass necks. I can see the gcode primitives to build it out of, and I can see the macro facility in gSender, and I noted that writing Javascript code in a macro seems to be supported. But that appears to be where the useful information flow ends, at least from what I’ve found so far.

Is there an example somewhere of a gSender macro using Javascript, most usefully on that captures data from the machine into the host? I’m a programmer by trade, so once I get started, I’ll be in good shape.

@NeilFerreri

Hmmm… Are you looking to bring 3d mesh data back into a modeling program?
I haven’t used it, but I’d look at Height scan < GRBL-Plotter

@NeilFerreri I’m thinking of something much simpler. I would align the neck with the X axis and secure it in the CNC router. Then I’d choose several points - let’s say 8 or so but up to 20 - along the X axis where I would like to measure Z. The points would be chosen programmatically, so that the probe would “touch down” between certain frets. I’d like to capture the Z for those points and save to a file. I can then load that file into an external program I write to generate a relief curve. This simple program can be a tremendous research tool. I could measure in the center of the neck for average relief, or in other locations to evaluate assymmetric relief profiles. I hope this makes sense.

This could all be done pretty simply with G38 commands and the right primitives to capture the z positions back into the host code in Javascript. The missing info is a simple example host program using Javascript which interacts with the control box and captures z positions after issuing G38 commands.

I see. I think you can export probe data from bcnc. Might be easier for infrequent use to just print manually or write a macro and record the points.
Have you seen this?

Interesting. I think I would write that part myself. I’ve already programmatically generated what I believe to be a first past at an “ideal” relief (i.e. camber) curve for stringed instruments. I’m encouraged because the results agree with my intuition. I’d like to test it against real life, which is why I’m exploring this idea. Of course it is only one aspect of evaluating the problem, but it is data that I have not been able to get thus far, hence my excitement about the subject.