Codelist sub routines :-(

If you think you've found a bug post it here.

Codelist sub routines :-(

Postby Battwell » Sun Jun 04, 2023 9:35 pm

I have a fully working program using vars and a sub routine that runs fine.

When I run it in a macro with codelist ( exactly same program) but vars are given in the macro
It only moves on 1 axis .
It’s a simple spiral down move using g3 and j

I have put status messages in to confirm the vars are set the same as originals I used .

https://youtu.be/OgP-XrV4Cwk
This is what it should do

Is there any limitations with codelist ?
Uc300eth on router and mill.
UK uccnc powered machine sales. https://cncrouter.uk/atc-cnc-routers.htm
Automateanything/duzzit cnc/mercury cnc
Battwell
 
Posts: 867
Joined: Sun Sep 25, 2016 7:39 pm
Location: South Wales. Uk

Re: Codelist sub routines :-(

Postby Battwell » Mon Jun 05, 2023 9:13 am

ok... seems codelist doesnt like the subroutine.

gives error m99 could not read if i rem out the m30 as below.

:-(

back to the drawing board for how im going to get this job done

List<string> codelist = new List<string>();
codelist.Add("G91");
codelist.Add("g91 g1 x0 y#22 f300"); //moveout
codelist.Add("g90 g0 z#23"); // work height
codelist.Add(" M98 P001 L5"); //call sub 5 times
codelist.Add("g91 g1 y#21 f#24"); //movein
codelist.Add("g90 g0 z#18"); // rapid height
//codelist.Add(" m30");

codelist.Add("O001");
codelist.Add("G91");
codelist.Add("g91 g3 j#21 z#25 f#24");
codelist.Add("M99");


exec.Codelist(codelist); //Execute the List of g-codes.
Uc300eth on router and mill.
UK uccnc powered machine sales. https://cncrouter.uk/atc-cnc-routers.htm
Automateanything/duzzit cnc/mercury cnc
Battwell
 
Posts: 867
Joined: Sun Sep 25, 2016 7:39 pm
Location: South Wales. Uk

Re: Codelist sub routines :-(

Postby cncdrive » Mon Jun 05, 2023 11:17 pm

Yes, i think this is a limitation we did not even think about.
And it happens because the subroutine must be at the end of the main g code program and the end of the program is defined with m30 or m47.
The same is with the codelist, the software looks for subroutines only after the main program end.
cncdrive
Site Admin
 
Posts: 4887
Joined: Tue Aug 12, 2014 11:17 pm

Re: Codelist sub routines :-(

Postby Battwell » Tue Jun 06, 2023 9:59 am

i dont find many limitations with uccnc. this would probably be the same on most "top end" controls.

this one was annoying as it took me ages to remember how to write a subroutine. :-)
once i had it working as code i thought it was going to be simple to just edit it into codelist.

i know its not a big thing as 99.99% of people wouldn't have ever attempted it .

its for the one button parametric machine that all runs from 1 macro.
i will think of another way :-)
Uc300eth on router and mill.
UK uccnc powered machine sales. https://cncrouter.uk/atc-cnc-routers.htm
Automateanything/duzzit cnc/mercury cnc
Battwell
 
Posts: 867
Joined: Sun Sep 25, 2016 7:39 pm
Location: South Wales. Uk

Re: Codelist sub routines :-(

Postby Vmax549 » Tue Jun 06, 2023 5:52 pm

HIYA Batwell. The problem with codelist and subs has been around as long as codelist has existed. I am probably the reason CodeList exists today

IF I were you I would create a Conditional Wizard to generate the needed Gcode program with the needed sub routine then simply run the code. It could easily be a one button process.

Just a thought, (;-) TP
Vmax549
 
Posts: 331
Joined: Sun Nov 22, 2015 3:25 am
Location: USA

Re: Codelist sub routines :-(

Postby Battwell » Tue Jun 06, 2023 10:39 pm

i got around it. for the spiral down i used a for i loop. no whileismoving{} after each line and it works ok ...on screen!

its been a fun thing to write. lots of for loops!
quick video below
will test on real machine tomorrow.

the screen will be very basic once finished. no dros etc. just 1 length box and a go button. the config screen will be on another tab- but hidden from idiots!

https://youtu.be/M8T4xY0tQFY
Uc300eth on router and mill.
UK uccnc powered machine sales. https://cncrouter.uk/atc-cnc-routers.htm
Automateanything/duzzit cnc/mercury cnc
Battwell
 
Posts: 867
Joined: Sun Sep 25, 2016 7:39 pm
Location: South Wales. Uk


Return to Report a bug

Who is online

Users browsing this forum: No registered users and 7 guests