Page 1 of 1

Trying to set up an M98 sub-routine

PostPosted: Sun Nov 17, 2024 1:42 am
by bhdavis
I've created a new file M3100. The contents of that file first turn on the table vac (M7), then call up M31 to probe and then finally turn off the table vac (M9).

I don't fully understand the P parameter and how to use it. You can see below I've tried to make the file work a number of ways, commenting different lines in and out.

I thought I would just use:

M98 M31

as I think I would have years ago on my old WinCNC control. Then I found the P parameter and started experimenting with it. No luck so far. Just "error in code" messages.

I guess a main question is if I leave the M31.txt file as it is or copy/paste it to just 31.txt or P31.txt. I'm a bit lost as nothing so far has worked.

All that does work is the M7 and M9 lines if I comment out all the various attempts at the M98 call.



exec.Code("M7"); // VAC AND DUST COLLECTOR ON

Exec.Code("M98 P31");

// Exec.Code("M98 M31");

// M98 M31

M98 P31

exec.Code("M9"); // VAC AND DUST COLLECTOR OFF

Thanks,
BH

Re: Trying to set up an M98 sub-routine

PostPosted: Sun Nov 17, 2024 9:22 am
by RsX
Have you tried just calling the M31 macro?
Code: Select all
exec.Code("M31");

Re: Trying to set up an M98 sub-routine

PostPosted: Sun Nov 17, 2024 9:44 am
by bhdavis
No. I'll give it a try.

...............................................

Well, well. There was a lesson to be had in that. At first the

Exec.Code("M31");

still gave me an error message. Then I looked more closely and realized I'd typed it with a capital E. I changed that to lower case and problem was solved.

exec.Code("M31");

So an M98 is the wrong attack here plus I had a capital E in my testing instead of a lower case e. I should have realized that last night. I used to use M98 to call up cut files, not M-codes. It was right in my face that your suggestion was the answer. I'll just use the excuse that it was at night and my brain was tired...........chuckle.

Thanks,
BH