586,070 active members*
3,561 visitors online*
Register for free
Login
IndustryArena Forum > CAM Software > BobCad-Cam > V21 scripting help
Results 1 to 4 of 4
  1. #1
    Join Date
    Jun 2010
    Posts
    0

    Question V21 scripting help

    If some one could help me with this script i would be very grateful.



    (This is the code that i am generating)


    G83 X0.201 Y0.2717 Z-1. Q0.125 R.1 F10.
    X0.1863 Y0.3832
    X0.2384 Y0.4498
    X0.2658 Y0.3777
    X0.4055 Y0.4197
    X0.3992 Y0.3055
    X0.2832 Y0.2571
    G80
    G00 G91 G28 Z0.
    M01

    (This is what i need)

    X0.201 Y0.2717
    Z.1
    G83 Z-1. Q0.125 R.1 F10.
    X0.1863 Y0.3832
    X0.2384 Y0.4498
    X0.2658 Y0.3777
    X0.4055 Y0.4197
    X0.3992 Y0.3055
    X0.2832 Y0.2571
    G80
    G00 G91 G28 Z0.
    M01





    This is my script

    'G73 G83 HAAS VF Peck drilling cycle

    NCEdit Output,Line = i

    dim R as string
    dim F as string
    dim Q as double
    dim Z as string

    Ask Header="Pecking Parameters",Output,Cancel=canc, "Hole Depth Z"=Z, "Peck amount Q;0"=Q, "Return R"=R, "Plunge Feed F"=F

    If canc Then
    Exit
    End If

    Generate

    NCEdit Line = i,Output,Text=txt

    pos = InStr(txt, "Z")

    If pos > 0 Then
    txt = left(txt, pos - 1)
    End If

    txt = txt+" Z"+Z+" Q"+Q+" R"+R+" F"+F
    NCEdit Line = i,Text=txt, Output, NumLines=nl
    NCEdit Line = nl+1

    Window2


    Attachment is my cycle


    If anyone can help that would be great.

  2. #2
    Join Date
    Jun 2010
    Posts
    0

    cycle attachment didn't work

    Cycle Menu




    NC lines first point:


    G83@c


    NC lines intermediate point:

    @c



    NC lines last point:

    @c
    G80
    G00 G91 G28 Z0.
    M01





    NC lines for one point:

    G83@c
    G80
    G00 G91 G28 Z0.
    M01

  3. #3
    Join Date
    Mar 2005
    Posts
    368
    Try this, but I have to ask, do you really want to send the Z home after each drill cycle? Seems unhandy if you need to drill multiple patterns.
    (also you may need to change your G73 menu, as well)
    Click image for larger version. 

Name:	Untitled-1.jpg 
Views:	0 
Size:	54.7 KB 
ID:	108889

    Here's your script with some extra coding that strips the Z values off all the point coords.
    Seems to work good but no warranties expressed or implied.
    I stitched my script into yours, some of the variables could be consolidated, but it works.
    Let me know if you want any further changes.
    'G73 G83 HAAS VF Peck drilling cycle

    NCEdit Output,Line = i

    dim R as string
    dim F as string
    dim Q as double
    dim Z as string
    dim nl1 as integer
    dim nl2 as integer
    dim nl3 as integer

    R=.1

    Ask Header="Pecking Parameters",Output,Cancel=canc, "Hole Depth Z"=Z, "Peck amount Q;0"=Q, "Return R"=R, "Plunge Feed F"=F

    If canc Then
    Exit
    End If

    OptionsConfiguration Xchg = FALSE, Ychg = FALSE
    NCEdit Output, NumLines=nl1
    Generate
    NCEdit Output, NumLines=nl2
    OptionsConfiguration Xchg = TRUE, Ychg = TRUE

    nl3 = nl2-nl1
    nl3 = nl3-6


    NCEdit Line = i, Output ,Text=txt

    pos = InStr(txt, "Z")

    If pos > 0 Then
    txt = left(txt, pos - 1)
    End If

    NCEdit Line = i,Text=txt, Output, NumLines=nl

    NCEdit Line = i+2, Output, Text=txt
    txt = txt+" Z"+Z+" Q"+Q+" R"+R+" F"+F
    NCEdit Line = i+2,Text=txt, Output, NumLines=nl

    For v = 1 To nl3
    NCEdit Line = i+v+2,Output,Text=txt
    pos = InStr(txt, "Z")
    If pos > 0 Then
    txt = left(txt, pos - 1)
    End If
    NCEdit Line = i+v+2,Text=txt, Output, NumLines=nl
    Next v

    NCEdit Line = i+nl3+6


    Window2

  4. #4
    Join Date
    Jun 2010
    Posts
    0
    moldmker you are the man. Thank you very much. It worked perfect


    If you are asking about the G00 G91 G28 Z0. That is tool change pos. on this machine.

Similar Threads

  1. VB Scripting 101
    By UKRobotics in forum Screen Layouts, Post Processors & Misc
    Replies: 12
    Last Post: 05-18-2009, 12:04 PM
  2. Scripting reference...
    By kiwichris in forum NCPlot G-Code editor / backplotter
    Replies: 5
    Last Post: 11-15-2007, 10:36 PM
  3. Scripting Question
    By eng8248 in forum BobCad-Cam
    Replies: 6
    Last Post: 03-24-2007, 08:53 PM
  4. Bobcad scripting
    By 69owb in forum BobCad-Cam
    Replies: 1
    Last Post: 05-14-2006, 09:20 PM
  5. Scripting
    By Klox in forum BobCad-Cam
    Replies: 29
    Last Post: 10-03-2003, 04:11 AM

Posting Permissions

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