Can I send a z-probe gcode set in one onclick command?

I’m using the tinyweb pendant for cnc.js and I’ve modified it to move the buttons around and add new buttons. I access it via my phone.

The z-probe command set as per the desciption for the Tiny Touch Plate is:
G28 Z
G92 Z0.5
G0 Z5 F480

This is an example of a button that would trigger the Z-Probe

                <div class="col-xs-2">
                    <button
                        type="button"
                        class="btn btn-default"
                        title="G92 Z0"
                        onclick="cnc.controller.command('gcode', 'G28 Z')">
                        Z Probe
                    </button>
                </div>

To do all 3 in one go I tried variations on this:

                <div class="col-xs-2">
                    <button
                        type="button"
                        class="btn btn-default"
                        title="G92 Z0"
                        onclick="cnc.controller.command('gcode', 'G28 Z|G92 Z0.47|G0 Z5 F480')">
                        Z Probe
                    </button>
                </div>

I can’t get that to work. It only triggers the auto home command so I’ve broken it up into 3 buttons for now.
Does anyone have any suggestions on a way to probe that can be triggered with a single onclick?

Is this what you need?

Cncjs

1 Like

Not quite…
I have done that already:

I am trying to do the same thing using the tinyweb pendant.
This is my phone screen:

As you can see I have broken up the commands into 3 buttons on the bottom

I may have an alternative that I will try out. I might be able to set a macro at startup to M810 and then just call M810

I’ll see if that works.

Sorry, I haven’t used that web app.
Could you remove comments in the script, in some programs it gives problems?

G28 Z
G92 Z0.47
G0 Z5 f480

I’ve only got the comments in the full app. The tinyweb code has no comments.
I’ll try the macro route later today.
That might be the simplest if the macro definition sticks.

I don’t know anything about the apps you are listing, but if you are modifying the source (JS) to set up the g-code command, you can do it like this:

G28 Z\nG92 Z0.5\nG0 Z5 F480

1 Like

Success!!!
That worked perfectly! :tada: :partying_face:

Thanks all for the help!

1 Like

I think my first post didn’t show the code I was using properly and was actually trying to render the button. I’ve edited it to be a preformatted text.
Sorry for any confusion!