586,337 active members*
3,697 visitors online*
Register for free
Login

Thread: Weird result

Results 1 to 10 of 10
  1. #1
    Join Date
    Jul 2008
    Posts
    116

    Weird result

    First off I am fairly new to Mastercam and have only started to modify my post over the last couple months. I almost have the post to the way I want it but one nag is left. When I add a manual entry I want to send the Y home(G28).

    I added this to my post (line in red)

    --------------------------------------------------------------------------
    # Tool Comment / Manual Entry Section
    # --------------------------------------------------------------------------
    ptoolcomment #Comment for tool
    tnote = t$
    toffnote = tloffno$
    tlngnote = tlngno$
    "(", pstrtool, *tldia$, ")", e$ #orignial"(", pstrtool, *tnote, *toffnote, *tlngnote, *tldia$, ")", e$

    pstrtool #Comment for tool
    if strtool$ <> sblank,
    [
    strtool$ = ucase(strtool$)
    *strtool$, " "
    ]

    pcomment$ #Comment from manual entry (must call pcomment2 if booleans)
    pcomment2

    pcomment2 #Comment from manual entry

    n$, *sg28ref, "Y0", e$
    scomm$ = ucase (scomm$)
    if gcode$ = 1007, "(", scomm$, ")"
    if gcode$ = 1006, scomm$
    else, "(", scomm$, ")", e$

    # ----------------------------------------


    The problem is it is post that line twice. Why is this?

    The code it output. (in red)


    G91 G28 Z0.
    M01
    G28 Y0.
    N500M00 G28 Y0.
    (FLIP PART G56)
    T1 M6


    Thanks for the help.

    Kyle
    You must remember that 99% of my posts are Bullchit!

  2. #2
    Join Date
    Dec 2008
    Posts
    3111

    Re: Weird result

    Bad choice of your area to mod

    Quote Originally Posted by Get lucky View Post
    pcomment2 #Comment from manual entry ( This area sets the format for outputting A COMMENT )

    n$, *sg28ref, "Y0", e$ ( this is incorrect, get rid of it, it will put this line of code for every Manual Entry that you do. )
    scomm$ = ucase (scomm$)
    if gcode$ = 1007, "(", scomm$, ")"
    if gcode$ = 1006, scomm$
    else, "(", scomm$, ")", e$

    # ----------------------------------------


    The problem is it is post that line twice. Why is this?

    The code it output. (in red)


    G91 G28 Z0.
    M01
    G28 Y0. This is your mod ... see above
    N500M00 G28 Y0. ( this is from the Manual Entry operation... 1st line )
    (FLIP PART G56) ( this is from the Manual Entry operation... 2nd line )
    T1 M6
    Edit the operation defaults so that the Manual Entry is pre-filled with the text or code that you will use often
    - would your code be better like this
    Code:
    G91 G28 Z0.
    M01
    G91 G28 Y0.
    G90 ( actually switch back to absolute )
    M00 ( FLIP PART G56 )
    T1 M6

  3. #3
    Join Date
    Jul 2008
    Posts
    116

    Re: Weird result

    What I would like to see is code like this

    G91 G28 Z0.
    G28 Y0
    N500M00
    (FLIP PART G56)
    T1 M6
    (T# COMMENT)
    G0G90G56X.......Y......S.......M3



    Not sure how I would get there.
    I have attached an image of what I typically put in the manual entry. The other comment we add is to blow out a deep pocket before a finish pass.

    What are the operation defaults?

  4. #4
    Join Date
    Jul 2008
    Posts
    116

    Re: Weird result

    Did some searching online about the defaults and change them.

    What I entered is this
    Attachment 319690

    The result was this.
    Click image for larger version. 

Name:	Capture 2.PNG 
Views:	0 
Size:	7.2 KB 
ID:	319692


    Not sure how to make it post the way I want.

  5. #5
    Join Date
    Dec 2008
    Posts
    3111

    Re: Weird result

    I feel like your avatar,.................. if it don't work.....put it back to how it was
    ( it is bad to change something in the post, not see any change in NC code output, & think it'll be OK to leave that change there
    UNTIL.... your post uses that section, I'm glad that I won't be paying for the repairs )

    - why did you not put that section back to how it was ??
    - what post is this taken from ?
    - What Mcam version ?
    - there is normally a lot more comments, where are they ?
    ---------- where is the e$

    Quote Originally Posted by Get lucky View Post
    pcomment2 #Comment from manual entry

    n$, *sg28ref, "Y0", e$
    scomm$ = ucase (scomm$)
    if gcode$ = 1007, "(", scomm$, ")"
    if gcode$ = 1006, scomm$ , e$
    else, "(", scomm$, ")", e$
    this is mine ( Fanuc Generic )
    Code:
    pcomment2       #Output Comment from manual entry
          scomm$ = ucase (scomm$)
          if gcode$ = 1005, sopen_prn, scomm$, sclose_prn, e$  #Manual entry - as comment
          if gcode$ = 1006, scomm$, e$                         #Manual entry - as code
          if gcode$ = 1007, sopen_prn, scomm$, sclose_prn      #Manual entry - as comment with move NO e$
          if gcode$ = 1026, scomm$                             #Manual entry - as code with move NO e$
          if gcode$ = 1008,
            [
              [
              sopen_prn, scomm$, sclose_prn, e$  #Operation comments
              #if comp_type > 0 & comp_type < 4, sopen_prn, *scomp_type, sclose_prn, e$
              #sopen_prn, *xy_stock, sdelimiter, *z_stock, sclose_prn, e$
              ]
            #xy_stock = 0  #Reset stock to leave values
            #z_stock = 0   #Reset stock to leave values
            ]
          if gcode$ = 1051, sopen_prn, scomm$, sclose_prn, e$  #Machine name
          if gcode$ = 1052, sopen_prn, scomm$, sclose_prn, e$  #Group comment
          if gcode$ = 1053, sopen_prn, scomm$, sclose_prn, e$  #Group name
          if gcode$ = 1054, sopen_prn, scomm$, sclose_prn, e$  #File Descriptor
    In you manual entry box
    Code:
    G91 G28 Y0.
    G90
    M00 ( FLIP PART G56 )
    ( Press Cycle Start to Continue )
    Like I said, you turned incremental ON, you need to turn it OFF
    - anything written lowercase is parsed thru "ucase", NC code will all be uppercase
    leave the M01, it is placed there by a different section of the post.....When you turn the Opt Stop OFF to run the program in full auto, it will be ignored, but will stop on the M00

    Your Operation Defaults
    select a machine type, ( on the Op manager ) select "Files"
    - look down near bottom, select Op Defaults icon.....it will open to a new ( seemingly new ) Mastercam session with all you operation strategy types,
    find the Manual Entry Operation and fill it out exactly how you would want it filled when you do it in another program

    ----- this is where to set the opening defaults for all the Op strategies
    ( or you could hit the icon on top of the parameter page of the op called "Save as Default", if it is available )

  6. #6
    Join Date
    Jul 2008
    Posts
    116

    Re: Weird result

    First off I have put them back to the way it was as you recommend.

    This post was created in 2003 by someone in our shop and has been used ever since.

    We are on Master Cam X9 for Solidoworks 2015 and upgrading to 2016 on Monday.

    My guess would be the missing comments are not there because of when this post was created.

    If you look at post #4 you can see that I have already added the information to the manual entry in the defaults as you recommend and it post all the information out on one line. Not sure why it did that. any insight would be helpful. (Added the e$ and it fixed that problem.)

    As for turning on the G91 it gets turned back off two lines later in the position line before the G43 line.


    Thank you for your help Sorry for making you want look like my avatar.

  7. #7
    Join Date
    Dec 2008
    Posts
    3111

    Re: Weird result

    My guess would be the missing comments are not there because of when this post was created.
    - The layout looks like one from a generic post, deleting the comments does not make it any faster, only makes it harder for the next person trying to follow the logic .... cannot understand why these were deleted ... OK move on

    If you look at post #4 you can see that I have already added the information to the manual entry in the defaults as you recommend and it post all the information out on one line. Not sure why it did that. any insight would be helpful. (Added the e$ and it fixed that problem.)
    The reason it posted out on one line is...because the ,e$ is missing in the post, e$ is an end of NCoutput line, similar to a CR LF in a Fanuc control


    As for turning on the G91 it gets turned back off two lines later in the position line before the G43 line.
    So ......, what would happen if you jumped to a section that didn't have a G90 on it
    --- always try to return things back to the default state, same reason you state the defaults at the beginning of every program..... ever tried to run an endmill at F3. (in/min) when G95 is active....it moves bloody quick
    ,


    Thank you for your help Sorry for making you want look like my avatar.
    - Ignore me ......I was just thinking out loud

  8. #8
    Join Date
    Jul 2008
    Posts
    116

    Re: Weird result

    So ......, what would happen if you jumped to a section that didn't have a G90 on it
    --- always try to return things back to the default state, same reason you state the defaults at the beginning of every program..... ever tried to run an endmill at F3. (in/min) when G95 is active....it moves bloody quick ,



    Any line that calls out a spindle speed has a G90 on it. So you would have to jump to a spot that you wouldn't be machining for anything bad to happen. Also I wouldn't even have to call out a G91 because the lines prior to it are G0G91G28Z0; M5; then add in my manual entry of G28Y0; N150M00; (FLIP PART); Then on to the next tool.

    That is the same way the generic post for Haas is too.Not saying that it is right or wrong just is the way it is laid out.


    One thing I would like to have is the N number match the tool number but only post a N number on the line before a tool change. Is that something that would be fairly easy or complex to do?

    Thanks again
    Kyle.

  9. #9
    Join Date
    Dec 2008
    Posts
    3111

    Re: Weird result

    Quote Originally Posted by Get lucky View Post
    [
    One thing I would like to have is the N number match the tool number but only post a N number on the line before a tool change. Is that something that would be fairly easy or complex to do?.
    Easy enough
    ( items to be added/altered are in blue )
    Code:
    # --------------------------------------------------------------------------
    # Format statements - n=nonmodal, l=leading, t=trailing, i=inc, d=delta
    # --------------------------------------------------------------------------
    #Default english/metric position format statements
    fs2 1   0.7 0.6      #Decimal, absolute, 7 place, default for initialize (:)
    fs2 2   0.4 0.3      #Decimal, absolute, 4/3 place
    fs2 3   0.4 0.3d     #Decimal, delta, 4/3 place
    #Common format statements
    fs2 4   1 0 1 0      #Integer, not leading
    fs2 5   2 0 2 0l     #Integer, force two leading
    fs2 6   3 0 3 0l     #Integer, force three leading
    fs2 7   4 0 4 0l     #Integer, force four leading
    fs2 9   0.1 0.1      #Decimal, absolute, 1 place
    fs2 10  0.2 0.2      #Decimal, absolute, 2 place
    fs2 11  0.3 0.3      #Decimal, absolute, 3 place
    fs2 12  0.4 0.4      #Decimal, absolute, 4 place
    fs2 13  0.5 0.5      #Decimal, absolute, 5 place
    fs2 14  0.3 0.3d     #Decimal, delta, 3 place
    fs2 15  0.2 0.1      #Decimal, absolute, 2/1 place (feedrate)
    fs2 16  1 0 1 0n     #Integer, forced output
    fs2 17  0.2 0.3      #Decimal, absolute, 2/3 place (tapping feedrate)
    
    # These formats used for 'Date' & 'Time'
    fs2 18  2.2 2.2lt    #Decimal, force two leading & two trailing (time2)
    fs2 19  2 0 2 0t     #Integer, force trailing                   (hour)
    fs2 20  0 2 0 2lt    #Integer, force leading & trailing         (min)
    
    # This format statement is used for sequence number output
    # Number of places output is determined by value for "Increment Sequence Number" in CD
    # Max depth to the right of the decimal point is set in the fs statement below
    fs2 21  0^7 0^7      #Decimal, 7 place, omit decimal if integer value ...  this is the numerical format for the new string
    fs2 22  0^3 0^3      #Decimal, 3 place, omit decimal if integer value
    
    # dwell$ must be 1/1000th of a sec, no decimal point
    fs2 23  0 3 0 3t      #Decimal, absolute, 3 place
    
    # --------------------------------------------------------------------------
    # Toolchange / NC output Variable Formats
    # --------------------------------------------------------------------------
    fmt  T  4   t$          #Tool number
    fmt  T  4   first_tool$ #First tool used 
    fmt  T  4   next_tool$  #Next tool used  
    fmt  D  4   tloffno$    #Diameter offset number
    fmt  H  4   tlngno$     #Length offset number
    fmt  G  4   g_wcs       #WCS G address
    fmt  P  4   p_wcs       #WCS P address
    fmt  S  4   speed       #Spindle Speed
    fmt  M  4   gear        #Gear range
    # --------------------------------------------------------------------------
    fmt  N  21  n$          #Sequence number
    fmt  N  21  tn          #Sequence number at toolchange...new string...NOTE format number associated
    fmt  X  2   xabs        #X position output
    fmt  Y  2   yabs        #Y position output
    the placement of the callout is not required on the 1st tool, So it is only in later tools
    - I place mine before the toolchange for easier reading
    - I have set my post to NOT output sequence numbers, so the n$ is ignored in the post

    - the only issue is if you call a tool out a 2nd time, it WILL have the same sequence number

    Code:
    ptlchg$          #Tool change                                        
          pcuttype
          toolchng = one
          if mi1$ = one, #Work coordinate system
            [
            pfbld, n$, *sg28ref, "X0.", "Y0.", e$
            pfbld, n$, sg92, *xh$, *yh$, *zh$, e$
            ]
          if prog_stop = 1, pbld, n$, *sm01, e$
          if prog_stop = 2, pbld, n$, *sm00, e$
          "()", e$
          pcom_moveb
          pcheckaxis
          c_mmlt$ #Multiple tool subprogram call
          pcan
          tn = t$    #( this sets tn to be the same as T )
          tn, e$     #( this outputs tn to the NC file )
          result = newfs(15, feed)  #Reset the output format for 'feed'
          pbld, n$, sm06, *t$, ptoolcomment, e$

  10. #10
    Join Date
    Jul 2008
    Posts
    116

    Re: Weird result

    That was perfect other then the post I have been working form is different form yours.

    Thank you so much for the help and the insight, I'm sure I will be back for more info when I start to work on the post for our TL lathe.

Similar Threads

  1. Different result with the same materials
    By Term1nUS in forum Laser Engraving / Cutting Machine General Topics
    Replies: 5
    Last Post: 10-10-2011, 01:43 PM
  2. Tombstone move to home gives weird result
    By MIKEL12 in forum EdgeCam
    Replies: 3
    Last Post: 06-09-2010, 10:51 PM
  3. kcam HPGL DXF result
    By Isaak in forum Uncategorised CAM Discussion
    Replies: 1
    Last Post: 04-27-2008, 06:29 PM
  4. changing result of alarm
    By spock in forum Sharp CNC
    Replies: 2
    Last Post: 01-26-2008, 04:35 PM
  5. End result
    By Ken_Shea in forum OneCNC
    Replies: 6
    Last Post: 05-14-2003, 03:06 AM

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
  •