×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Workoffset G54, G55 outputing from post builder every operation ?

Workoffset G54, G55 outputing from post builder every operation ?

Workoffset G54, G55 outputing from post builder every operation ?

(OP)
Hi,

i am in the process of working the kinks out of a DIY post i've made for a BOSCH cc120 used to control a router.

i use G54 - G57 as references for the 4 corners of the machines bed, and regularly use 54 and 55 when flipping a sheet over to machine on both sides.

i have a custom command in my post to output the fixture offset +53 and to stop the machine and move to a position for easy loading.

the custom command is placed in start of operation.

problem is this outputs the reference in between every operation, which is quite annoying when on G55 !

i have tried puting the whole thing in to something like: "if {$workoffset != [expr $mom_fixture_offset_value +53]}   type s


#Set work offset  & stop machine to alow for part repositioning at G55 and above
#
global mom_fixture_offset_value
global workoffset
global workoffsetchange



set workoffset [expr $mom_fixture_offset_value +53]

 if {$workoffset >= 55} {


    MOM_output_literal "M05"
    #Stop spindle
    MOM_output_literal "M09"
    #Raise Head
    MOM_output_literal "G53"
    #Switch to MCS
    MOM_output_literal "G0X1220Y1220Z0"
    #move to loading postion
    MOM_output_literal "M55"
    #UnClamp Right
    MOM_output_literal "M57"
    #UnClamp Left
    #MOM_output_literal "M51"
    #VacPump 1 off
    #MOM_output_literal "M53"
    #VacPump 2 off
    MOM_output_literal "M00"
    #Stop program
    MOM_output_literal "(FLIP/REPOSITION STOCK TO G$workoffset)"
    #Operator message

    }


    MOM_output_literal "G$workoffset"




i have tried puting the whole thing in to something like:

"if {$workoffset != [expr $mom_fixture_offset_value +53]}

but im guessing the global variables are only global to the custom command, not the whole post?

anyone have a good idea of another way around this?

i would also like to change stop conditions, so rather than being >= g55,  it will stop on the first offset change, allowing me to use G55 as the first side and G54 as the second side, purly for flexibility realy.


any help very appreciated.  
 

RE: Workoffset G54, G55 outputing from post builder every operation ?

You are fighting yourself with output literals. Create a block template (actually there probably already is one) for fixture offset and make sure it is modal and you are set. It will then only output when it changes. output literals should only be used when necessary otherwise you have to condition your code more than necessary. Good luck.

RE: Workoffset G54, G55 outputing from post builder every operation ?

(OP)
hey there shags72,


thank you very much, there fixture offset block was not all ready there, but it was easy enough to make one.

so that solves the first problem,  but now i need to get the post to output something to the effect of the below output literals every time the offset changes except the first time. ( maybe the first time just a stop and operator message with the offset number)

    MOM_output_literal "M05"
    #Stop spindle
    MOM_output_literal "M09"
    #Raise Head
    MOM_output_literal "G53"
    #Switch to MCS
    MOM_output_literal "G0X1220Y1220Z0"
    #move to loading postion
    MOM_output_literal "M55"
    #UnClamp Right
    MOM_output_literal "M57"
    #UnClamp Left
    #MOM_output_literal "M51"
    #VacPump 1 off
    #MOM_output_literal "M53"
    #VacPump 2 off
    MOM_output_literal "M00"
    #Stop program
    MOM_output_literal "(FLIP/REPOSITION STOCK TO G$workoffset)"
    #Operator message

can this also be done in block templates?

thanks a lot  - at least now i am on the right track.

RE: Workoffset G54, G55 outputing from post builder every operation ?

How bout setting a previous fix value and then compare the current to it and use this to trigger the output. You would have to set the prev in a commandi in the start of program area I think it was called so it only sets it once and then set it to the current offset after the check. Been awhile since I wrote but this should be close.
START OF PROGRAM COMMAND
set prev_offset 0

START OF PATH COMMAND
if {$offset != $prev_offset} {

code here
}

set prev_offset $offset

RE: Workoffset G54, G55 outputing from post builder every operation ?

Using a block template is the easiest way to go.

Add it to the initial move event so that the G54 is in a block with an X and Y set the output to forced.  Add any other blocks you want after each tool change. Then you will get the desired output. Without writing a lot of custom commands.  The fixture offset is a G code word that is available in PB.

John Joyce
N.C. Programming Supervisor
Barnes Aerospace, Windsor CT
NX6.0.5.3

RE: Workoffset G54, G55 outputing from post builder every operation ?

(OP)
thanks a lot again shags,

that seems to be along the right lines, defining a global variable in the program start seems to make it truly global, which is what i was stuck with in my inital post.

i think i need 2 global variables for the start of path "IF" command to check.  as there are 2 things that need to be true, before i want to output the list of stop / housekeeping commands

ie it needs to not be the first offset, and there needs to be a change in offset.

i think i will be able to work it out from here, thanks a lot for your help.

i will post the solution when its all working.

thanks again.

RE: Workoffset G54, G55 outputing from post builder every operation ?

No problem glad to help!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources