M98 SUBPROGRAM CALL

deese

Deese
What should the program screen look like when I run a main program with sub calls? I single blocked it and it cursured down through the main to the last line,It ran the sub program but it did not load the program on the screen. It did not draw the toolpath in the work envelope. I think I had the syntax wrong,I had the work offset call on the same line as the sub call. I'm going out to retry that.
 

testyourdesign

testyourdesign
@deese

It might be easier for you to upload the subroutine code here so we can review it for you. I have not seen a video on this option yet but I was planning on doing one this weekend. I'll provide a link to that when I get it done if they have not resolved this for you by then.

Cheers, Stephen Brown
 

deese

Deese
Quote from testyourdesign on February 14, 2020, 10:43 am

@deese

It might be easier for you to upload the subroutine code here so we can review it for you. I have not seen a video on this option yet but I was planning on doing one this weekend. I'll provide a link to that when I get it done if they have not resolved this for you by then.

Cheers, Stephen Brown

Safety lines blah blah

G54

M98 P2

G55

M98 P2

M30

2.nc Is a program in the directory,that the P2 calls, 2.nc has M99 at the end

I dont think this has anything to do with why 2.nc does not display on the screen.
 

testyourdesign

testyourdesign
@deese

I managed to test the M98 and M99 codes on my G2 controller today.
  1. Sub-Programs do not display the G-Code on the F2 screen as you discovered.
  2. Using M98 P1 command runs the 1.nc program without any issues.
  3. Included a sub-sub-program using sequential M98 P# commands and different work offset within the 1.nc thru 4.nc programs and managed to run 1.nc through 3.nc without any issues but 4.nc never loaded..
  4. Also could not get the M99 program to return back to the previous program so I have the same problem as you discovered. I tried adding a carriage return after the M99 command but that made no difference.
  5. It appears that you can only call up one subprogram within each program. I originally had the main program structured so that it would call out each of the subprograms one at a time but that it only activated the first one in the program and hung. This issue might be related to the M99 problem.

This might be another bug within this version of the software that @masso-support needs to address or simply something wrong with my program.

I tested this function using V3.44 on a 3 axis G2 controller. Hopefully, @cncnutz or @masso-support will have time to check it for us.

Cheers, Stephen Brown
 

cncnutz

CNCnutz
Staff member
@testyourdesign


Hi Stephen

If you have a look at the Gcode in 1.nc to 4.nc you will see that you used G99 instead of M99 for the returns in all of your files and you also used G98 instead of M98 in 3.nc which is why it didn't run the 4th subroutine.

If you correct theses it will probably work for you. I haven't had a chance to test it myself but those are obvious errors I can see.

Cheers Peter
 

testyourdesign

testyourdesign
@cncnutz

Thanks for checking the programs from my previous post. I updated them as you suggested and now they work perfectly. I deleted the old ones from the previous post and attached updated ones to this post in order to avoid confusion.

Here are some setup requirements for anyone wanting to try this out on their own. The code in the attached examples uses G54 through G59 work offsets that are spaced 0.5-inch apart along the X-axis and using a common Y and Z offsets for each of the work offsets in 1.nc through 4.nc. Two versions are included here to show how it's possible to call up the subprograms in either the main program or sequentially in any one of the subprograms.

The end result is a simple engraving of the word MASSO. It was fun testing out this powerful G-Code feature with my Masso G2 controller. I hope this helps other Masso users!

Cheers, Stephen Brown
 

Attachments

  • SUB-PGM-A.zip
    1.1 KB · Views: 32
  • SUB-PGM-B.zip
    1.1 KB · Views: 27

deese

Deese
I didn't have time to play around anymore,I just changed the work offset manually and made some parts. I'm sure it will work fine though, maybe tomorrow I will try it. What I liked most was the main program is very short,and easily edited to use what ever program you like. So I would just keep it on the USB drive and any of your program could be ran as a sub in seconds. I would even bet that an m99 before the m30 in a program wouldn't cause a problem if you were running it stand alone but I should probably test that.
 

hamish

Hamish
If I wanted to run the same program 20 times in 20 different spots is this possible to do



eg run a sub program then reset to a new position then run it again, how many times is this possible



Do I need to change the original program (sub program) to add a M98 at the end instead of a m30 stopping it? I have added the next new position to commence the holes at the end of the program just not sure how to go about this.
 
Top