Trying to set up an M98 sub-routine

Post anything you want to discuss with others about the software.

Trying to set up an M98 sub-routine

Postby bhdavis » Sun Nov 17, 2024 1:42 am

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
bhdavis
 
Posts: 141
Joined: Tue Mar 23, 2021 7:36 pm

Re: Trying to set up an M98 sub-routine

Postby RsX » Sun Nov 17, 2024 9:22 am

Have you tried just calling the M31 macro?
Code: Select all
exec.Code("M31");
User avatar
RsX
 
Posts: 30
Joined: Fri Oct 25, 2024 9:22 pm

Re: Trying to set up an M98 sub-routine

Postby bhdavis » Sun Nov 17, 2024 9:44 am

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
bhdavis
 
Posts: 141
Joined: Tue Mar 23, 2021 7:36 pm


Return to General discussion about the UCCNC software

Who is online

Users browsing this forum: No registered users and 16 guests