I've been struggling to get an o code program to function on my machine, I 
keep getting errors when trying to call the numbered variables.

I'm attempting to write a program with a sub program that does some 
calculations based on inputs for #1-#6, the problem I'm having is assigning 
the variables to #1-#6 with the call, I wrote a quick example of what might 
be seen in a program and what I'm trying to accomplish.

It's frustrating that the help files are so difficult to follow, there are 
examples using binary operators but no explanation to what those binary 
operators are or mean(took an hour of searching to figure out what LT, GT, 
etc meant)

I'm trying to assign the variables in the call, or before the call, or at 
any point actually but I'm still struggling to make them stick

For example: o101 call #1=1.5 #2=.025 #3=.125 #4=50 #5=.25 #6=120


Can anyone help?

%
(tube welding)
G00 G17 G20 G40 G80 G90 G94 

(G28 G91 Z0)
G0 G54 X0 Y0 A0
G0 Z.1

(start weld sub-program)
o101 sub 
(tube weld on diameter)
(o101 call [diameter] [torch height] [surface speed] [torch intensity] 
[overlap] [offset angle])
(#1 is diameter of tube being welded)
(#2 is torch height above the tube)
(#3 is the surface speed, usually .125in/s)
(#4 is the torch intensity in percentage)
(#5 is the weld surface overlap)
(#6 is the angle offset to next weld)
(#7 is torch start height)
(#8 is the circumference of tube)
(#9 is the torch overlap factor)
(#10 is a feed rate factor, length times seconds)
(#11 is circumference calculation)
(#12 is the feed rate in inverse time)
(#13 is to replace 10, 11, 12)
#7=[#2 / 2]
#8=[3.14159*#1]
#9=[#5/#8]
#10=[[#3*60]/[3.14159*#1+#5]]
#11=[[#3*60]/[3.14159*#5]]
G1 Z[#7] F10 (torch start height)
M3 S[#4] (torch on at 40%)
G4 P1 (torch pre-flow and ramp up)
G1 G90 G54 Z[#2] F10
G93 G1 A[360 + [360 * [#5/#8]]] F[#10] (360+linear overlap)
M5 (torch off and ramp down)
G93 G1 A[360 + [360 * [2 * [#5/#8]]]] F[#11](continue travel for ramp down)
(G0 G90 G54 Z.1) (torch lift for better gas coverage)
G4 P5 (post flow timer)
G0 A360
G92 A[360 - #6] (start offset angle for next weld, 120 deg offset)
o101 endsub
(end weld sub program)


G0 X-.5
o101 call #1=1.5 #2=.025 #3=.125 #4=50 #5=.25 #6=120

G0 X-1
o101 call #1=1.5 #2=.025 #3=.125 #4=45 #5=.25 #6=120

G0 X-1.5
o101 call #1=1.5 #2=.025 #3=.125 #4=40 #5=.25 #6=120

G0 G54 G90 Z1.
G92.1 A0
G0 X0.
G28 G91 Z0
G53 G90 Y3
M30
%

Since you're wondering, I'm using M3 and M5 to turn the torch on and off 
and S to control intensity with a digital to analog converter.

-- 
website: http://www.machinekit.io blog: http://blog.machinekit.io github: 
https://github.com/machinekit
--- 
You received this message because you are subscribed to the Google Groups 
"Machinekit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
Visit this group at https://groups.google.com/group/machinekit.
For more options, visit https://groups.google.com/d/optout.

Reply via email to