Move machine to coordinate

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

Move machine to coordinate

Postby zapbrannigan » Tue Aug 17, 2021 12:31 pm

I have a laser crosshair which I use to find the corner of my workpiece. How do I get the x and y axis to move back a predefined amount?
So as an example, when I have visually found the edge, press a button and x moves back 10mm and y moves -7mm.

Thanks.
zapbrannigan
 
Posts: 17
Joined: Mon Aug 09, 2021 6:21 am

Re: Move machine to coordinate

Postby dezsoe » Tue Aug 17, 2021 1:18 pm

Switch to relative distance mode, move, switch to absolute distance mode.

Code: Select all
List<string> codelist = new List<string>(); //Create a new List of strings.
codelist.Add("G91"); //Add g-code lines to the List.
codelist.Add("G0 X10 Y-7");
codelist.Add("G90");
exec.Codelist(codelist); //Execute the List of g-codes.
while (exec.IsMoving());
dezsoe
 
Posts: 2093
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Move machine to coordinate

Postby zapbrannigan » Tue Aug 17, 2021 7:33 pm

Cool. Thanks.
So I need to place a new button on the screen and assign that code to it?

dezsoe wrote:Switch to relative distance mode, move, switch to absolute distance mode.

Code: Select all
List<string> codelist = new List<string>(); //Create a new List of strings.
codelist.Add("G91"); //Add g-code lines to the List.
codelist.Add("G0 X10 Y-7");
codelist.Add("G90");
exec.Codelist(codelist); //Execute the List of g-codes.
while (exec.IsMoving());
zapbrannigan
 
Posts: 17
Joined: Mon Aug 09, 2021 6:21 am

Re: Move machine to coordinate

Postby dezsoe » Tue Aug 17, 2021 9:01 pm

Yes.
dezsoe
 
Posts: 2093
Joined: Sun Mar 12, 2017 4:41 pm
Location: Csörög, Hungary

Re: Move machine to coordinate

Postby zapbrannigan » Wed Aug 18, 2021 7:58 am

What does the hashtag mean? codelist.Add("#5 = 12.23");

Taken from the help file in UCCNC folder:

List<string> codelist = new List<string>(); //Create a new List of strings.
codelist.Add("G0 Z-25"); //Add g-code lines to the List.
codelist.Add("M3");
codelist.Add("G1 X0 Y0 F500");
codelist.Add("#5 = 12.23");
codelist.Add("G1 X#5 Y2");
exec.Codelist(codelist); //Execute the List of g-codes.

EDIT: nevermind. It looks like a constant declaration. Thats what Im going with anyway.
zapbrannigan
 
Posts: 17
Joined: Mon Aug 09, 2021 6:21 am


Return to General discussion about the UCCNC software

Who is online

Users browsing this forum: No registered users and 12 guests

cron