cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can subscribe to a forum, label or individual post and receive email notifications when someone posts a new topic or reply. Learn more! X

Getting tools to Post Out to my programs??

jeuclide
4-Participant

Getting tools to Post Out to my programs??

Anyone know how to get the tools from my Manufaturing to post out to my programs so that the list of tools and sizes are in the program for the operator. Now i write them down or use the "Process Documention" button to this after the fact and give to operator.

Jeff

13 REPLIES 13

Jeff,

Looks like you need to activate the tools options on PPRINT table. On Creo2 look on the Manufacturing tab under Machine Tool Setup / PPRINT / Modify
There are a number of options referring to tools. Activate those that you need. Probably the options you need are TOOL_TABLE and ONLY_OUTPUT_USED_TOOLS
If after that you still don’t see the tools on the programs it means that tool table output is disabled on the post-processor. Here I'm not quite sure what you need to do. I think you need to look if PPRINT comments are enabled

Jeff,

I went through this a while back, and as stated above, you need to set the PPRINT parameters. Here's a link to the discussion I had on here, and I posted my solution, too.

http://communities.ptc.com/message/194250#194250

If you have any other questions, or maybe want me to send you my full post processor file, feel free to ask.

jeuclide
4-Participant
(To:KenFarley)

Hey guys thanks for the responces. I did change the PPRINT option and nothing posts out to my programs??? Maybe like Gabriel says my PPRINT is off?? Here is my FIL data, any ideas if this looks correct? PRINT/ON should this be PPRINT/ON maybe?

Jeff

$$====================================================
$$ -------- Post-Processor Name: HAAS VF1 ------
$$====================================================
$$
$$ ****************************************************
$$ * G L O B A L S e c t i o n s *
$$ ****************************************************
REDEF/ON
DMY=POSTF(24,1) $$ Debug options **
PRINT/ON
$$
A=1;B=2;C=3;D=4;E=5;F=6;G=7;H=8;I=9;J=10;K=11;L=12;M=13;N=14
O=15;P=16;Q=17;R=18;S=19;T=20;U=21;V=22;W=23;X=24;Y=25;Z=26
$$
TLCUNT=0
$$ Support for CSINK cycle : output G81 for a CSINK cycle
DMY=POSTF(2,1,471,81) $$ Set INTCOM 471 to 81

$$ ****************************************************
$$ * R E P L A C S e c t i o n s *
$$ ****************************************************
T1=TEXT/' - / ';T2=TEXT/' - ';REPLAC/T1,T2
T1=TEXT/' - 1 ';T2=TEXT/' - 01 ';REPLAC/T1,T2
T1=TEXT/' - 2 ';T2=TEXT/' - 02 ';REPLAC/T1,T2
T1=TEXT/' - 3 ';T2=TEXT/' - 03 ';REPLAC/T1,T2
T1=TEXT/' - 4 ';T2=TEXT/' - 04 ';REPLAC/T1,T2
T1=TEXT/' - 5 ';T2=TEXT/' - 05 ';REPLAC/T1,T2
T1=TEXT/' - 6 ';T2=TEXT/' - 06 ';REPLAC/T1,T2
T1=TEXT/' - 7 ';T2=TEXT/' - 07 ';REPLAC/T1,T2
T1=TEXT/' - 8 ';T2=TEXT/' - 08 ';REPLAC/T1,T2
T1=TEXT/' - 9 ';T2=TEXT/' - 09 ';REPLAC/T1,T2
T1=TEXT/'M6';T2=TEXT/'M06';REPLAC/T1,T2
T1=TEXT/'M5';T2=TEXT/'M05';REPLAC/T1,T2

$$ ****************************************************
$$ * M A C R O S e c t i o n s *
$$ ****************************************************
$$-------------------------------------------------------
$$ Macro to extract elements of time and date
$$--------------------------------------------------------
TIMDAT=MACRO/
TIMEDD=TEXT/TIMES
MONTH=TEXT/RANGE,TIMEDD,1,2
DATE=TEXT/RANGE,TIMEDD,4,5
YEAR=TEXT/RANGE,TIMEDD,7,8
HOUR=TEXT/RANGE,TIMEDD,10,11
MINUTE=TEXT/RANGE,TIMEDD,13,14
SECOND=TEXT/RANGE,TIMEDD,16,17
TERMAC

$$-------------------------------------------------------
$$ Macro to extract the contents before and after ':'
$$ in PPRINT (except OPERATION COMMENTS)
$$--------------------------------------------------------
PRTCON=MACRO/
COLON=TEXT/':'
MESTYP=TEXT/'----'
MESCON=TEXT/'----'
$$
MESAGE=TEXT/CLW $$ Get text in PPRINT
COLPOS=INDXF(MESAGE,COLON) $$ Find position of ':'
IF(COLPOS .NE. 0)THEN $$ In case ':' exist
MESAGE=TEXT/OMIT,MESAGE,1
MESAGE=TEXT/OMIT,MESAGE,2
NBCHAR=CANF(MESAGE,1)
MESAGE=TEXT/RANGE,MESAGE,2,NBCHAR
MESAGE=TEXT/OMIT,MESAGE,1
MESAGE=TEXT/OMIT,MESAGE,2
NBCHAR=CANF(MESAGE,1)
COLPOS=INDXF(MESAGE,COLON)
$$ Get contents before ':'
MESTYP=TEXT/RANGE,MESAGE,1,(COLPOS-1)
MESTYP=TEXT/OMIT,MESTYP,1
MESTYP=TEXT/OMIT,MESTYP,2 $$ Text before ':', message type
$$ Get contents after ':'
MESCON=TEXT/RANGE,MESAGE,(COLPOS+1),NBCHAR
MESCON=TEXT/OMIT,MESCON,1
MESCON=TEXT/OMIT,MESCON,2 $$ Text after ':', message contents
ENDIF
TERMAC

$$-------------------------------------------------------
$$ Macro to find all PPRINT/TOOL NAME and LOADTL record
$$ and save them in MACRO
$$--------------------------------------------------------
TLINFO=MACRO/
CUCLPO=POSTF(7,1)
T1=TEXT/'TOOL NAME'
TLINDX=1
INDEX1=1
$$
DMY=POSTF(2,1,1836,1) $$ Suppress all warnings
RESERV/TLNAME,100,TLNUMB,100,OFFSET,100,CYCFLG,100
DMY=POSTF(2,1,1836,0) $$ Enable warnings
$$
DO/ENDDO2,BBB=1,100,1
TLNAME(BBB)=TEXT/'NO TOOL NAME DEFINED IN NCL FILE'
CYCFLG(BBB)=0
ENDDO2)CONTIN
$$
DO/ENDDO1,AAA=1,3,1
DMY=POSTF(14)
WORD_2=POSTF(7,2)
WORD_3=POSTF(7,3)
IF(WORD_2 .NE. 14000)THEN
CASE/WORD_3
WHEN/(ICODEF(PPRINT))
CALL/PRTCON
OKTLCM=CMPRF(MESTYP,T1)
IF(OKTLCM .EQ. 1)THEN
TLNAME(TLINDX)=TEXT/MESCON
TLINDX=TLINDX+1
ENDIF
WHEN/(ICODEF(LOADTL))
TOOLNB=POSTF(7,4) $$ Get tool info.
FIVWOD=POSTF(7,5)
SIXWOD=POSTF(7,6)
TLNUMB(INDEX1)=TOOLNB
IF(FIVWOD .EQ. ICODEF(OSETNO))THEN $$ If offset # exist
OFFSET(INDEX1)=SIXWOD
ELSE $$ No offset #, use tool # instead
OFFSET(INDEX1)=TOOLNB
ENDIF
INDEX1=INDEX1+1
WHEN/(ICODEF(CYCLE)) $$ Check if a CYCLE is used for
CYCFLG(INDEX1-1)=1 $$ this tool
ENDCAS
AAA=2
ELSE
AAA=4
DMY=POSTF(15,(CUCLPO+1))
ENDIF
ENDDO1)CONTIN
TERMAC

$$---------------------------------
$$ Current register contents MACRO
$$---------------------------------
REGVAL=MACRO/
AVAL=POSTF(1,3,292);NVAL=POSTF(1,3,305)
BVAL=POSTF(1,3,293);OVAL=POSTF(1,3,306)
CVAL=POSTF(1,3,294);PVAL=POSTF(1,3,307)
DVAL=POSTF(1,3,295);QVAL=POSTF(1,3,308)
EVAL=POSTF(1,3,296);RVAL=POSTF(1,3,309)
FVAL=POSTF(1,3,297);SVAL=POSTF(1,3,310)
GVAL=POSTF(1,3,298);TVAL=POSTF(1,3,311)
HVAL=POSTF(1,3,299);UVAL=POSTF(1,3,312)
IVAL=POSTF(1,3,300);VVAL=POSTF(1,3,313)
JVAL=POSTF(1,3,301);WVAL=POSTF(1,3,314)
KVAL=POSTF(1,3,302);XVAL=POSTF(1,3,315)
LVAL=POSTF(1,3,303);YVAL=POSTF(1,3,316)
MVAL=POSTF(1,3,304);ZVAL=POSTF(1,3,317)
TERMAC

$$=====================================================
$$ C I M F I L S E C T I O N
$$=====================================================
$$ ****************************************************
$$ * M A C H I N S e c t i o n s *
$$ ****************************************************
CIMFIL/ON, MACHIN
DMY=POSTF(13)
SEQNO/OFF
INSERT/'(PROGRAM NAME - ',PTNUMB, ' )$'
CALL/TIMDAT
INSERT/'(DATE, DAY-MONTH-YEAR - ',DATE,'-',MONTH,'-',YEAR,' )$'
$$
CALL/TLINFO
DO/ENDDO3,CCC=1,(TLINDX-1),1
INSERT/'( TOOL -', TLNUMB(CCC), ' DIA. OFF. -' $
TLNUMB(CCC), ' LENGTH -', TLNUMB(CCC), ' ', TLNAME(CCC),' )$'
ENDDO3)CONTIN
$$
INSERT/' $'
SEQNO/ON
INSERT/' G00 G40 G49 G80 G90$'
SEQNO/30,INCR,5,1
CIMFIL/OFF

$$ ****************************************************
$$ * C O O L N T S e c t i o n s *
$$ ****************************************************
CIMFIL/ON, COOLNT
DMY=POSTF(12,4) $$ Set CL to 4 digits
WORD_4=POSTF(7,4)
IF(WORD_4 .NE. ICODEF(OFF))THEN
REPEAT/Z,M,8
ELSE
REPEAT/Z,M,9
ENDIF
CIMFIL/OFF


$$ ****************************************************
$$ * L O A D T L S e c t i o n s *
$$ ****************************************************
CIMFIL/ON,LOADTL
CUTLNB=POSTF(7,4) $$ Added 04/30/01
DMY=POSTF(20)
SEQNO/OFF
INSERT/' $'
SEQNO/ON
DMY=POSTF(21)
DMY=POSTF(12,6)
DMY=POSTF(9,5,(ICODEF(OSETNO)))
DMY=POSTF(10,6,CUTLNB)
DMY=POSTF(13)
TLCUNT=TLCUNT+1
REPEAT/OFF
REPEAT/G,A,90
CIMFIL/OFF

$$ ****************************************************
$$ * C U T C O M S e c t i o n s *
$$ ****************************************************
CIMFIL/ON,CUTCOM $$ Force CUTCOM # same as Tool #
WORD_4=POSTF(7,4)
IF(WORD_4 .NE. ICODEF(OFF))THEN
DMY=POSTF(10,5,CUTLNB)
ENDIF
DMY=POSTF(13)
CIMFIL/OFF

$$ ****************************************************
$$ * P A R T N O S e c t i o n s *
$$ ****************************************************
CIMFIL/ON,PARTNO
PTNUMB=TEXT/CLW
PTNUMB=TEXT/OMIT,PTNUMB,1
PTNUMB=TEXT/OMIT,PTNUMB,2
CIMFIL/OFF

$$ ****************************************************
$$ * S P I N D L S e c t i o n s *
$$ ****************************************************
CIMFIL/ON,SPINDL
WORD_4=POSTF(7,4)
IF(WORD_4 .NE. ICODEF(OFF))THEN
DMY=POSTF(2,1,1867,1) $$ Disable Tape output
DMY=POSTF(13) $$ Process
DMY=POSTF(2,1,1867,0) $$ Enable Tape output
CALL/REGVAL
$$REPEAT/OFF
IF((CYCFLG(TLCUNT)) .EQ. 0)THEN $$ If no CYCLE exist, output Dxx
REPEAT/X,Y,D,CUTLNB,ALL $$ Added 04/30/01
ENDIF
REPEAT/X,Y,Z,S,SVAL,ALL $$ Output SxxxMx
REPEAT/X,Y,Z,M,MVAL,ALL $$ with next motion
ELSE
DMY=POSTF(13)
POSTN/OUT,G,91,A,28,Z,0
ENDIF
CIMFIL/OFF

$$ ****************************************************
$$ * E N D 08/21/01 *
$$ ****************************************************

Jeff,

I took a look at your fil file and it look like the informations you are looking for are handled by TLINFO macro. Here is what I suggest to do:

In your PPRINT table (on the mfg model) activate the following options: TOOL_NAME, CUTTER_DIAM, LENGTH

Edit the TLINFO macro on the fil file to look like this

$$-------------------------------------------------------

$$ Macro to find all PPRINT/TOOL NAME and LOADTL record

$$ and save them in MACRO

$$--------------------------------------------------------

TLINFO=MACRO/

CUCLPO=POSTF(7,1)

T1=TEXT/'TOOL NAME'

T2=TEXT/'LENGTH'

T3=TEXT/'CUTTER_DIAM'

TLINDX=1

INDEX1=1

INDEX2=1

INDEX3=1

$$

DMY=POSTF(2,1,1836,1) $$ Suppress all warnings

RESERV/TLNAME,100,TLNUMB,100,OFFSET,100,CYCFLG,100,TLLNGT,100,TLDIAM,100

DMY=POSTF(2,1,1836,0) $$ Enable warnings

$$

DO/ENDDO2,BBB=1,100,1

TLNAME(BBB)=TEXT/'NO TOOL NAME DEFINED IN NCL FILE'

CYCFLG(BBB)=0

ENDDO2)CONTIN

$$

DO/ENDDO1,AAA=1,3,1

DMY=POSTF(14)

WORD_2=POSTF(7,2)

WORD_3=POSTF(7,3)

IF(WORD_2 .NE. 14000)THEN

CASE/WORD_3

WHEN/(ICODEF(PPRINT))

CALL/PRTCON

OKTLCM=CMPRF(MESTYP,T1)

IF(OKTLCM .EQ. 1)THEN

TLNAME(TLINDX)=TEXT/MESCON

TLINDX=TLINDX+1

ENDIF

OKTLCM=CMPRF(MESTYP,T2)

IF(OKTLCM .EQ. 1)THEN

TLLNGT(INDEX2)=TEXT/MESCON

INDEX2=INDEX2+1

ENDIF

OKTLCM=CMPRF(MESTYP,T3)

IF(OKTLCM .EQ. 1)THEN

TLDIAM(INDEX3)=TEXT/MESCON

INDEX3=INDEX3+1

ENDIF

WHEN/(ICODEF(LOADTL))

TOOLNB=POSTF(7,4) $$ Get tool info.

FIVWOD=POSTF(7,5)

SIXWOD=POSTF(7,6)

TLNUMB(INDEX1)=TOOLNB

IF(FIVWOD .EQ. ICODEF(OSETNO))THEN $$ If offset # exist

OFFSET(INDEX1)=SIXWOD

ELSE $$ No offset #, use tool # instead

OFFSET(INDEX1)=TOOLNB

ENDIF

INDEX1=INDEX1+1

WHEN/(ICODEF(CYCLE)) $$ Check if a CYCLE is used for

CYCFLG(INDEX1-1)=1 $$ this tool

ENDCAS

AAA=2

ELSE

AAA=4

DMY=POSTF(15,(CUCLPO+1))

ENDIF

ENDDO1)CONTIN

TERMAC

Edit the MACHIN section:

CIMFIL/ON, MACHIN

DMY=POSTF(13)

SEQNO/OFF

INSERT/'(PROGRAM NAME - ',PTNUMB, ' )$'

CALL/TIMDAT

INSERT/'(DATE, DAY-MONTH-YEAR - ',DATE,'-',MONTH,'-',YEAR,' )$'

$$

CALL/TLINFO

DO/ENDDO3,CCC=1,(TLINDX-1),1

INSERT/'( TOOL:',TLNUMB(CCC), ' TOOL_DIA:', TLDIAM(CCC), $

' OFFSET:' OFFSET(CCC), ' LENGTH:', TLLNGT(CCC), $

' ', TLNAME(CCC),' )$'

ENDDO3)CONTIN

INSERT/' $'

SEQNO/ON

INSERT/' G00 G40 G49 G80 G90$'

SEQNO/30,INCR,5,1

CIMFIL/OFF

After I made those changes the header of the tape file looks like this:

G20

(PROGRAM NAME - TEST_MFG )

(DATE, DAY-MONTH-YEAR - 27-03-14 )

( TOOL: 4 TOOL_DIA:0.393701 OFFSET: 4 LENGTH:3.937010 T0004 )

( TOOL: 7 TOOL_DIA:0.312500 OFFSET: 7 LENGTH:3.000000 T0007 )

jeuclide
4-Participant
(To:GabrielZaha)

Gabriel, I changed my settings like above and it does not post correct yet?? All i get is the part number to show up. Any ideas?? Thankyou for your help on this!!!

Jeff

Jeff,

Here's the post I generally use for machines with tool changers. Maybe you can extract the stuff you want from it? Hopefully I'm not defying any rules by posting something this long.

$$

$$ *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

$$

$$ Author : Kenneth J. Farley

$$ Date : 13 November 2013

$$

$$ Handling routines for various APT code that is not done in the

$$ proper fashion by the default routines.

$$

$$ *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

$$

PRINT/ OFF, IN $$ debug: ON production: OFF, IN

DMY = POSTF ( 24, 0 ) $$ : ( 24, 1 ) : ( 24, 0 )

$$

$$ ===================[ Global Variable Declarations ]==================

$$

REDEF/ ON

A=1 ; B=2 ; C=3 ; D=4 ; E=5 ; F=6 ; G=7 ; H=8 ; I=9 ; J=10

K=11 ; L=12 ; M=13 ; N=14 ; O=15 ; P=16 ; Q=17 ; R=18 ; S=19 ; T=20

U=21 ; V=22 ; W=23 ; X=24 ; Y=25 ; Z=26

CURREG = 0 $$ Current offset register in use

CHTOOL = 0 $$ Boolean indicator of tool change

CUTOOL = 0 $$ Current tool number in use

TXTVAL = TEXT/ ' ' $$ Generic text variable 'returned' by macros

CMTLST = TEXT/ ' ' $$ Last PPRINT comment processed

MAXTLS = 50 $$ Maximum number of tools used

LSTTIM = 0.0 $$ Initial cycle time

CYCDEP = 0.0 $$ Depth of drilling in current cycle

CYCPCK = 0.0 $$ Drilling cycle peck depth

CYCCLR = 0.0 $$ Drilling cycle clearance

RESERV/ MONNAM, 12 $$ Array of names for the months

MONNAM ( 1 ) = TEXT/ 'J', ( TEXT/ LOW, ( TEXT/ 'anuary' ) )

MONNAM ( 2 ) = TEXT/ 'F', ( TEXT/ LOW, ( TEXT/ 'ebruary' ) )

MONNAM ( 3 ) = TEXT/ 'M', ( TEXT/ LOW, ( TEXT/ 'arch' ) )

MONNAM ( 4 ) = TEXT/ 'A', ( TEXT/ LOW, ( TEXT/ 'pril' ) )

MONNAM ( 5 ) = TEXT/ 'M', ( TEXT/ LOW, ( TEXT/ 'ay' ) )

MONNAM ( 6 ) = TEXT/ 'J', ( TEXT/ LOW, ( TEXT/ 'une' ) )

MONNAM ( 7 ) = TEXT/ 'J', ( TEXT/ LOW, ( TEXT/ 'uly' ) )

MONNAM ( 8 ) = TEXT/ 'A', ( TEXT/ LOW, ( TEXT/ 'ugust' ) )

MONNAM ( 9 ) = TEXT/ 'S', ( TEXT/ LOW, ( TEXT/ 'eptember' ) )

MONNAM ( 10 ) = TEXT/ 'O', ( TEXT/ LOW, ( TEXT/ 'ctober' ) )

MONNAM ( 11 ) = TEXT/ 'N', ( TEXT/ LOW, ( TEXT/ 'ovember' ) )

MONNAM ( 12 ) = TEXT/ 'D', ( TEXT/ LOW, ( TEXT/ 'ecember' ) )

RESERV/ TLUSED, MAXTLS $$ Array of boolean tool usage flags

RESERV/ TLCOMT, MAXTLS $$ Array of tool comments

DO/ DOTLS, INDEX = 1, MAXTLS, 1

TLUSED ( INDEX ) = 0

TLCOMT ( INDEX ) = TEXT/ '* X.XXXX DIA'

DOTLS) CONTIN

$$

$$ ========================[ Macro Declarations ]=======================

$$

$$

$$ --[ Macro : IN2TXT ]-------------------------------------------------

$$

$$ Converts an integer value to a text string, with the desired

$$ number of characters. If necessary, the number is padded with

$$ leading zeroes to achieve the desired width.

$$

$$ Parameters

$$ INTVAL : the value that is to be processed

$$ NUMDIG : the number of characters the number is to fill

$$

$$ Global variables

$$ TXTVAL : the resultant number as a text string

$$

IN2TXT = MACRO/ INTVAL, NUMDIG

WRKVAL = INTF ( INTVAL )

DIGSOK = 1 + INTF ( LOGF ( WRKVAL ) / LOGF ( 10.0 ) )

NUMZED = NUMDIG - DIGSOK

IF ( NUMZED .GT. 0 ) THEN

TXTVAL = TEXT/ REPEAT, NUMZED, '0', CONVI, WRKVAL, DIGSOK

ELSE

TXTVAL = TEXT/ CONVI, WRKVAL, NUMDIG

ENDIF

TERMAC

$$

$$ --[ Macro : RL2TXT ]-------------------------------------------------

$$

$$ Converts a real number to a string. The resultant number is

$$ padded with spaces to the right in order to obtain a final res-

$$ ult with the same width as '-XX.XXXX '.

$$

$$ Parameters

$$ RLVALU : the value that is to be processed

$$ NUMDIG : the number of characters the number is to fill

$$

$$ Global variables

$$ TXTVAL : the resultant number as a text string

$$

RL2TXT = MACRO/ RLVALU, NUMDIG

$$

$$ Calculate the number of spaces that need to be added. The end

$$ result desired is any of the following:

$$ '-XX.XXXX' -> no space padding needed

$$ '-X.XXXX ' or 'XX.XXXX ' -> one trailing space

$$ 'X.XXXX ' -> two trailing spaces

$$

NUMSPC = 1

IF ( RLVALU .GT. 0 ) THEN

NUMSPC = NUMSPC + 1

ENDIF

IF ( ABSF ( RLVALU ) .LT. 10 ) THEN

NUMSPC = NUMSPC + 1

ENDIF

$$

$$ Generate the text string including the label, sign, value,

$$ and necessary number of spaces.

$$

IF ( ABSF ( RLVALU ) .LT. 1 ) THEN

TXTNUM = TEXT/ CONVF, ABSF ( RLVALU ), NUMDIG, 4, 0, 0, 3

IF ( RLVALU .LT. 0 ) THEN

TXTVAL = TEXT/ '-0', TXTNUM, REPEAT, NUMSPC, ' '

ELSE

TXTVAL = TEXT/ '0', TXTNUM, REPEAT, NUMSPC, ' '

ENDIF

ELSE

TXTNUM = TEXT/ CONVF, RLVALU, NUMDIG, 4, 0, 0, 3

TXTVAL = TEXT/ TXTNUM, REPEAT, NUMSPC, ' '

ENDIF

TERMAC

$$

$$ --[ Macro : BLDTLL ]-------------------------------------------------

$$

$$ Build and then output a list of the tools used in the program.

$$ This is done by the following algorithm:

$$

$$ (1) Save the restart CL record position.

$$ (2) Parse through the remainder of the CL file, storing any occur-

$$ ences of tool changes as you go.

$$ (3) Reset the CL file to the restart position.

$$

BLDTLL = MACRO/

CIMPOS = POSTF ( 7, 1 ) + 1 $$ Set the return CL position

DO/ DOCMD, INDEX = 0, 10, 1

RESULT = POSTF ( 14 )

CMDTYP = POSTF ( 7, 2 )

CMDSUB = POSTF ( 7, 3 )

IF ( CMDTYP .EQ. 14000 ) THEN

RESULT = POSTF ( 15, CIMPOS )

INDEX = 11

ELSE

INDEX = 2

ENDIF

TARGET = ICODEF ( PPRINT )

IF ( CMDTYP .EQ. 2000 .AND. CMDSUB .EQ. TARGET ) THEN

CMTLST = TEXT/ OMIT, (TEXT/ CLW), 1

CMTLST = TEXT/ MODIFY, CMTLST, (TEXT/ '/'), (TEXT/ '*'), 1

CMTLST = TEXT/ OMIT, CMTLST, 2

ENDIF

TARGET = ICODEF ( LOADTL )

IF ( CMDTYP .EQ. 2000 .AND. CMDSUB .EQ. TARGET ) THEN

TLNUM = POSTF ( 7, 4 )

TLUSED ( TLNUM ) = 1

TLCOMT ( TLNUM ) = TEXT/ CMTLST

ENDIF

DOCMD) CONTIN

CALL/ WRTTLS

TERMAC

$$

$$ --[ Macro : WRTTLS ]------------------------------------------------

$$

$$ Writes out a list of the tools used in the current CL file

$$

$$ Global variables

$$ TLUSED : array of flags indicating if the tool is used

$$ TLCOMT : the comment string for a the tool

$$

WRTTLS = MACRO/

LINCNT = 0

DO/ DOTLS, INDEX = 1, MAXTLS, 1

IF ( TLUSED ( INDEX ) .GT. 0 ) THEN

CALL/ IN2TXT, INTVAL = INDEX, NUMDIG = 2

IF ( LINCNT .GT. 0 ) THEN

TXTPRE = TEXT/ '( '

ELSE

TXTPRE = TEXT/ '( T', (TEXT/LOW, (TEXT/ 'ools : '))

ENDIF

INSERT/ TXTPRE, TXTVAL, ' ', TLCOMT ( INDEX )

INSERT/ ' )$'

LINCNT = LINCNT + 1

ENDIF

DOTLS) CONTIN

TERMAC

$$

$$ --[ Macro : WRTTIM ]-------------------------------------------------

$$

$$ Obtains and outputs a runtime value, depending on the argument passed

$$ to the macro:

$$ CODTIM = 0 -> Output the elapsed runtime since the last tool change.

$$ CODTIM = 1 -> Output the total runtime at present

$$ The runtime is output as a properly formatted comment. The macro

$$ utilizes the always-obscure and cryptic POSTF function to read the

$$ correct common variable.

$$

WRTTIM = MACRO/ CODTIM

CURTIM = POSTF ( 1, 3, 0495 ) $$ Get the total runtime

IF ( CODTIM .GT. 0 ) THEN

RAWTIM = CURTIM

ELSE

RAWTIM = CURTIM - LSTTIM

ENDIF

$$

$$ The runtime is given in minutes. Convert the provided number to

$$ hours, minutes, and seconds. If the CODTIM parameter is non-zero

$$ the minutes portion of the time will be rounded up one minute if the

$$ seconds portion is at least 30 or greater.

$$

HRTIME = INTF ( RAWTIM / 60.0 )

MNTIME = INTF ( RAWTIM - ( HRTIME * 60.0 ) )

SETIME = INTF ( ( RAWTIM - INTF ( RAWTIM ) ) * 60.0 )

IF ( CODTIM .GT. 0 ) THEN

MNTIME = MNTIME + INTF ( ( SETIME + 31.0 ) / 60.0 )

ENDIF

CALL/ IN2TXT, INTVAL = HRTIME, NUMDIG = 2

HRTEXT = TEXT/ TXTVAL

CALL/ IN2TXT, INTVAL = MNTIME, NUMDIG = 2

MNTEXT = TEXT/ TXTVAL

CALL/ IN2TXT, INTVAL = SETIME, NUMDIG = 2

SETEXT = TEXT/ TXTVAL

$$

$$ The label for the time depends on whether this is a call for the

$$ overall program time or a tool.

$$

IF ( CODTIM .GT. 0 ) THEN

TXTLAB = TEXT/ '( E', ( TEXT/ LOW, ( TEXT/ 'st ' ) ), 'T'

TXTLAB = TEXT/ TXTLAB, ( TEXT/ LOW, ( TEXT/ 'ime : '))

ELSE

TXTLAB = TEXT/ '( T', ( TEXT/ LOW, ( TEXT/ 'ool ' ) ), 'T'

TXTLAB = TEXT/ TXTLAB, ( TEXT/ LOW, ( TEXT/ 'ime : '))

ENDIF

TXTHRS = TEXT/ ' H', ( TEXT/ LOW, ( TEXT/ 'ours '))

TXTMNS = TEXT/ ' M', ( TEXT/ LOW, ( TEXT/ 'inutes '))

TXTSEC = TEXT/ ' S', ( TEXT/ LOW, ( TEXT/ 'econds' ) )

$$

$$ Output the time only if the time is greater than 1 second. If a tool

$$ time is being output, include the seconds value.

$$

IF ( SETIME .GE. 1.0 ) THEN

IF ( CODTIM .GT. 0 ) THEN

INSERT/ TXTLAB, HRTEXT, TXTHRS, MNTEXT, TXTMNS

INSERT/ ' )$'

ELSE

INSERT/ TXTLAB,HRTEXT,TXTHRS,MNTEXT,TXTMNS,SETEXT,TXTSEC, ' )$'

ENDIF

ENDIF

LSTTIM = CURTIM

TERMAC

$$

$$ --[ Macro : CLCDTC ]-------------------------------------------------

$$

$$ Cycle time calculations are not accurate when the deep drilling cycle

$$ is used. Therefore, this routine calculates an additional time need-

$$ ed for the currently active cycle, based upon the currently set depth

$$ values, feedrate, etc.

$$

$$ Global variables:

$$ CYCSTP : the number of steps that are needed to drill each hole

$$ CYCPCK : the Z increment or peck depth for the cycle

$$

CLCDTC = MACRO/

DEPCOD = POSTF ( 1, 1, 0472 ) $$ The G code for a DEEP cycle

OFFCOD = POSTF ( 1, 1, 0500 ) $$ The G code for cycle state OFF

CYCNOW = POSTF ( 1, 1, 0539 ) $$ The current active cycle G code

IF ( ( CYCNOW .NE. OFFCOD ) .AND. ( CYCNOW .EQ. DEPCOD ) ) THEN

DZCLR = 0.040 $$ Rapid clearance between pecks

FEDDRL = POSTF ( 1, 3, 0102 ) $$ Cycle feedrate in IPM

FEDRAP = POSTF ( 1, 3, 0109 ) $$ Rapid feedrate in Z direction

NUMSTP = INTF ( ( CYCDEP + CYCCLR ) / CYCPCK )

TIMADD = 0.0

IF ( FEDDRL .GT. 0.0 ) THEN

TIMADD = ( DZCLR * NUMSTP ) / FEDDRL

ENDIF

IF ( FEDRAP .LE. 0.0 ) THEN

FEDRAP = 100.0

ENDIF

NUMRAP = NUMSTP * ( NUMSTP + 1 ) / 2 - 1

TIMADD = TIMADD + ( NUMRAP * CYCPCK ) / FEDRAP

RESULT = POSTF ( 2, 3, 0495, ( POSTF ( 1, 3, 0495 ) + TIMADD ) )

ENDIF

TERMAC

$$

$$ =======================[ CIMFIL Declarations ]=======================

$$

$$

$$ --[ SET ]------------------------------------------------------------

$$

$$ None of the processors seem to handle the offset register indicated

$$ by the programmer, so this code will output it as the appropriate

$$ G-code. Note that it is only output once per program or tool change,

$$ to avoid redundant calls from every NC sequence, which can cause

$$ troubles on some machines.

$$

CIMFIL/ ON, SET, OFSETL

OFSTYP = POSTF ( 6, 5 )

OFSREG = POSTF ( 7, 5 )

IF ( OFSTYP .EQ. 1 ) THEN

IF ( OFSREG.GE.54.AND.OFSREG.LE.59.AND.CURREG.NE.OFSREG ) THEN

CURREG = OFSREG

OFSCMD = TEXT/ 'G', CONVI, OFSREG, 2, '$'

INSERT/ OFSCMD

ENDIF

ENDIF

CIMFIL/ OFF

$$

$$ --[ MACHIN ]---------------------------------------------------------

$$

$$ The MACHIN designation is useless, but can be used as a marker for

$$ the beginning of the file. Use it as the trigger to write the header

$$ comments and setup commands. Note that some of the lines are broken

$$ up into two pieces because it seems to be impossible to output them

$$ properly in one.

$$

CIMFIL/ ON, MACHIN

RESULT = POSTF ( 13 )

TXTTIM = TEXT/ TIMES

TXTMON = TEXT/ RANGE, TXTTIM, 1, 2

TXTDAY = TEXT/ RANGE, TXTTIM, 4, 5

TXTYR = TEXT/ RANGE, TXTTIM, 7, 8

NUMMON = SCALF ( TXTMON )

INSERT/ ' $'

TXTPRE = TEXT/ '( D', (TEXT/LOW, (TEXT/ 'ate : '))

INSERT/ TXTPRE, TXTDAY, ' ', MONNAM(NUMMON),' 20', TXTYR

INSERT/ ' )$'

TXTPRE = TEXT/ '( A', (TEXT/LOW, (TEXT/ 'uthor :'))

TXTPRE = TEXT/ TXTPRE, ' K', (TEXT/LOW, (TEXT/ 'enneth '))

TXTPRE = TEXT/ TXTPRE, 'J. F', (TEXT/LOW, (TEXT/ 'arley'))

INSERT/ TXTPRE

INSERT/ ' )$'

TXTPRE = TEXT/ '( D', (TEXT/LOW, (TEXT/ 'escription :'))

INSERT/ TXTPRE

INSERT/ ' )$'

CALL/ BLDTLL

INSERT/ ' $'

INSERT/ 'G17 G40 G80 G90$'

CIMFIL/ OFF

$$

$$ --[ CYCLE ]----------------------------------------------------------

$$

$$ Process a drilling cycle. The reason for any special handling here is

$$ not to change the output to the NC file, but to correct the time est-

$$ imate for the cycle.

$$

$$ The calculation methodology is as follows:

$$ (1) Tell the post-processor to generate the CYCLE NC code normally.

$$ (2) If the type of cycle is DEEP, set the global cycle parameters.

$$ (3) Call for the calculation of the time.

$$

CIMFIL/ ON, CYCLE

RESULT = POSTF ( 13 )

CMDSUB = POSTF ( 7, 4 )

TARGET = ICODEF ( DEEP )

IF ( CMDSUB .EQ. TARGET ) THEN

CYCDEP = POSTF ( 7, 6 ) $$ The depth of the hole

CYCPCK = POSTF ( 7, 8 ) $$ The incremental steps to be drilled

CYCCLR = POSTF ( 7, 12 ) $$ The clearance distance

CALL / CLCDTC

ENDIF

CIMFIL/ OFF

$$

$$ --[ LOADTL ]---------------------------------------------------------

$$

$$ Handle a tool change to ensure that the machine is moved to the home

$$ position, that the outputs are in the desired format, etc.

$$

CIMFIL/ ON, LOADTL

$$

$$ Obtain the tool number requested from the current line. Also,

$$ reset the current offset register value. If the tool number

$$ called for is different from the current tool, process it in

$$ the appropriate fashion. Otherwise, ignore it.

$$

CURREG = 0

TLNUM = POSTF ( 7, 4 )

CALL/ WRTTIM, CODTIM = 0

IF ( TLNUM .NE. CUTOOL ) THEN

CHTOOL = 1

CUTOOL = TLNUM

$$

$$ Write preparatory lines. Some of the machines need to be

$$ in the home position to properly load tools, so we might as

$$ well default to moving there.

$$

INSERT/ 'G00$'

INSERT/ 'G49 G28', REPEAT, 17, ' ', 'Z0.0000$'

INSERT/ 'G91$'

INSERT/ 'G28 X0.0000 Y0.0000$'

INSERT/ 'G90$'

$$

$$ Output the tool change, a comment about the tool being loaded, and

$$ an optional stop.

$$

CALL/ IN2TXT, INTVAL = TLNUM, NUMDIG = 2

INSERT/ 'M06 T', TXTVAL, '$'

INSERT/ '( ', TLCOMT ( TLNUM ), ' * )$'

INSERT/ 'M01$'

ENDIF

CIMFIL/ OFF

$$

$$ --[ CUTCOM ]---------------------------------------------------------

$$

$$ Process a cutter compensation command, but only if it meets the

$$ proper requirements.

$$

CIMFIL/ ON, CUTCOM

SETV = POSTF ( 7, 4 )

SETT = POSTF ( 6, 4 )

NBEL = POSTF ( 5 )

IF ( SETT .EQ. 0 ) THEN

IF ( SETV .NE. ( ICODEF ( OFF ) ) .AND. NBEL .EQ. 4 ) THEN

DMY = POSTF ( 10, 5, ( POSTF ( 1, 3, 497 ) ) )

DMY = POSTF ( 12, 5 )

ENDIF

ENDIF

DMY = POSTF ( 13 )

CIMFIL/ OFF

$$

$$ --[ GOTO ]-----------------------------------------------------------

$$

$$ The most prevalent command in the file. If there was just a tool

$$ change, output a move to the indicated first position in the tool's

$$ motion, then set the tool length offset.

$$

$$ If the provided position is part of a drilling cycle, calculate the

$$ necessary time delta and add it to the accumulated program time.

$$

CIMFIL/ ON, GOTO

XPOS = POSTF ( 7, 6 )

YPOS = POSTF ( 7, 7 )

ZPOS = POSTF ( 7, 8 )

$$

$$ Convert the given positions to a properly formatted text string.

$$

CALL/ RL2TXT, RLVALU = XPOS, NUMDIG = 8

XTEXT = TEXT/ 'X', TXTVAL

CALL/ RL2TXT, RLVALU = YPOS, NUMDIG = 8

YTEXT = TEXT/ 'Y', TXTVAL

CALL/ RL2TXT, RLVALU = ZPOS, NUMDIG = 8

ZTEXT = TEXT/ 'Z', TXTVAL

$$

$$ If a tool change was processed previously, now is the time to

$$ take care of setting the offset.

$$

IF ( CHTOOL.GT.0 ) THEN

CHTOOL = 0

INSERT/ 'G00 ', XTEXT, YTEXT, '$'

CALL/ IN2TXT, INTVAL = CUTOOL, NUMDIG = 2

INSERT/ 'G43 H', TXTVAL, REPEAT, 17, ' ', ZTEXT, '$'

ELSE

DMY = POSTF ( 13 )

ENDIF

CALL / CLCDTC

CIMFIL/ OFF

$$

$$ --[ PPRINT ]---------------------------------------------------------

$$

$$ Processes the printing commands, which, for this post-processor, means

$$ ignoring them.

$$

CIMFIL/ ON, PPRINT

CIMFIL/ OFF

$$

$$ --[ FINI ]-----------------------------------------------------------

$$

$$ At the end of the program, add code that will move the machine to the

$$ home position.

$$

CIMFIL/ ON, 14

DMY = POSTF ( 20 )

CALL/ WRTTIM, CODTIM = 0

CALL/ WRTTIM, CODTIM = 1

INSERT/ 'G00$'

INSERT/ 'G49 G28', REPEAT, 17, ' ', 'Z0.0000$'

INSERT/ 'G91$'

INSERT/ 'G28 X0.0000 Y0.0000$'

INSERT/ 'G90$'

AUXFUN/ 30

DMY = POSTF ( 21 )

DMY = POSTF ( 13 )

CIMFIL/ OFF

FINI

jeuclide
4-Participant
(To:KenFarley)

Ken, thanks for the input. I actually took you file from above and created a new post with it and i still dont get any data. Is possible that my PPRINT is not active some how? Ready to punt and just use the Manufacturing button under Tools to create the tool list seperatly.

Jeff

Try to upload the NCL file. Or copy and paste the lines from the begining up to the firs GOTO line

jeuclide
4-Participant
(To:GabrielZaha)

Sorry for my ignorance, how do I do that?

jeuclide
4-Participant
(To:jeuclide)

Every tool is set like you said already..... Thanks for the help though

Jeff

Jeff,

To get the tools to list properly, you need to set up the PPRINT parameters in your "Work Center". Click on it in the Model Tree, then right click and select "Edit Definition".

Click on the "Parameters" tab.

On the right side, click on the "PPRINT" button.

A sub menu will appear at bottom right, click on "Create" in there.

Another submenu will appear, click "Confirm" to continue.

Scroll down to "TOOL_COMMENTS" and select it, then click the "YES" button at the bottom left.

Once that's done, click the "OK" button and you're done.

Now, when you define a tool, be sure to click on the "Settings" in the tool definition, and put in what you want in the "Comments" field. That is the stuff that will be put in your tool list.

I solved

Jeff,

If you look in your working directory with windows explorer you will find there one or more files that have ncl extension. Something like this: op010.ncl.8. Open the latest file of this type with wordpad or notepad and look for the line that begin with LOADTL word.

The lines above should look like this:

PPRINT / TOOL NAME : T0004

PPRINT / CUTTER_DIAM : 0.393701

PPRINT / LENGTH : 3.937008

LOADTL / 4 $$-> 10 mm Dia; 3 mm Rad

If you don't see the PPRINT lines above the LOADTL then your problem is with the PPRINT settings. If the lines are there but you don't get the tool list on the tape file, then the issue is with the postprocessor

Top Tags