core icon indicating copy to clipboard operation
core copied to clipboard

M98 or G65 support

Open gharbarka opened this issue 4 months ago • 4 comments

My setup is the latest grblHAL and iosender on a minimal Black Pill 411 driver board.

I am trying to understand how, or if, it is possible to call repetitive code either via subroutines (M98) or macros (G65).

If I have carried out my search properly, it would appear that M98 is not supported but G65 should be. M99, which is necessary to exit either is documented so it probably is. Yet I understand that M99 is only needed with M98 or G65 calls.

I have experimented with simple code which I have cut and pasted from the internet ( and therefore error free) and neither method seems to work.

In the first place, any subroutines( macros) which I put after the M30 command are not even loaded in iosender.

If I try to run the section of the code loaded, the program stops with an error when it reaches either command:

With M98, it reports that the Gcode is not recognised. With G65, it reports that the label is not found because of course all code after M30 are not loaded.

I understand if one generates Gcode via a CAD-CAM program this issue may not arise because that software generates as many sections of repetitive code as are needed.

Am I missing anything here? Or is there an alternative for hand coding?

Thanks

gharbarka avatar Sep 10 '25 13:09 gharbarka

Am I missing anything here?

This? Local file is local to the microcontroller, either on a SD-card or in littlefs. See also the second paragraph in the readme. M98 is not supported, however O-calls are.

terjeio avatar Sep 10 '25 14:09 terjeio

Phew!!! You gave me a lot to read.

first of all thank you for your speedy reply.

I have to say, as a virtual newbie, I am finding it hard to appreciate those links and will require me to read through again and again.

For example how are SD-Cards or littlefs implemented? I am guessing they don't apply to the Minimal F411 board setup. I have been reading mainly this link https://linuxcnc.org/docs/2.5/html/gcode/o-code.html but I cannot get any of the examples to work. It seems I may have to reprogram my board with the RS274 option and the Macros Plugin enabled. It is not clear how or if the former relates to my setup or indeed if the Macros plugin actually refers to Macros as available on the Front screen of Iosender or those which are setup with G65.

I appreciate the difficulties involved in trying to implement loops with setups as in Iosender/GrblHAL as compared with say Mach3.

A writeup by an expert to explain the concept is sorely needed. I wish there was a forum dedicated to Iosender/GrblHAL where one can ask questions about the mainy options possible without having to write here all the time. This is really an "Open Issues" area.

Regards

gharbarka avatar Sep 11 '25 14:09 gharbarka

For example how are SD-Cards or littlefs implemented?

You can see which boards has SD card support in the Web Builder by checking the Plugins tab. If SD card is greyed out then it is not available. Click on the [i] botton behind the SD card field to open a page with more info:

Image

It seems I may have to reprogram my board with the RS274 option and the Macros Plugin enabled.

These options are not required. There are two macros plugins (bad naming, I know) - the one that can be enabled in the Web Builder is for short macros linked to button presses. The one used for G65 and NGC macros is automatically installed alongside the SD card plugin if RS274 expressions is enabled (I may remove the RS274 expressions option and make it permanent).

I wish there was a forum dedicated to Iosender/GrblHAL where one can ask questions about the mainy options possible without having to write here all the time.

Discussions can be started here. If someone can start, and moderate, a forum somewhere (Reddit? Discord?) that would be nice. I do not have the bandwidth to do so myself.

terjeio avatar Sep 21 '25 06:09 terjeio

Thank you very much for taking time to reply. I have in fact checked out which boards can handle SDcards as you suggested. At this stage I don't consider it worth the effort to purchase another board simply to get access to these options.

As I said earlier my own board is a slightly modified Minimal Board based on the Weact Black Pill. This does not have an SDcard implemented.

WeAct however do produce another board based on the the STMF446 chip which does support SDcard. The cost of this is only marginally higher than the Black Pill. I was wondering what effort would be needed if one were to produce a Minimal Board based on this module instead.

Although I don't really need it, I would consider it a fun little project to build.

gharbarka avatar Sep 21 '25 09:09 gharbarka