need to convert conventional gcode in vbscript for mach3


Results 1 to 2 of 2

Thread: need to convert conventional gcode in vbscript for mach3

  1. #1
    Registered
    Join Date
    Jan 2013
    Location
    canada
    Posts
    7
    Downloads
    0
    Uploads
    0

    Default need to convert conventional gcode in vbscript for mach3

    i have this script that i want to use with a laser probe, i am trying to scan a kite board, usually with linux cnc, you open this script as a gcode but with mach3, it doesnt like it.

    the script generate a text file that i can open in a open source program call boardcad.

    here is the script if someone can help me:

    g21
    f1000

    (#1=0) (x start)
    (#2=3190) (x end)
    #3=20 (nr of segments; 20)
    #4=[[#2-#1]/#3] (x step)

    #5=-268.5 (y center)
    #6=10 (nr of points; 10)
    #7=10 (y step)

    #8=-36 (z safe)
    #9=10 (z probe)

    #10=0 (current x)
    #11=0 (current y)
    #12=0 (current z)

    #13=0 (previous z)
    #14=0 (step size y)

    #15=-100 (y safe)
    #16=-100 (z probe outline)

    #18=1110 (x-value between support / approximately center of board)



    O100 sub (subroutine find apex for cross section scan)

    g38.2 z#9

    o101 while [0 lt #5070]
    g38.4 y#15 f5000
    #10=#5061
    #11=#5062
    #12=#5063
    g38.3 z[#12-50] f1000
    o101 endwhile

    O100 endsub



    (search for tail and nose)

    g0 z#8 a45
    g0 x#18 y#5

    g38.2 z#9

    o6 while [0 lt #5070]
    g38.4 x0 f5000
    #10=#5061
    #11=#5062
    #12=#5063
    g38.3 z[#12-50] f1000
    o6 endwhile

    g0 x[#10-10]
    g38.2 x#18

    #1=[#10+5]
    #17=#5063 (start y, used for outline)

    g0 z#8
    g0 x#18 y#5
    g38.2 z#9

    o7 while [0 lt #5070]
    g38.4 x3500 f5000
    #10=#5061
    #11=#5062
    #12=#5063
    g38.3 z[#12-50] f1000
    o7 endwhile

    g0 x[#10+10]
    g38.2 x#18

    #2=[#10-5]

    #4=[[#2-#1]/#3] (x step)


    #10=#1
    g0 z#8
    g0 x#1 y#5

    (PROBEOPEN bottom_rocker.txt)

    g38.2 z#9

    g0 z#8
    g0 x[#10 + 20]
    g38.2 z#9

    o1 while [#10 lt [#2-#4/4]]

    #10=[#10+#4]
    g0 z#8
    g0 x#10

    g38.2 z#9

    o1 endwhile

    g0 z#8
    g0 x[#10 - 20]
    g38.2 z#9


    (PROBECLOSE)



    g0 z#8
    g0 x#1 y#15
    g0 z#17

    #10=#1

    (PROBEOPEN outline.txt)

    g38.2 y#5

    g0 y#15
    g0 x[#10 + 20]
    g38.2 y#5

    o2 while [#10 lt [#2-#4/4]]

    g38.4 z#8 (probe for apex)
    #17=#5063

    #10=[#10+#4]
    g0 y#15

    o8 if [#5061 GT #18]
    g0 x#10 z[#17-80]
    o8 else
    g0 x#10 z[#17-40]
    o8 endif

    g38.2 y#5 (probe for outline)

    o2 endwhile

    g0 y#15
    g0 x[#10 - 20]
    g38.2 y#5

    (PROBECLOSE)

    g0 z#8
    g0 x[#1+304.8] y#5

    M1 (wait if user wants to prepare board)

    O100 call

    g0 y[#5062+10]
    g38.2 y#5

    g0 z#8


    #10=#5061
    #11=#5062
    #12=#5063

    #7=[[#11-#5]/#6] (y step)

    (PROBEOPEN bottomrail1.txt)
    g38.2 z#9

    o23 while [ #5062 gt [#11-#7]]
    g0 z#8
    g0 y[#5062 - 3]
    g38.2 z#9
    o23 endwhile

    o3 while [ [#5+#7/2] lt #11]

    #11=[#11-#7]
    g0 z#8
    g0 y#11

    g38.2 z#9

    o3 endwhile

    (PROBECLOSE)

    g0 z#8
    g0 x[[#1+#2]/2] y#5

    M1 (wait if user wants to prepare board)

    O100 call

    g0 y[#5062+10]
    g38.2 y#5

    g0 z#8


    #10=#5061
    #11=#5062
    #12=#5063

    #7=[[#11-#5]/#6] (y step)

    (PROBEOPEN bottomrail2.txt)

    g38.2 z#9

    o24 while [ #5062 gt [#11-#7]]
    g0 z#8
    g0 y[#5062 - 3]
    g38.2 z#9
    o24 endwhile

    o4 while [ [#5+#7/2] lt #11]

    #11=[#11-#7]
    g0 z#8
    g0 y#11

    g38.2 z#9

    o4 endwhile

    (PROBECLOSE)


    g0 z#8
    g0 x[#2-304.8] y#5

    M1 (wait if user wants to prepare board)

    O100 call

    g0 y[#5062+10]
    g38.2 y#5

    g0 z#8


    #10=#5061
    #11=#5062
    #12=#5063

    #7=[[#11-#5]/#6] (y step)

    (PROBEOPEN bottomrail3.txt)

    g38.2 z#9

    o25 while [ #5062 gt [#11-#7]]
    g0 z#8
    g0 y[#5062 - 3]
    g38.2 z#9
    o25 endwhile

    o5 while [ [#5+#7/2] lt #11]

    #11=[#11-#7]
    g0 z#8
    g0 y#11

    g38.2 z#9

    o5 endwhile

    (PROBECLOSE)

    g0 z#8


    (finished scanning bottom)
    #8=400 (z safe)
    g0 z#8

    g0 x#2 y#5 (place probe over nose)
    M0 (wait for user to turn board)
    g0 x#1 y#5 (place probe over tail)
    M0 (wait for user to place board)

    g0 x#2 y#5 (place probe over nose)
    M1 (optionally wait for fine tuning)
    g0 x#1 y#5 (place probe over tail)
    M1 (optionally wait for fine tuning)

    (scanning deck)

    #10=#1
    g0 z#8
    g0 x#1 y#5

    (PROBEOPEN deck_rocker.txt)

    g38.2 z#9

    g0 z#8
    g0 x[#10 + 20]
    g38.2 z#9

    o11 while [#10 lt [#2-#4/4]]

    #10=[#10+#4]
    g0 z#8
    g0 x#10

    g38.2 z#9

    o11 endwhile

    g0 z#8
    g0 x[#10 - 20]
    g38.2 z#9

    (PROBECLOSE)



    g0 z#8
    g0 x[#1+304.8] y#5

    M1 (wait if user wants to prepare board)

    O100 call

    g0 y[#5062+10]
    g38.2 y#5

    g0 z#8


    #10=#5061
    #11=#5062
    #12=#5063

    #7=[[#11-#5]/#6] (y step)

    (PROBEOPEN deckrail1.txt)
    g38.2 z#9

    o33 while [ #5062 gt [#11-#7]]
    g0 z#8
    g0 y[#5062 - 3]
    g38.2 z#9
    o33 endwhile

    o13 while [ [#5+#7/2] lt #11]

    #11=[#11-#7]
    g0 z#8
    g0 y#11

    g38.2 z#9

    o13 endwhile

    (PROBECLOSE)

    g0 z#8
    g0 x[[#1+#2]/2] y#5
    M1 (wait if user wants to prepare board)

    O100 call

    g0 y[#5062+10]
    g38.2 y#5

    g0 z#8


    #10=#5061
    #11=#5062
    #12=#5063

    #7=[[#11-#5]/#6] (y step)


    (PROBEOPEN deckrail2.txt)

    g38.2 z#9

    o34 while [ #5062 gt [#11-#7]]
    g0 z#8
    g0 y[#5062 - 3]
    g38.2 z#9
    o34 endwhile

    o14 while [ [#5+#7/2] lt #11]

    #11=[#11-#7]
    g0 z#8
    g0 y#11

    g38.2 z#9

    o14 endwhile

    (PROBECLOSE)


    g0 z#8
    g0 x[#2-304.8] y#5
    M1 (wait if user wants to prepare board)

    O100 call

    g0 y[#5062+10]
    g38.2 y#5

    g0 z#8


    #10=#5061
    #11=#5062
    #12=#5063

    #7=[[#11-#5]/#6] (y step)


    (PROBEOPEN deckrail3.txt)

    g38.2 z#9

    o35 while [ #5062 gt [#11-#7]]
    g0 z#8
    g0 y[#5062 - 3]
    g38.2 z#9
    o35 endwhile

    o15 while [ [#5+#7/2] lt #11]

    #11=[#11-#7]
    g0 z#8
    g0 y#11

    g38.2 z#9

    o15 endwhile

    (PROBECLOSE)

    g0 z#8

    M2

    Similar Threads:


  2. #2
    Member
    Join Date
    Feb 2006
    Location
    United States
    Posts
    338
    Downloads
    0
    Uploads
    0

    Default Re: need to convert conventional gcode in vbscript for mach3

    It isn't clear if this is one program on your machine or several but no program numbers to tell when one ends and another starts.
    A quick look at the code and your problems might be in a few areas. I havn't used Mach3 so you will have to look into these to be sure.

    G38.2 G38.2 and G38.4 What is that on the original machine? Macros for the actual probing? I do not see nay output, is that included in this as well?
    While... EndWhile loops. Check the syntax and how Mach3 does loops. I know this would not work on a fanuc...
    O100 Call Looks like a sub call. Again check Mach3 sub call syntax?



Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

need to convert conventional gcode in vbscript for mach3

need to convert conventional gcode in vbscript for mach3