Using variable


Results 1 to 15 of 15

Thread: Using variable

  1. #1
    Member
    Join Date
    May 2009
    Location
    Canada
    Posts
    9
    Downloads
    0
    Uploads
    0

    Default Using variable

    When I try using the variable listed in the reference document, most of them so not seem to work.

    When I add this code to the Init Tool Change section
    :T:<N><TOOL_COMMENT><EOL>
    :T:<TOOL_DIAMETER><EOL>
    :T:<TOOL_DESCRIPTION><EOL>

    The output generated is
    (M4.0 X 0.7 TAP)
    <TOOL_DIAMETER>
    <TOOL_DESCRIPTION>

    Only the TOOL_COMMENT seems to work. Do you have to add additional code toe the LIB files to activate these variables?

    Is there a variable I can use to extract the current Setup name and Operation name?

    Similar Threads:


  2. #2
    Member
    Join Date
    Jun 2006
    Location
    Slovenia
    Posts
    48
    Downloads
    0
    Uploads
    0

    Default Re: Using variable

    Quote Originally Posted by slammers View Post
    Is there a variable I can use to extract the current Setup name and Operation name?
    TLP_OPER_NAME (check UPG Help - Complete Reference Guide)

    I'm also heaving problem to output STOCK_LENGTH, STOCK_WIDTH and STOCK_HEIGHT... Is that somehow related with SolidworksCAM, so not all variables are available if you don't have CAMworks?



  3. #3
    Member vincent.pomerleau's Avatar
    Join Date
    Feb 2010
    Location
    Canada
    Posts
    69
    Downloads
    3
    Uploads
    0

    Default Re: Using variable

    Try thes syntaxes
    <"#3.3T":STOCK_LENGTH>
    <"#3.3T":STOCK_WIDTH>
    <"#3.3T":STOCK_HEIGHT>
    <"#3.4":TOOL_DIAMETER>
    For tool description, I never try it
    You can try add this to your mill.lib file
    *-----------------------------------
    :ATTRNAME=TOOL DESCRIPTION
    :ATTRTYPE=POST
    :ATTREMARK=
    :CODETYPE=FORMAT
    :WORD_ADDRESS_BEF=|(
    :VAR=TOOL DESCRIPTION
    :WORD_ADDRESS_AFT=)
    :LEFT_PLACES=0
    :RIGHT_PLACES=0
    :UNITFLAG=NON_CONVERT
    :ATTRSPACES=YES
    :MODAL=NO
    :ATTRUSED=1
    :ATTREND



  4. #4
    Member
    Join Date
    Jun 2006
    Location
    Slovenia
    Posts
    48
    Downloads
    0
    Uploads
    0

    Default Re: Using variable

    Quote Originally Posted by vincent.pomerleau View Post
    Try thes syntaxes
    <"#3.3T":STOCK_LENGTH>
    <"#3.3T":STOCK_WIDTH>
    <"#3.3T":STOCK_HEIGHT>
    <"#3.4":TOOL_DIAMETER>
    This actually works! Thank you!

    Next thing I'm struggling with is how to modify G40/G41/G42 output in the way that G40 would be replaced with C0, G41 with C1 and G42 with C2. (It's an Italian SCM woodwork router and it taks a bit odd code).



  5. #5
    Member vincent.pomerleau's Avatar
    Join Date
    Feb 2010
    Location
    Canada
    Posts
    69
    Downloads
    3
    Uploads
    0

    Default Re: Using variable

    Try replacing these sections in .src file

    :SECTION=LINE_LEADIN_MOVE_MILL
    :T:C<%COMP-40)><G:1><X!><Y!><Z><F><EOL>
    *-------------------------------------------------------------------------------
    :SECTION=LINE_LEADOUT_MOVE_MILL
    :T:C0<G:1><X!><Y!><Z><F><EOL>



  6. #6
    Member vincent.pomerleau's Avatar
    Join Date
    Feb 2010
    Location
    Canada
    Posts
    69
    Downloads
    3
    Uploads
    0

    Default Re: Using variable

    Replace by : (



  7. #7
    Member
    Join Date
    Jun 2006
    Location
    Slovenia
    Posts
    48
    Downloads
    0
    Uploads
    0

    Default Re: Using variable

    Quote Originally Posted by vincent.pomerleau View Post
    Replace by : (
    I figured it out

    Is there a way to change G00 to G0 and G01 to G1 and G02/G03 to G2/G3 ? That zero machine doesnt like at all...



  8. #8
    Member vincent.pomerleau's Avatar
    Join Date
    Feb 2010
    Location
    Canada
    Posts
    69
    Downloads
    3
    Uploads
    0

    Default Re: Using variable

    at the start of .src file change these
    LEADING=FALSE
    INT_LEADING=FALSE



  9. #9
    Member
    Join Date
    Jun 2006
    Location
    Slovenia
    Posts
    48
    Downloads
    0
    Uploads
    0

    Default Re: Using variable

    Quote Originally Posted by vincent.pomerleau View Post
    at the start of .src file change these
    LEADING=FALSE
    INT_LEADING=FALSE
    Thank you for replay, I solved it in this way, for example arc moves: G <"%1LT":ARC_DIR> and as far as I testedd it it looks OK.

    Next thing I need to change is "inverting" axis Y and Z, as on machine Z positive is downwards that means Y is "rotated" arround X. This means that my WCS (work coordinate system) is always placed on top-left corner.



  10. #10
    Member vincent.pomerleau's Avatar
    Join Date
    Feb 2010
    Location
    Canada
    Posts
    69
    Downloads
    3
    Uploads
    0

    Default Re: Using variable

    Copy this to you .lib file, it should work, you may have to reverse your arc direction to make this works,register are x=24 y=25 z=26

    :SECTION=CALC_ENDPOINT(DVAL,DEFAULTVAL,GC,GG,G_GRO UP,MACH,PREV,REGISTER)
    :C: IF ATTROVERRIDE=YES THEN DVAL=ATTRDVALUE ELSE DVAL=DEFAULTVAL ENDIF
    :C: PREV(REGISTER)=MACH(REGISTER)
    :C: IF abs_inc=1 THEN MACH(REGISTER)=(DVAL) GOTO1 ENDIF
    :C: BUCKET=0
    :C: ROUNDOFF(DVAL-MACH(REGISTER),BUCKET,DVAL,G_RIGHT_PLACES,METRIC_O UT)
    :C: SETON()
    :C: IF ABS(DVAL)<ROUNDING_POINT AND LEADIN=NO AND
    :C: LEADOUT=NO THEN
    :C: SETOFF()
    :C: ENDIF
    :C: MACH(REGISTER)=(MACH(REGISTER)+DVAL)
    :C1: IF REGISTER=24 THEN RETURN ENDIF
    * FLIP SECTION
    :C: DVAL=(-DVAL)

    this section may have to be modified too, register are I=9 J=10 K=11

    :SECTION=CALC_CENTER(DVAL,DEFAULTVAL,GC,GG,G_GROUP ,MACH,PREV,P_REG,REGISTER,AIC)
    :C: IF ATTROVERRIDE=YES THEN DVAL=ATTRDVALUE ENDIF
    :C: IF ATTROVERRIDE=NO THEN DVAL=(DEFAULTVAL-PREV(P_REG)) ENDIF
    :C: IF REGISTER=10 OR REGISTER=11 THEN RETURN ENDIF
    :C: IF REGISTER=9 THEN
    :C: IF working_plane<3 OR working_plane=5 THEN RETURN ENDIF
    :C: ENDIF
    * FLIP SECTION
    :C: DVAL=(PREV(P_REG)-DEFAULTVAL)

    and this one too to reverse the Z in drilling cycles

    :SECTION=CALC_DEC_REGISTER(DVAL,MACH,DEFAULTVAL,RE GISTER)
    :C: IF ATTROVERRIDE=YES THEN DVAL=ATTRDVALUE ELSE DVAL=DEFAULTVAL ENDIF
    :C: MACH(REGISTER)=DVAL
    * FLIP SECTION
    :C: DVAL=(-DVAL)



  11. #11
    Member
    Join Date
    Feb 2017
    Location
    Portugal
    Posts
    11
    Downloads
    1
    Uploads
    0

    Default Re: Using variable

    Vicent
    Give me tis error
    "Error Primary var: G not foundMETRIC_O UT) SETON() IF ABS(DVAL)<ROUNDING_POINT AND LEADIN=NO AND LEADOUT=NO THEN SETOFF() ENDIF MACH(REGISTER)=(MACH(REGISTER)+DVAL):C1
    error 1 at 216 in CALC_ENDPOINT
    Syntax error or unrecognized variable name
    lane<3
    error 1 at 187 in CALC_CENTER
    Syntax error or unrecognized variable name"


    :C: IF working_plane<3 OR working_plane=5 THEN RETURN ENDIF

    Last edited by xesyfish; 03-21-2023 at 10:21 AM.


  12. #12
    Member vincent.pomerleau's Avatar
    Join Date
    Feb 2010
    Location
    Canada
    Posts
    69
    Downloads
    3
    Uploads
    0

    Default Re: Using variable

    Hi
    For the first error remove de space from

    METRIC_O UT) -----> METRIC_OUT)

    For second error, my post is build to handle angle head for horizontal work, I have the working_plane variable to handle this, in your case you will have to create your own condition, if you want to always flip it, just remove this line

    :C: IF working_plane<3 OR working_plane=5 THEN RETURN ENDIF



  13. #13
    Member
    Join Date
    Feb 2017
    Location
    Portugal
    Posts
    11
    Downloads
    1
    Uploads
    0

    Default Re: Using variable

    Help me

    Attached Files Attached Files


  14. #14
    Member vincent.pomerleau's Avatar
    Join Date
    Feb 2010
    Location
    Canada
    Posts
    69
    Downloads
    3
    Uploads
    0

    Default Re: Using variable

    What are you trying to do or what is the problem ?



  15. #15
    Member
    Join Date
    Feb 2017
    Location
    Portugal
    Posts
    11
    Downloads
    1
    Uploads
    0

    Default Re: Using variable

    Hi i try invert axis Y and Z, and arcs J.



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
  •  


About CNCzone.com

    We are the largest and most active discussion forum for manufacturing industry. The site is 100% free to join and use, so join today!

Follow us on


Our Brands

Using variable

Using variable