585,931 active members*
5,468 visitors online*
Register for free
Login
Results 1 to 7 of 7
  1. #1
    Join Date
    Jul 2003
    Posts
    263

    tool offset macro

    need some help from the macro gurus

    is there a way to create a macro that will load the active work and tool offsets from the variables into a separate subprogram so i can save them whenever i upload my programs and how do i go about doing that?

    thanks
    If you can ENVISION it I can make it

  2. #2
    Join Date
    Mar 2003
    Posts
    2932
    I'd think you could DPRNT the offsets to the PC, but that sounds like more bother than just PUNCHing the offsets at the end of each job. I don't recall seeing a command to write the variables to a program.

  3. #3
    Join Date
    Sep 2005
    Posts
    767
    You can write a macro to transmit tool offsets like dcoupar says, but why would you want to? Just punching your tool offsets directly will output a file with a bunch of G10 commands, which you can read back in like a part program.

  4. #4
    Join Date
    Mar 2006
    Posts
    107
    Quote Originally Posted by Dan Fritz View Post
    You can write a macro to transmit tool offsets like dcoupar says, but why would you want to? Just punching your tool offsets directly will output a file with a bunch of G10 commands, which you can read back in like a part program.
    ...and how to do that?
    Punch out parameters of tool offsets one by one, or there is a more simple way?
    Sorry for bad english

  5. #5
    Join Date
    Mar 2003
    Posts
    2932
    EDIT - OFFSET/SETTING - (OPRT) - > - PUNCH - EXEC

  6. #6
    Join Date
    Jul 2003
    Posts
    263
    the reason i would like to do this is our x-fer is set up to do remote upload and download to and from the machines. we do not have to go to a terminal per say and set the computer to upload or download. every thing is done at the machine control.for us to x-fer programs the system looks for cnc programs, since the offsets are not set up as programs we cannot send them out that way. we have to set the computer to receive and physically edit the programs to add the offsets to the programs. no offense to any one but too many hands editing programs in the servers can cause too much problems. we are getting away from the operators doing any editing ( too many problems etc. every one not on the same page )
    If you can ENVISION it I can make it

  7. #7
    Join Date
    Sep 2005
    Posts
    767
    Our PC-DNC Plus software does remote file requests also. Here's how we do tool offsets:

    First of all, it's usually better to save the offsets as one file, then save the part program (or programs) as another file. The reason for this is that if your part program has a bunch of G10 commands at the begining, it will keep resetting those offsets whenever the program is run. If you then manually alter any offset value, just running the program again will set it back to what it was. That's not convenient. We like to save the program as one file, then save the offsets as another file with the same name, but a different file extension, like ".OFS" for example.

    When our PC-DNC Plus receives a part program from the CNC, we can automatically name the file using the O-number, or using a comment within the program. If, for example, the first block of the part program looks like this:

    O0001 (VALVE BODY OP1) ;

    we can automatically save the file as "O0001" or as "VALVE BODY OP1". We can also automatically add any extension you like (say, .NC or .TXT) to the file name.

    Now, to save your part program, you just PUNCH it and the DNC system will receive it and give it the appropriate name. The next step is to save the tool offset file with a similar file name. Let's say for the sake of this example, you save your part program as "VALVE BODY OP1.TXT" and you want to save the offsets as "VALVE BODY OP1.OFS". Here's how that's done:

    Just send your part program with the comment shown above. PC-DNC Plus can save the file as "VALVE BODY OP1.TXT".

    Create a 1-block "dummy" file to send this message to PC-DNC Plus:

    O7777 (PUT-VALVE BODY OP1.OFS) ;

    When you PUNCH this 1-block program (O7777), you are requesting that PC-DNC Plus save any data that comes in after it as file "VALVE BODY OP1.OFS". The "(PUT-" command is a request to save a file with the specified file name.

    Once O7777 is sent, you then go to the OFFSET page and press PUNCH and EXEC. This saves all the G10 commands in the file "VALVE BODY OP1.OFS". Notice that this file WILL NOT have an O-number in it, so there is a bit of a trick sending back to the CNC.


    Now, the two files are saved on the DNC system, and you want to request them back into the CNC. We use a "File request" command like "(GET-", so the operator can go to another dummy file and make this request for TWO files:

    O7778 (GET-VALVE BODY OP1.TXT) ;
    (GET-VALVE BODY OP1.OFS) ;

    When you PUNCH program O7778 to PC-DNC Plus, it will queue up BOTH the part program (first) and then the offset file (second). To download the part program, just go to the PROGRAMS page and press READ, then EXEC. That will download "VALVE BODY OP1.TXT" into part program memory, using whatever O-number is in the file. (now for the trick):

    Switch to the OFFSET page on the CNC, then press READ and EXEC. That will download the offset data directly into the CNCs offsets (not into part program memory)

    If you want to download the offsets into part program memory instead, just stay on the PROGRAMS page and then key in an O-number, then key in READ, then EXEC. The reason for the O-number is because the file itself does not have an O-number in it. Since the Fanuc needs an O-number, you must manually key one in. If you decide to download the offsets as a part program, you will have to RUN that program in memory mode to actually change all the offsets.

    The only reason I could see for downloading the offsets as a file is if I were downloading them in background editing mode BEFORE I needed them. If you're running another job, and you want to get ready to run the VALVE BODY OP1 program, you can download both the part program and the offsets as program files using different O-numbers, then just not run the offset program until you need it for the next part.

    If you want to save the offsets and the part program as ONE file, then load it back in the same way, we can do that too. Just set PC-DNC Plus to use a longer "timeout" at the end of a file, so you can send your "(PUT-" command with a file name, send the offsets, then switch to the PROGRAMS page and send the file before PC-DNC Plus times out. That will save one file with the offsets first and the part program after it.

    If you save the part program first, no (PUT- command is needed. Just send the part program file, then send the offsets before PC-DNC Plus times out. That will save one file with the part program data first, and the offset data after that.

Similar Threads

  1. Changing tool diameter in the tool offset screen
    By Vern Smith in forum Haas Mills
    Replies: 22
    Last Post: 05-09-2022, 05:25 PM
  2. macro program for work offset
    By cncwhiz in forum Fanuc
    Replies: 4
    Last Post: 12-14-2007, 01:28 PM
  3. Tool Offset (G45,G46,G47,G48)
    By jorgehrr in forum G-Code Programing
    Replies: 6
    Last Post: 11-13-2007, 08:54 AM
  4. Tool offset ...
    By patrickb in forum Fanuc
    Replies: 13
    Last Post: 08-21-2006, 04:53 PM
  5. Macro for positive offset
    By qmas99 in forum Uncategorised CAM Discussion
    Replies: 0
    Last Post: 02-12-2006, 04:37 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
  •