512,255 active members
4,089 visitors online
Register for free
Login
Results 1 to 10 of 10
  1. #1
    Registered
    Join Date
    May 2009
    Posts
    8

    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?

  2. #2
    Junior Member
    Join Date
    Jun 2006
    Posts
    45

    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
    Registered
    Join Date
    Feb 2010
    Posts
    60

    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
    Junior Member
    Join Date
    Jun 2006
    Posts
    45

    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
    Registered
    Join Date
    Feb 2010
    Posts
    60

    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
    Registered
    Join Date
    Feb 2010
    Posts
    60

    Re: Using variable

    Replace by : (

  7. #7
    Junior Member
    Join Date
    Jun 2006
    Posts
    45

    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
    Registered
    Join Date
    Feb 2010
    Posts
    60

    Re: Using variable

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

  9. #9
    Junior Member
    Join Date
    Jun 2006
    Posts
    45

    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
    Registered
    Join Date
    Feb 2010
    Posts
    60

    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)

Similar Threads

  1. Assigning post variable to Vbscript variable
    By vfsi in forum Bobcad Post Processors
    Replies: 6
    Last Post: 10-18-2016, 01:30 PM
  2. pls, need some variable
    By deadlykitten in forum Okuma
    Replies: 10
    Last Post: 11-03-2015, 02:45 PM
  3. Variable zero
    By Dave Elliot in forum Machine Problems, Solutions , Wireless DNC, serial port
    Replies: 0
    Last Post: 05-28-2010, 10:38 AM
  4. Variable changes
    By TNorbut in forum Controller & Computer Solutions
    Replies: 0
    Last Post: 07-23-2008, 01:16 PM
  5. EMC2 variable pitch / variable diameter threading.
    By samco in forum General MetalWork Discussion
    Replies: 0
    Last Post: 03-09-2008, 07:40 PM

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
  •