change two variables between cut passes?

More
17 Aug 2020 20:55 - 17 Aug 2020 20:58 #178532 by jamby
Hi

I am looking for a way to make cutting a key from both sides easier. Currently I am just editing both values then reloading the file and executing.
If I could change a variable for the Y position it might be easier.

Here's the program

N100 G20 G17 G40 G49 G54 G80 G90 G94
N105 G64 P0.001
N110 G90.1
N115 M6 T1
N120 G1 X0 Y0.433 F12.
N125 G1 X-1.6 F5.
N130 G1 Y-0.433 F12.
N135 G1 X0 F5.
N140 G1 Y0.463 F12.
M30
%

The idea being line N120 and N130 would have a variable for the Y [0.433] position and a single change could be made that would effect both.
I am not sure if such a feature exists with in linuxcnc but I thought someone might know.
Thanks
Jim
Last edit: 17 Aug 2020 20:58 by jamby.

Please Log in or Create an account to join the conversation.

More
17 Aug 2020 23:26 #178552 by jamby
I did come across the following solution at gcodetutor.com/cnc-macro-programming/cnc-variables.html
So my new code looks like:

%
M6T4
#101=0.4675
(Variables)
N100 G20 G17 G40 G49 G80 G90 G94
N105 G64 P0.001
N110 G0 X0 Y-[#101] F20
N115 G1 Z0 F8
N120 X-2.125 F7
N130 G1 Y[#101] F20
N140 G1 X0 F7
N150 G1 Y-0.4375 F20
N155 Z0.2
N160 M30
%
So now I just edit the one line (#101=x.xxx) and my cut is centered about Y zero.
Progress any way.
Thanks
Jim

Please Log in or Create an account to join the conversation.

Time to create page: 0.063 seconds
Powered by Kunena Forum