Open Source Sofware

» Topic: D comp number

Home New Forums BobCAD-CAM Forums D comp number

This topic contains 8 replies, has 3 voices, and was last updated by  Sean 2 years, 4 months ago.

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #19099

    Mike
    Participant

    I am not new to BobCAD, but I am new to versions 25 & 26. Most of our milling machines are Mazaks. They don’t have 2 wear columns for comps. Since we are limited by this we designate comp numbers under 31 as height comps, making diameter comps to be 30 + tool number. Example: tool #1 would use H1 and D31.

    I am able to put a macro in my posts for the D Comp to read like this: G41 D[1+30]

    Does anyone here know how I can make it post: G41 D31? I know this is petty problem, but I’d like to know anyway.

    Thanks,
    Mike

    #19100

    Rob
    Participant

    Mike

    Yes, not too hard to do, I presume you are looking for something like the code below ?

    N02 T1 M06
    N03 G90 G54 X-29.115 Y-29.532 S595 M03
    N04 G43 H1 Z25.4 M08
    N05 G41 D31

    You can set this in your Post Processor on line 267 as shown below

    267. Amount to add to tool # for tool register value? 30

    You also need to check of the following two lines are as below in Blocks 2 and 3 in your Post Processor, these lines generate the G43 and G41/G42 shown above.

    n,rapid_move,length_offset,zr,coolant_on
    n,force_cc,d_offset,

    That should do it for you, if you have any problems editing the PP save the original out to a seperate folder and upload the PP here (Zip it up) and I`m sure someone will look at it for you.

    Hope thats what youre looking for :-)

    Regards
    Rob

    #19112

    Mike
    Participant

    Thank you Rob. :) I’ll try that first thing tomorrow.

    My previous attempts came out like this:
    G41 D130

    I knew that there had to be a way to add numbers instead of text values, but I was having trouble seeing it.

    Thanks again,
    Mike

    #19116

    Mike
    Participant

    Rob,

    Your fix didn’t work the way I’d like. It worked fine for tools that have use a dcomp. The problem is that tools not using a comp would give me this:

    G40 D31

    I’d really to be able to set my dcomp without putting garbage in other areas of code.

    If you or anyone else have any other ideas, I am open to them. :)

    Thank you!

    #19117

    Sean
    Participant

    Mike,

    Where it says d_offset in the post, replace it with program_block_1. Go to program block 1 in your post, block 2001, and type in the following beneath it. If it is not there, add it

    2001. Add 30 to diameter offset
    Dim dOffset
    doffset = MILL_GetToolDiamCompNumber()
    dOffset = dOffset+30
    Mill_SetReturnString(” D”&dOffset&””)

    • This reply was modified 2 years, 4 months ago by  Sean. Reason: Grammatical Problems
    #19122

    Mike
    Participant

    Thanks Sean! I’ll try this out at work tomorrow (the newest version I have at home is 21).

    I’ve been reading my post and the milling variables, but nothing explained program blocks. Is there a reference for writing programming blocks? A quick reference of the programming commands and functions available? I don’t see functions like MILL_GetToolDiamCompNumber() or procedures like Mill_SetReturnString() in any of the literature accompanying either version 25 or version 26 installs. I have a lot of pc programming experience, so such a reference would make me VERY productive

    Thanks again!
    Mike

    #19123

    Mike
    Participant

    Sean,

    Thank you much or you help

    I had to change this line: Mill_SetReturnString(” D”&dOffset&””)
    to the line below. This line generated an error saying it expected a “)”
    sooner. Once I did that, I got exactly what I wanted!
    I am very happy with this solution!

    Was:
    12. Cutter compensation left
    “G41″,d_offset

    13. Cutter compensation right
    “G42″,d_offset

    Changed to:
    12. Cutter compensation left
    “G41 D”,program_block_1

    13. Cutter compensation right
    “G42 D”,program_block_1
    :
    :
    :
    :
    2001. Add 30 to diameter offset
    Dim dOffset
    dOffset = MILL_GetToolDiamCompNumber()
    dOffset = dOffset+30
    Mill_SetReturnString(dOffset&amp)

    Thanks again! :)
    Mike

    #19124

    Mike
    Participant

    Sean,

    I finally realized that what I am looking for is a reference to the BobCAD API. Once I searched for API in the Help app, I found what I was looking for.

    I literally couldn’t have done it without your message giving me a couple of keywords to search for.

    BTW, I realized why your code was expecting “)” too soon, it was just a “;” instead of “,” typo.

    Thanks again for your help

    #19125

    Sean
    Participant

    All of the documentation for our APIs is available in the help system. I see that you found this already. You can also find a pdf of it in C:\BobCAD-CAM Data\BobCAD-CAM V26\Posts\Documentation.

    Glad it worked out for you.

Viewing 9 posts - 1 through 9 (of 9 total)

You must be logged in to reply to this topic.

Forum Account

     Lost Password / Register   

Sharing

facebooktwittergoogle_pluspinterestlinkedinmail