Current position macro

This is where you talk about Macros, show examples of your macro scripting and SHARE handy segments of script code as examples.

Current position macro

Postby dequity11 » Sat Aug 27, 2022 8:59 am

G'day all,

I would like to know if it is possible to use a button driven macro to write the current machine position (G53) to say Park 1, 2 or 3? I currently do it by hand and it works well in that it has saved my bacon numerous time. In short. After homing my machine, I set up my 0,0,0 position, click a button that writes the coordinates to a text file (thanks to a macro I found here) so that they can be retrieved if anything goes wrong. I then edit Park 2 to reflect these machine positions. If the power fails or emergency stop etc, I simply home the machine, hit Park 2 and away I go. The macro would simply have to circumvent the manual editing of Park 2 text (macro) file and to it automatically.

Thanks and all the best,

Mirko
dequity11
 
Posts: 5
Joined: Sat Jul 30, 2022 10:23 pm

Re: Current position macro

Postby ger21 » Sat Aug 27, 2022 10:50 am

The easiest way to do it is to add fields to the screen for the coordinates, and write to those. Then modify the Park macro to use those coordinates.
Gerry
UCCNC 2022 Screenset - http://www.thecncwoodworker.com/2022.html
ger21
 
Posts: 2714
Joined: Sat Sep 03, 2016 2:17 am

Re: Current position macro

Postby dequity11 » Sat Aug 27, 2022 11:27 am

Hi Gerry,

Thanks for your response. This is pretty much what I currently do as described above but without any extra fields as the cordinates are all visible in any event. Iwould simply like to automate the process. Given the power of C# I have no doubt this can be done - just don't know how.
dequity11
 
Posts: 5
Joined: Sat Jul 30, 2022 10:23 pm

Re: Current position macro

Postby Battwell » Sun Aug 28, 2022 2:50 pm

if you have saved your offset in a given fixture. (g54,55,56etc)
just select the fixture and press go to zero?
(dont do this if zero is at the bottom of the part)
i edited the goto zero button to remove the final z moves to make this button safe to use! so only goes to x y zero.
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: Current position macro

Postby dequity11 » Tue Aug 30, 2022 12:25 am

Haha, I guess that's why I'm the newbie - so simple and thanks for the suggestion. What is the edit / macro I should be looking for to elliminate the z zero for a particular fixture- again, probably a newbie question?
dequity11
 
Posts: 5
Joined: Sat Jul 30, 2022 10:23 pm

Re: Current position macro

Postby Battwell » Tue Aug 30, 2022 5:22 pm

once you have selected a fixture. g54 to g59
set up your zero points in the normal way.
go to offsets screen and click save offsets.
now when you re start the fixture is saved for future use. (zeros at same point)
all you have to do is remember to select the fixture you want to use.
eg. i use this for a bolt down vice. i select fixture g59 and im ready to go.

fixtures will also auto save when you shut down the software correctly (not just switch the power off)
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 Macros

Who is online

Users browsing this forum: No registered users and 10 guests