157
global solutions innovation collaboration © 2000 PTC Pro/NC-GPOST Advanced Training & Workshop November 2000

Advanced Class

Embed Size (px)

DESCRIPTION

NC

Citation preview

Page 1: Advanced Class

global solutions

innovation

collaboration

© 2000 PTC

Pro/NC-GPOSTPro/NC-GPOST

Advanced Training & Workshop

November 2000

Advanced Training & Workshop

November 2000

Page 2: Advanced Class

© 2000 PTC 2

AgendaAgenda

Product Review General Overview

Questionnaire Overview

FIL Macros Overview

Advanced FIL Macro programming String manipulation REPEAT REPLAC POSTF functions Tape file re-direction Macros Look-ahead strategy File I/O

Product Review General Overview

Questionnaire Overview

FIL Macros Overview

Advanced FIL Macro programming String manipulation REPEAT REPLAC POSTF functions Tape file re-direction Macros Look-ahead strategy File I/O

• Passing information to the CL file from Pro/NC

• Disable/Enable registers

•Debugging a post-processor

•Macro on motion

•POSTN

•SPWNF

Page 3: Advanced Class

© 2000 PTC 3

AgendaAgenda

Advanced Machine Configuration 3,4-axis Milling machine

5 Axis milling machine Standard kinematics Special kinematics _REPOS macro

Punch-presses

4 Axis lathe

2-4 Axis Wire EDM

Merged post-processor Mill/turn Punch/Laser

Advanced Machine Configuration 3,4-axis Milling machine

5 Axis milling machine Standard kinematics Special kinematics _REPOS macro

Punch-presses

4 Axis lathe

2-4 Axis Wire EDM

Merged post-processor Mill/turn Punch/Laser

Page 4: Advanced Class

© 2000 PTC 4

AgendaAgenda

Pro/NC-GPOST 2000i2 - build 280 Arc fitting Nurbs Fitting Auto-Clamp Miscellaneous FIL macro encrypting

Pro/NC-GPOST 2001

Workshop

Conclusion What’s next ? How to work together ? … request to Intercim

Pro/NC-GPOST 2000i2 - build 280 Arc fitting Nurbs Fitting Auto-Clamp Miscellaneous FIL macro encrypting

Pro/NC-GPOST 2001

Workshop

Conclusion What’s next ? How to work together ? … request to Intercim

Page 5: Advanced Class

global solutions

innovation

collaboration

© 2000 PTC

Pro/NC-GPOSTPro/NC-GPOST

Product ReviewProduct Review

Page 6: Advanced Class

© 2000 PTC 6

What is Pro/NC-GPOST ?What is Pro/NC-GPOST ?

Pro/NC-GPOST consists of 2 modules OPTFILE : interactive

program that builds NC post-processor

GPOST : produces final NC tape from the cutter location file generated by Pro/NC

Pro/NC-GPOST consists of 2 modules OPTFILE : interactive

program that builds NC post-processor

GPOST : produces final NC tape from the cutter location file generated by Pro/NC

Page 7: Advanced Class

© 2000 PTC 7

What is Pro/NC-GPOST ?What is Pro/NC-GPOST ?

Pro/NC-GPOST FLOWPro/NC-GPOST FLOW

Page 8: Advanced Class

© 2000 PTC 8

What is Pro/NC-GPOSTWhat is Pro/NC-GPOST

DOCUMENTATION : GPOST and FIL manual Documentation in HTML format on Pro/ENGINEER on-line

CDROM

DOCUMENTATION : GPOST and FIL manual Documentation in HTML format on Pro/ENGINEER on-line

CDROM

Page 9: Advanced Class

© 2000 PTC 9

What is Pro/NC-GPOST ?What is Pro/NC-GPOST ?

SUPPORT : Email Post-processor Files

A Send button is available in the File menu to start your Email system (MAPI) and attach the current option and FIL files to your email.

SUPPORT : Email Post-processor Files

A Send button is available in the File menu to start your Email system (MAPI) and attach the current option and FIL files to your email.

Page 10: Advanced Class

© 2000 PTC 10

What is Pro/NC-GPOST ?What is Pro/NC-GPOST ?

RESSOURCE : PTConnector GPOST Web page Link to PP database

Tutorials

Training materials

… Etc

http://internal.ptc.com/mkt/products/production_apps/nc_gpost/index.htm

RESSOURCE : PTConnector GPOST Web page Link to PP database

Tutorials

Training materials

… Etc

http://internal.ptc.com/mkt/products/production_apps/nc_gpost/index.htm

Page 11: Advanced Class

© 2000 PTC 11

What is Pro/NC-GPOST ?What is Pro/NC-GPOST ?

Pro/NC-GPOST SETUP Pro/NC-GPOST is set by default (if installed)

Config.pro option : NCPOST_TYPE = GPOST

Store your PPs in s separate directory : GPOSTPP_DIR(default is Pro/E loadpoint/platform/gpost)

Post-processor files : UNCX01.Pnn, UNCX01.Fnn, UNCL01.Pnn,

UNCL01.Fnn, UNCX01.Mnn, UNCL01.Mnn *.TAP, *.LST, *.TL1

To start ProNC-GPOST questionnaire :

progpostq -sy:2 [-po=post name] -db:[path]

Pro/NC-GPOST SETUP Pro/NC-GPOST is set by default (if installed)

Config.pro option : NCPOST_TYPE = GPOST

Store your PPs in s separate directory : GPOSTPP_DIR(default is Pro/E loadpoint/platform/gpost)

Post-processor files : UNCX01.Pnn, UNCX01.Fnn, UNCL01.Pnn,

UNCL01.Fnn, UNCX01.Mnn, UNCL01.Mnn *.TAP, *.LST, *.TL1

To start ProNC-GPOST questionnaire :

progpostq -sy:2 [-po=post name] -db:[path]

Page 12: Advanced Class

© 2000 PTC 12

What is Pro/NC-GPOST ?What is Pro/NC-GPOST ?

Post-processor data files :

UNCX01.Pnn : Milling, wire EDM and punch data files

UNCL01.Pnn : Turning data files

Post-processor macro (FIL) files :

UNCX01.Fnn : Milling, wire EDM and punch FIL files

UNCL01.Fnn : Turning FIL files

NC Tape File : *.TAP

NC Listing File : *.LST

Tooling File : *.TL1 (generated before the CL file processing)

Execution error file name : *.ERR

Post-processor data files :

UNCX01.Pnn : Milling, wire EDM and punch data files

UNCL01.Pnn : Turning data files

Post-processor macro (FIL) files :

UNCX01.Fnn : Milling, wire EDM and punch FIL files

UNCL01.Fnn : Turning FIL files

NC Tape File : *.TAP

NC Listing File : *.LST

Tooling File : *.TL1 (generated before the CL file processing)

Execution error file name : *.ERR

Page 13: Advanced Class

© 2000 PTC 13

What is Pro/NC-GPOST ?What is Pro/NC-GPOST ?

GPOST executable are found in $PRO_DIRECTORY/$MC/objfor example : c:\ptc\proe2000i\i486_nt\obj

GPOST Data files are found in $PRO_DIRECTORY/$MC/gpostfor example : c:\ptc\proe2000i\i486_nt\gpost

Default for new posts are in $PRO_DIRECTORY/$MC/obj

*.d00 : default option files used when creating a new post using the default (uncx01.f00, uncl01.f00, uncp01.f00 …)

*.f00 : Default FIL files used when creating a new post (uncx01.f00, uncl01.f00, uncp01.f00 …

PTC interface kit is in $PRO_DIRECTORY/$MC/gpost System FIL files : uncmil.f00, unctur.f00,uncpun.f00,

uncwir.f00, unclas.f00 Word files : uncmill.v00, unctur.v00, uncpun.v00,

uncwir.v00, unclas.v00

Default POST library in $PRO_DIRECTORY/$MC/gpost (uncx01.dnn and uncl01.dnn )

GPOST executable are found in $PRO_DIRECTORY/$MC/objfor example : c:\ptc\proe2000i\i486_nt\obj

GPOST Data files are found in $PRO_DIRECTORY/$MC/gpostfor example : c:\ptc\proe2000i\i486_nt\gpost

Default for new posts are in $PRO_DIRECTORY/$MC/obj

*.d00 : default option files used when creating a new post using the default (uncx01.f00, uncl01.f00, uncp01.f00 …)

*.f00 : Default FIL files used when creating a new post (uncx01.f00, uncl01.f00, uncp01.f00 …

PTC interface kit is in $PRO_DIRECTORY/$MC/gpost System FIL files : uncmil.f00, unctur.f00,uncpun.f00,

uncwir.f00, unclas.f00 Word files : uncmill.v00, unctur.v00, uncpun.v00,

uncwir.v00, unclas.v00

Default POST library in $PRO_DIRECTORY/$MC/gpost (uncx01.dnn and uncl01.dnn )

Page 14: Advanced Class

© 2000 PTC 14

What is Pro/NC-GPOST ?What is Pro/NC-GPOST ?

QUESTIONNAIRE Microsoft type menu driven interface

Extensive documentation

No licensing required

Text based on UNIX

QUESTIONNAIRE Microsoft type menu driven interface

Extensive documentation

No licensing required

Text based on UNIX

Page 15: Advanced Class

© 2000 PTC 15

What is Pro/NC-GPOST ?What is Pro/NC-GPOST ?

Pro/NC-GPOST GUI

Optfile screen is divided in 4 main areas

Pro/NC-GPOST GUI

Optfile screen is divided in 4 main areas

Pull Down Menu

Toolbar

Main menu

Main Panel

Page 16: Advanced Class

© 2000 PTC 16

What is Pro/NC-GPOST ?What is Pro/NC-GPOST ?

QUESTIONNAIRE Inch and metrics units Absolute and incremental output Travel limits checking Sequence numbering Listing file customization G/M codes Work-address format Circular and Helical interpolation Drilling cycles (emulation if needed) Cutter and fixture compensation Motion analysis Feedrates control: uPM, uPr and 1/T Tool change sequence Spindle control

QUESTIONNAIRE Inch and metrics units Absolute and incremental output Travel limits checking Sequence numbering Listing file customization G/M codes Work-address format Circular and Helical interpolation Drilling cycles (emulation if needed) Cutter and fixture compensation Motion analysis Feedrates control: uPM, uPr and 1/T Tool change sequence Spindle control

Page 17: Advanced Class

© 2000 PTC 17

What is Pro/NC-GPOST ?What is Pro/NC-GPOST ?

Pro/NC-GPOST GUI

The Toolbar The toolbar contains standard shortcuts for frequently

used menu commands.

You can hide or show the toolbar using View/Toolbar command.

To identify a button on the toolbar, just point at it to pop up a tooltip

The toolbar also displays the option file being edited

Pro/NC-GPOST GUI

The Toolbar The toolbar contains standard shortcuts for frequently

used menu commands.

You can hide or show the toolbar using View/Toolbar command.

To identify a button on the toolbar, just point at it to pop up a tooltip

The toolbar also displays the option file being edited

New File

File Open

Close File

Save File

Help Decrease size Main Panel

Increase size Main PanelCancel Edit

Page 18: Advanced Class

© 2000 PTC 18

What is Pro/NC-GPOST ?What is Pro/NC-GPOST ?

Pro/NC-GPOST GUI

The Main Menu Area

The Main Menu Area is used for selecting the different post-processor function categories to modify

To select a category, clickon the categorytitle.

Pro/NC-GPOST GUI

The Main Menu Area

The Main Menu Area is used for selecting the different post-processor function categories to modify

To select a category, clickon the categorytitle.

Page 19: Advanced Class

© 2000 PTC 19

What is Pro/NC-GPOST ?What is Pro/NC-GPOST ?

Pro/NC-POST GUI

The Main Panel Area Change according to the current category selected.

Multiple tabs available for selection at the top of the main panel.

Different mechanisms are available to input data

Pro/NC-POST GUI

The Main Panel Area Change according to the current category selected.

Multiple tabs available for selection at the top of the main panel.

Different mechanisms are available to input data

To select a different sub-panel, just click on its tab

Selection Box Register Box

Spin Button Check Box

Edit Box

ASCII Character Box

Function Code Box

Page 20: Advanced Class

© 2000 PTC 20

QUESTIONNAIRE : Did you know ? Speed-up development with CNC defaultsQUESTIONNAIRE : Did you know ? Speed-up development with CNC defaults

What is Pro/NC-GPOST ? What is Pro/NC-GPOST ?

Page 21: Advanced Class

© 2000 PTC 21

What is Pro/NC-GPOST ?What is Pro/NC-GPOST ?

QUESTIONNAIRE : Did you know ?

Register format and position : match an existing NC program sample tape

Register Addresses Register Output Order

Register Format

Register Alias Space between

Register

QUESTIONNAIRE : Did you know ?

Register format and position : match an existing NC program sample tape

Register Addresses Register Output Order

Register Format

Register Alias Space between

Register

%O1234N1(OBR-11-T/G137-A- )N2(TOOL NAME : D6_CDR)N3T02N4S2000M03N5M51N6G0X-145.42Y-46.351N7G81G98X-145.42Y-46.351Z-5.101R01=5.F200P5000….

Page 22: Advanced Class

© 2000 PTC 22

What is Pro/NC-GPOST ?What is Pro/NC-GPOST ?

QUESTIONNAIRE : Did you know ?

G Codes / M Codes NA stands for Not Available : the function is not available

NR stands for Not Required : the function is available but the code is not required

QUESTIONNAIRE : Did you know ?

G Codes / M Codes NA stands for Not Available : the function is not available

NR stands for Not Required : the function is available but the code is not required

Page 23: Advanced Class

© 2000 PTC 23

What is Pro/NC-GPOST ?What is Pro/NC-GPOST ?

QUESTIONNAIRE : Did you know ? Motion Analysis : Plunge : G0 X Y Retract : G0 Z

Z X Y

QUESTIONNAIRE : Did you know ? Motion Analysis : Plunge : G0 X Y Retract : G0 Z

Z X Y

Page 24: Advanced Class

© 2000 PTC 24

What is Pro/NC-GPOST ?What is Pro/NC-GPOST ?

QUESTIONNAIRE : Did you know ? Operator Messages : Convert Pro/NC PPRINTs

in operator message

The output is goingto include a / i.e. :

( / TOOL NAME : FEM1)

Add the following lines inyour FIL macro :

T1=TEXT/’( / ‘T2=TEXT/’(‘REPLAC/T1,T2

( / TOOL NAME : FEM1) (TOOL NAME : FEM1)

QUESTIONNAIRE : Did you know ? Operator Messages : Convert Pro/NC PPRINTs

in operator message

The output is goingto include a / i.e. :

( / TOOL NAME : FEM1)

Add the following lines inyour FIL macro :

T1=TEXT/’( / ‘T2=TEXT/’(‘REPLAC/T1,T2

( / TOOL NAME : FEM1) (TOOL NAME : FEM1)

Page 25: Advanced Class

© 2000 PTC 25

What is Pro/NC-GPOST ?What is Pro/NC-GPOST ?

QUESTIONNAIRE : Did you know ? Coolant starts with

next Z

This applies to both COOLNT/ON and OFF . A FIL macro can fix this :

CIMFIL/ON,COOLNT$$ Macro to ignore the COOLNT $$ options (HIGH, LOW, ...) and process the COOLNT with the next motion , except COOLNT/OFF DMY=POSTF(12,4) TYP=POSTF(7,4)IF (TYP.EQ.ICODEF(OFF)) THEN DMY=POSTF(2,1,3425,0) $$ output now (set INTCOM 3425 to 0)ELSE DMY=POSTF(2,1,3425,1) $$ output with next motionENDIFDMY=POSTF(13) $$ Process CIMFIL/OFF

QUESTIONNAIRE : Did you know ? Coolant starts with

next Z

This applies to both COOLNT/ON and OFF . A FIL macro can fix this :

CIMFIL/ON,COOLNT$$ Macro to ignore the COOLNT $$ options (HIGH, LOW, ...) and process the COOLNT with the next motion , except COOLNT/OFF DMY=POSTF(12,4) TYP=POSTF(7,4)IF (TYP.EQ.ICODEF(OFF)) THEN DMY=POSTF(2,1,3425,0) $$ output now (set INTCOM 3425 to 0)ELSE DMY=POSTF(2,1,3425,1) $$ output with next motionENDIFDMY=POSTF(13) $$ Process CIMFIL/OFF

Page 26: Advanced Class

© 2000 PTC 26

What is Pro/NC-GPOST ?What is Pro/NC-GPOST ?

QUESYTIONNAIRE : Did you know ? Feedrate

3 types of feedrate : uPM uPR 1/T : Inverse time

feedrate used with a rotary move

Options to define : Feedrate codes Feedrate Register

Code and Format Min, Max values Inverse time

calculation method

QUESYTIONNAIRE : Did you know ? Feedrate

3 types of feedrate : uPM uPR 1/T : Inverse time

feedrate used with a rotary move

Options to define : Feedrate codes Feedrate Register

Code and Format Min, Max values Inverse time

calculation method

Inverse time feedrate : When combined linear/rotary motion exist, most good CNC controls require the inverse of the amount of time necessary to make the move

F(code) = 1 (minute) / (time = 3D distance / velocity)

Page 27: Advanced Class

© 2000 PTC 27

What is Pro/NC-GPOST ?What is Pro/NC-GPOST ?

QUESTIONNAIRE : Did you know ? CYCLEs

Pro/E syntaxautomaticallysupported

G codes Motion types Registers

Support for return G codes by macro (see macro library, Questionnaire in 2001)

Support for CSINK cycle :$$ Support for CSINK cycle : output G81 for a CSINK cycleDMY=POSTF(2,1,471,81) $$ Set INTCOM 471 to 81

QUESTIONNAIRE : Did you know ? CYCLEs

Pro/E syntaxautomaticallysupported

G codes Motion types Registers

Support for return G codes by macro (see macro library, Questionnaire in 2001)

Support for CSINK cycle :$$ Support for CSINK cycle : output G81 for a CSINK cycleDMY=POSTF(2,1,471,81) $$ Set INTCOM 471 to 81

Page 28: Advanced Class

© 2000 PTC 28

What is Pro/NC-GPOST ?What is Pro/NC-GPOST ?

QUESTIONNAIRE : Did you know ? NC Tape Header and Footer

% Percent sign at the beginning

O1234 Program number

(Date:07/01/00 Time:10:45:38) Date and time

G90G40G80 Safe startup code

G49G17 Safe startup code

QUESTIONNAIRE : Did you know ? NC Tape Header and Footer

% Percent sign at the beginning

O1234 Program number

(Date:07/01/00 Time:10:45:38) Date and time

G90G40G80 Safe startup code

G49G17 Safe startup code

CIMFIL/ON,MACHINXX=POSTF(13)DD=TEXT/TIMESINSERT/’(‘,DD,’)$’INSERT/’G90G40G80$’INSERT/’G49G17$’CIMFIL/OFF

Page 29: Advanced Class

© 2000 PTC 29

What is Pro/NC-GPOST ?What is Pro/NC-GPOST ?

BEHIND THE QUESTIONNAIRE : The questionnaire gives access to a limited number of PP settings

Common Variables Optfile provides access to all the internal variables of the

postprocessor.

These variables can be set during the creation of the post-processor but also dynamically during the execution of the post-processor (POSTF)

BEHIND THE QUESTIONNAIRE : The questionnaire gives access to a limited number of PP settings

Common Variables Optfile provides access to all the internal variables of the

postprocessor.

These variables can be set during the creation of the post-processor but also dynamically during the execution of the post-processor (POSTF)

Page 30: Advanced Class

© 2000 PTC 30

What is Pro/NC-GPOST ?What is Pro/NC-GPOST ?

COMMON VARIABLES : 3 types

INTCOM : Integer values

DBLCOM : real values

RELCOM : real values

INTCOM number range is 1 - 5000Including PLABEL from 1831 to 1930

RELCOM number range is 1 - 902

DBLCOM number range is 1 - 2000

COMMON VARIABLES : 3 types

INTCOM : Integer values

DBLCOM : real values

RELCOM : real values

INTCOM number range is 1 - 5000Including PLABEL from 1831 to 1930

RELCOM number range is 1 - 902

DBLCOM number range is 1 - 2000

Page 31: Advanced Class

© 2000 PTC 31

What is Pro/NC-GPOST ?What is Pro/NC-GPOST ?

EXAMPLE of COMMON VARIABLES

How to make a Tape break based on length of tape ? Search for “break” to find which variable to set

Set the variables (10 chars / inches) : DBLCOM 671 : maximum length (in feet or meters) DBLCOM 672 :

minimum length

DBLCOM 747,748,749 : XYZ retract at break

EXAMPLE of COMMON VARIABLES

How to make a Tape break based on length of tape ? Search for “break” to find which variable to set

Set the variables (10 chars / inches) : DBLCOM 671 : maximum length (in feet or meters) DBLCOM 672 :

minimum length

DBLCOM 747,748,749 : XYZ retract at break

Page 32: Advanced Class

© 2000 PTC 32

What is Pro/NC-GPOST ?What is Pro/NC-GPOST ?

FIL MACRO LANGUAGE FIL : Factory Interface Language allows :

Add, delete or modify CL data Alter post-processor output Add or modify APT vocabulary words Read or write data into/from files Call other applications

FIL MACRO LANGUAGE FIL : Factory Interface Language allows :

Add, delete or modify CL data Alter post-processor output Add or modify APT vocabulary words Read or write data into/from files Call other applications

CL File

FIL

UNCL01.Fnn

UNCL01.Pnn

UNCX01.Fnn

UNCX01.Pnn

LatheG-Post

MULTAXG-Post

MCD File

Page 33: Advanced Class

© 2000 PTC 33

What is Pro/NC-GPOST ?What is Pro/NC-GPOST ?

FIL MACRO LANGUAGE Like any programming language

FIL is composed of Variables Labels operators Functions String manipulation functions Logic statements Macro Definition File I/O

Plus some special features : CL Commands Post-processor functions

FIL MACRO LANGUAGE Like any programming language

FIL is composed of Variables Labels operators Functions String manipulation functions Logic statements Macro Definition File I/O

Plus some special features : CL Commands Post-processor functions

CIMFIL/ON,FINIXX=POSTF(20)$$ END OF PROGRAMINSERT/’G91G28Z0.$’INSERT/’G28X0.Y.$’INSERT/’M30$’XX=POSTF(21)XX=POSTF(13)CIMFIL/OFF

FTOOL=0G=7;X=24;Y=25

CIMFIL/ON,LOADTLXX=POSTF(20)IF (FTOOL.NE.0) THEN INSERT/’G91G28Z0$’ENDIFFTOOL=1XX=POSTF(21)XX=POSTF(13)REPEAT/X,Y,G,90,ALLCIMFIL/OFF

Page 34: Advanced Class

© 2000 PTC 34

What is Pro/NC-GPOST ?What is Pro/NC-GPOST ?

INTRODUCTION TO FIL MACRO LANGUAGE

FIL file consists of 2 sections : FIL Subroutines

Starts by CIMFIL/ON,major_word or CIMFIL/ON, type, [subtype]

Ends by CIMFIL/OFF Each FIL subroutine must be unique

Global section Initialized at the beginning of the execution Available in any FIL sub-routine

Maximum 72 columns in a line Not case sensitive The SYN command allows to create alternate spelling for FIL command

SYN / new spelling, vocab, new spelling, vocab, …

INTRODUCTION TO FIL MACRO LANGUAGE

FIL file consists of 2 sections : FIL Subroutines

Starts by CIMFIL/ON,major_word or CIMFIL/ON, type, [subtype]

Ends by CIMFIL/OFF Each FIL subroutine must be unique

Global section Initialized at the beginning of the execution Available in any FIL sub-routine

Maximum 72 columns in a line Not case sensitive The SYN command allows to create alternate spelling for FIL command

SYN / new spelling, vocab, new spelling, vocab, …

Page 35: Advanced Class

© 2000 PTC 35

What is Pro/NC-GPOST ?What is Pro/NC-GPOST ?

INTRODUCTION TO FIL MACRO LANGUAGE

Sample FIL File

INTRODUCTION TO FIL MACRO LANGUAGE

Sample FIL File $$ ********************************************************************$$ * V A R I A B L E S S E C T I O N *$$ ********************************************************************$$

REDEF/ON $$ Variable redefinition OK

$$ AddressesA=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=14O=15;P=16;Q=17;R=18;S=19;T=20;U=21;V=22;W=23;X=24;Y=25;Z=26

$$ PARTNO%PARTN=TEXT/'DEFAULT NAME'

$$ SimulationALIAS/%simul_on,DMY=POSTF(2,1,1867,1) $$ PPFUN/8,ALL,OFFALIAS/%simul_off,DMY=POSTF(2,1,1867,0) $$ PPFUN/8,ALL,ONALIAS/%output,DMY=POSTF(13) $$ OUTPUT

$$ ********************************************************************$$ * C I M F I L S E C T I O N *$$ ********************************************************************

$$ ************************************************************* PARTNOCIMFIL/ON,PARTNO$$ This FIL is used to store the PARTNO in %PARTN%PARTN=TEXT/CLW $$ Extract text argument%PARTN=TEXT/OMIT,%PARTN,1 $$ Remove trailing blank%output $$ ProcessCIMFIL/OFF

$$ ************************************************************* MACHINCIMFIL/ON,MACHIN%output $$ process, nothing output before it !$$ Machine Startup$$PPRINT/%PARTN $$ output the PARTNO$$$$ End Machine StartupCIMFIL/OFF

Page 36: Advanced Class

© 2000 PTC 36

What is Pro/NC-GPOST ?What is Pro/NC-GPOST ?

INTRODUCTION TO FIL MACRO LANGUAGE Variables

Real, String, Geometric:TOOL1=12 ; NAME=TEXT/’HELLO’ Max 6 Alphanumeric characters REDEF/ON to allow redefinition of variables Array definition : RESERV/TOOLID,30 ; TOOLID(1)=12

Label : Max 6 Alphanumeric characters : POS10) Scalar assignment : Symbol = Number Arithmetic Operators : + - / * ** ( ) Logical

Operators : .AND. .OR. .GT. .LT. .GE. .LE. .EQ. .NE. .NOT. $$ is a comment line $ at the end of a line indicates continuation on the next line ; terminates current statement.

INTRODUCTION TO FIL MACRO LANGUAGE Variables

Real, String, Geometric:TOOL1=12 ; NAME=TEXT/’HELLO’ Max 6 Alphanumeric characters REDEF/ON to allow redefinition of variables Array definition : RESERV/TOOLID,30 ; TOOLID(1)=12

Label : Max 6 Alphanumeric characters : POS10) Scalar assignment : Symbol = Number Arithmetic Operators : + - / * ** ( ) Logical

Operators : .AND. .OR. .GT. .LT. .GE. .LE. .EQ. .NE. .NOT. $$ is a comment line $ at the end of a line indicates continuation on the next line ; terminates current statement.

Page 37: Advanced Class

© 2000 PTC 37

What is Pro/NC-GPOST ?What is Pro/NC-GPOST ?

INTRODUCTION TO FIL MACRO LANGUAGE Motions & CL commands Functions

function_nameF (arguments) For example : SQRTF(real), COSF(angle), MAXF(real1, …)

String manipulation string_var = TEXT / string1, string2, …. Search & Replace :

newstr = TEXT / MODIFY, oldstr, searchstr, replacestr, nbtimes Remove blank

newstr = TEXT / OMIT, oldstr, option( with option=1 for trailing blank, =2 leading blanks, 3 for all)

Extract a sub-string newstr = TEXT / RANGE, oldstr, startpos, endpos

Get the date : T1 = TEXT / TIMES Get the CL file name and path : CLNAME = TEXT / PART

INTRODUCTION TO FIL MACRO LANGUAGE Motions & CL commands Functions

function_nameF (arguments) For example : SQRTF(real), COSF(angle), MAXF(real1, …)

String manipulation string_var = TEXT / string1, string2, …. Search & Replace :

newstr = TEXT / MODIFY, oldstr, searchstr, replacestr, nbtimes Remove blank

newstr = TEXT / OMIT, oldstr, option( with option=1 for trailing blank, =2 leading blanks, 3 for all)

Extract a sub-string newstr = TEXT / RANGE, oldstr, startpos, endpos

Get the date : T1 = TEXT / TIMES Get the CL file name and path : CLNAME = TEXT / PART

Page 38: Advanced Class

© 2000 PTC 38

What is Pro/NC-GPOST ?What is Pro/NC-GPOST ?

INTRODUCTION TO FIL MACRO LANGUAGE String manipulation

Add non printing characters : newstr = TEXT / CONVS, ascii_val Conversion to string :

Integer to string : string = TEXT / CONVI, integer, num_char Real to string : string = TEXT / CONVF, real, num_char,

decimal string = TEXT / CONVF, real, num_char, decimal, sign, point, zero

Flow control IF-THEN-ELSE CASE DO

INTRODUCTION TO FIL MACRO LANGUAGE String manipulation

Add non printing characters : newstr = TEXT / CONVS, ascii_val Conversion to string :

Integer to string : string = TEXT / CONVI, integer, num_char Real to string : string = TEXT / CONVF, real, num_char,

decimal string = TEXT / CONVF, real, num_char, decimal, sign, point, zero

Flow control IF-THEN-ELSE CASE DO

IF (logical expression) THEN

statement(s)

ELSE

statement(s)

ENDIF

CASE / variableWHEN / value statement(s)….WHEN/OTHERS Statement(s)ENDCAS

DO / label, do_variable=initial_value, final_value, [incr] Statement(s)Label)

Page 39: Advanced Class

© 2000 PTC 39

What is Pro/NC-GPOST ?What is Pro/NC-GPOST ?

INTRODUCTION TO FIL MACRO LANGUAGE : ALIAS Command : create your own commands

ALIAS / %OUTPUT, XX=POSTF(13) ALIAS / %FCL1, XX=POSTF(7,4)

REPLAC Command : replace a string by another in the tape file

T1=TEXT/’( / ‘;T2=TEXT/’(‘;REPLAC/T1,T2 T1=TEXT/’G02’;T2=TEXT/’ARC CCW’;REPLAC/T1,T2

REPEAT Command : issue a register and a value with the next occurrence of a register :

X=24;Y=25;G=7;Z=26;H=8;REPEAT/X,Y,G,54,ALL $$ Output G54 with next X or Y

REPEAT/Z,H,99 $$ Output H99 with next Z POSTN/OUT, … : output a register

D=4; POSTN/OUT,D,5,NEXT$$ Output D5 with next block

INTRODUCTION TO FIL MACRO LANGUAGE : ALIAS Command : create your own commands

ALIAS / %OUTPUT, XX=POSTF(13) ALIAS / %FCL1, XX=POSTF(7,4)

REPLAC Command : replace a string by another in the tape file

T1=TEXT/’( / ‘;T2=TEXT/’(‘;REPLAC/T1,T2 T1=TEXT/’G02’;T2=TEXT/’ARC CCW’;REPLAC/T1,T2

REPEAT Command : issue a register and a value with the next occurrence of a register :

X=24;Y=25;G=7;Z=26;H=8;REPEAT/X,Y,G,54,ALL $$ Output G54 with next X or Y

REPEAT/Z,H,99 $$ Output H99 with next Z POSTN/OUT, … : output a register

D=4; POSTN/OUT,D,5,NEXT$$ Output D5 with next block

Page 40: Advanced Class

© 2000 PTC 40

What is Pro/NC-GPOST ?What is Pro/NC-GPOST ?

INTRODUCTION TO FIL MACRO LANGUAGE POSTF allow access to the internal processing of the

post-processor :

rslt = POSTF ( function_type,arg1, arg2, … argn) rslt is a real or a string that reports the result of the

operation. Function_type is a two_digit number that represents the

function type. There are 26 POSTF functions :

XX=POSTF(13) $$ process current CL rec. XX=POSTF(20) $$ Store current CL rec. XX=POSTF(21) $$ restore CL rec. XX=POSTF(5) $$ number of arguments in CL rec XX=POSTF(7,position) $$ return value of argument at “position” TT=TEXT/CLW $$ return string argument (PPRINT,INSERT,..)

INTRODUCTION TO FIL MACRO LANGUAGE POSTF allow access to the internal processing of the

post-processor :

rslt = POSTF ( function_type,arg1, arg2, … argn) rslt is a real or a string that reports the result of the

operation. Function_type is a two_digit number that represents the

function type. There are 26 POSTF functions :

XX=POSTF(13) $$ process current CL rec. XX=POSTF(20) $$ Store current CL rec. XX=POSTF(21) $$ restore CL rec. XX=POSTF(5) $$ number of arguments in CL rec XX=POSTF(7,position) $$ return value of argument at “position” TT=TEXT/CLW $$ return string argument (PPRINT,INSERT,..)

Page 41: Advanced Class

© 2000 PTC 41

What is Pro/NC-GPOST ?What is Pro/NC-GPOST ?

INTRODUCTION TO FIL MACRO LANGUAGEPro/NC CL record : 12 : SPINDL / RPM, 1500, CLW

Internally stored as : 12,#2000,#1031 / #78 ,1500, #60

CIMFIL / ON, SPINDLNBARG = POSTF( 5) $$ NBARG=6$$ Find type of the argumentsTYPG4=POSTF(6,4) $$ equal 0 (minor word RPM)TYPG5=POSTF(6,5) $$ equal 1 (real 1500)$$ find value of the argumentsVARG4=POSTF(7,4) $$ return 78VARG5=POSTF(7,5) $$ return 1500$$ Test if VARG4 is RPMIF (VARG4 .EQ. ICODEF(RPM)) THEN…..

INTRODUCTION TO FIL MACRO LANGUAGEPro/NC CL record : 12 : SPINDL / RPM, 1500, CLW

Internally stored as : 12,#2000,#1031 / #78 ,1500, #60

CIMFIL / ON, SPINDLNBARG = POSTF( 5) $$ NBARG=6$$ Find type of the argumentsTYPG4=POSTF(6,4) $$ equal 0 (minor word RPM)TYPG5=POSTF(6,5) $$ equal 1 (real 1500)$$ find value of the argumentsVARG4=POSTF(7,4) $$ return 78VARG5=POSTF(7,5) $$ return 1500$$ Test if VARG4 is RPMIF (VARG4 .EQ. ICODEF(RPM)) THEN…..

Page 42: Advanced Class

© 2000 PTC 42

What is Pro/NC-GPOST ?What is Pro/NC-GPOST ?

INTRODUCTION TO FIL MACRO LANGUAGE :Basic FIL Techniques

Always start your FIL file with a standard header :

DMY=POSTF(24,1) $$ debug optionsPRINT/ON REDEF/ON $$ Allow redefinition of Var.$$ AddressesA=1;B=2;C=3;D=4;E=5;F=6;G=7;H=8;I=9;J=10;K=11;L=12M=13;N=14O=15;P=16;Q=17;R=18;S=19;T=20;U=21;V=22;W=23;X=24;Y=25;Z=26

Output something at the beginning of the program

CIMFIL/ON,MACHIN$$ nothing is ouputed to the tape before the $$ MACHIN statement is processedXX=POSTF(13) $$ Process… do what you want to do here ...CIMFIL/OFF

INTRODUCTION TO FIL MACRO LANGUAGE :Basic FIL Techniques

Always start your FIL file with a standard header :

DMY=POSTF(24,1) $$ debug optionsPRINT/ON REDEF/ON $$ Allow redefinition of Var.$$ AddressesA=1;B=2;C=3;D=4;E=5;F=6;G=7;H=8;I=9;J=10;K=11;L=12M=13;N=14O=15;P=16;Q=17;R=18;S=19;T=20;U=21;V=22;W=23;X=24;Y=25;Z=26

Output something at the beginning of the program

CIMFIL/ON,MACHIN$$ nothing is ouputed to the tape before the $$ MACHIN statement is processedXX=POSTF(13) $$ Process… do what you want to do here ...CIMFIL/OFF

Page 43: Advanced Class

© 2000 PTC 43

What is Pro/NC-GPOST ?What is Pro/NC-GPOST ?

INTRODUCTION TO FIL MACRO LANGUAGE :Basic FIL Techniques

Ignore CL record CIMFIL/ON,major_word

CIMFIL/OFF Do something after a CL record

CIMFIL/ON,major_wordXX=POSTF(13) $$ Process CL rec.… do what you want to do here …CIMFIL/OFF

Do something before a CL record CIMFIL/ON,major_word

XX=POSTF(20) $$ Save CL rec.… do what you want to do here …XX=POSTF(21) $$ restore CL rec.XX=POSTF(13) $$ process CL rec.CIMFIL/OFF

INTRODUCTION TO FIL MACRO LANGUAGE :Basic FIL Techniques

Ignore CL record CIMFIL/ON,major_word

CIMFIL/OFF Do something after a CL record

CIMFIL/ON,major_wordXX=POSTF(13) $$ Process CL rec.… do what you want to do here …CIMFIL/OFF

Do something before a CL record CIMFIL/ON,major_word

XX=POSTF(20) $$ Save CL rec.… do what you want to do here …XX=POSTF(21) $$ restore CL rec.XX=POSTF(13) $$ process CL rec.CIMFIL/OFF

Page 44: Advanced Class

© 2000 PTC 44

The Secret of post-processing !The Secret of post-processing !

CHECK THE DETAILS : request and analyze a sample NC tape !CHECK THE DETAILS : request and analyze a sample NC tape !

%O1234(Date:07/01/00 Time:10:45:38)G90G40G80G49G17N1T01M6S8000M3G0G90X.0026Y0.G43Z1.H1M8G1Z-.9809F100.X.0185Z-.9825X.0461Z-.9911X.126Z-1.0244X.2315Z-1.0605X.3216Z-1.0853X.4174Z-1.1063G2G18X.5194Z-1.1234I.123J.04...

G0Z1M5M9G91G28Z0.G28X0.Y0.N2T02M6S10000M3G0G90X0X0.3Y0.G43Z1.H2M8G1Z.3F200…

G0Z1.G91G28Z0.G28X0.Y0.M2%

Page 45: Advanced Class

© 2000 PTC 45

The Secret of post-processing !The Secret of post-processing !

GENERAL FORMATTING DNC type format (no special characters at the beginning

or end of tape) Decimal point, leading an trailing zeros

T01 : tool change keep leading zero F0. X0. M3 G0 : remove trailing zero, decimal point for

real, …

Interpolation : check the type for circle : G2 X Y I J : Circle using IJK, check machine programming

manual for definition G0 Z then X Y : motion analysis

No space between registers

Message starts with ( and ends with )

GENERAL FORMATTING DNC type format (no special characters at the beginning

or end of tape) Decimal point, leading an trailing zeros

T01 : tool change keep leading zero F0. X0. M3 G0 : remove trailing zero, decimal point for

real, …

Interpolation : check the type for circle : G2 X Y I J : Circle using IJK, check machine programming

manual for definition G0 Z then X Y : motion analysis

No space between registers

Message starts with ( and ends with )

Page 46: Advanced Class

© 2000 PTC 46

The Secret of post-processing !The Secret of post-processing !

NC TAPE HEADER% Percent sign at the beginning

O1234 Program number

(Date:07/01/00 Time:10:45:38) Date and time

G90G40G80 Safe startup code

G49G17 Safe startup code

NC TAPE HEADER% Percent sign at the beginning

O1234 Program number

(Date:07/01/00 Time:10:45:38) Date and time

G90G40G80 Safe startup code

G49G17 Safe startup code

CIMFIL/ON,MACHINXX=POSTF(13)DD=TEXT/TIMESINSERT/’(‘,DD,’)$’INSERT/’G90G40G80$’INSERT/’G49G17$’CIMFIL/OFF

Page 47: Advanced Class

© 2000 PTC 47

NC TAPE FOOTERG91G28Z0. Return Home

G28X0.Y0. Return Home

M2 End of tape

% Rewind tape

NC TAPE FOOTERG91G28Z0. Return Home

G28X0.Y0. Return Home

M2 End of tape

% Rewind tape

CIMFIL/ON,FINIXX=POSTF(20)INSERT/’G91G28Z0.$’INSERT/’G28X0.Y0.$’INSERT/’M2$’XX=POSTF(21)XX=POSTF(13)CIMFIL/OFF

The Secret of post-processing !The Secret of post-processing !

Page 48: Advanced Class

© 2000 PTC 48

The Secret of post-processing !The Secret of post-processing !

TOOL CHANGE

First tool change Other tool changeN1T01M6 G91G28Z0.S8000M3 G28X0.Y0.G0G90X.0026Y0. N2T02M6G43Z1.H1M8 S10000M3

G0G90X0X0.3Y0. G43Z1.H2M8

Questionnaire Tool change code (T and M) Length compensation (G43) and default offset H Coolant on first Z

Macro CIMFIL on LOADTL

TOOL CHANGE

First tool change Other tool changeN1T01M6 G91G28Z0.S8000M3 G28X0.Y0.G0G90X.0026Y0. N2T02M6G43Z1.H1M8 S10000M3

G0G90X0X0.3Y0. G43Z1.H2M8

Questionnaire Tool change code (T and M) Length compensation (G43) and default offset H Coolant on first Z

Macro CIMFIL on LOADTL

CIMFIL/ON,LOADTLXX=POSTF(20)IF (FTOOL.NE.0) THEN INSERT/’G91G28Z0.$’ INSERT/’G28X0.Y0.$’ENDIFFTOOL=POSTF(7,4)XX=POSTF(21)XX=POSTF(13)REPEAT/X,Y,G,90,ALLCIMFIL/OFF

FTOOL=0X=24Y=25G=7

Page 49: Advanced Class

global solutions

innovation

collaboration

© 2000 PTC

Pro/NC-GPOSTPro/NC-GPOST

Advanced FIL programmingAdvanced FIL programming

Page 50: Advanced Class

© 2000 PTC 50

Passing information to the CL filePassing information to the CL file

There are two solutions to pass information to the CL file : PPRINT Table : PPRINT/ param name : valueCIMFIL/ON,PPRINT$$ Macro to extract and print $$ only the text after the :MESS=TEXT/CLWMESS=TEXT/OMIT,MESS,1 COLPOS=INDXF(MESS,COL) IF (COLPOS.NE.0) THEN LEN=CANF(MESS,1) NMESS=TEXT/RANGE,MESS,COLPOS+1,LEN PPRINT/NMESS ELSE DMY=POSTF(13)ENDIFCIMFIL/OFF

Inserting CL commands

There are two solutions to pass information to the CL file : PPRINT Table : PPRINT/ param name : valueCIMFIL/ON,PPRINT$$ Macro to extract and print $$ only the text after the :MESS=TEXT/CLWMESS=TEXT/OMIT,MESS,1 COLPOS=INDXF(MESS,COL) IF (COLPOS.NE.0) THEN LEN=CANF(MESS,1) NMESS=TEXT/RANGE,MESS,COLPOS+1,LEN PPRINT/NMESS ELSE DMY=POSTF(13)ENDIFCIMFIL/OFF

Inserting CL commands

Page 51: Advanced Class

© 2000 PTC 51

Passing information to the CL filePassing information to the CL file

Inserting CL commands

major_word / minor_word, values, ….. CL Command can include parameters

A user created parameter An NC sequence parameter A dimension from the design model A value calculated by an analysis feature

For example : VERIFY / ONPPRINT / DWELL : &DWELL:FID_1234

Inserting CL commands

major_word / minor_word, values, ….. CL Command can include parameters

A user created parameter An NC sequence parameter A dimension from the design model A value calculated by an analysis feature

For example : VERIFY / ONPPRINT / DWELL : &DWELL:FID_1234

See example area_turning.zip and probing.zip

Page 52: Advanced Class

© 2000 PTC 52

Debugging a post-processorDebugging a post-processor

To debug the post-processor you need to use the Listing file generated by GPOST (extension .LST )

In Pro/NC run the PP with the TRACE option to trace the CL records in the listing file

In Pro/NC-GPOST Optfile set the listing column display to non modal

To debug the post-processor you need to use the Listing file generated by GPOST (extension .LST )

In Pro/NC run the PP with the TRACE option to trace the CL records in the listing file

In Pro/NC-GPOST Optfile set the listing column display to non modal

Page 53: Advanced Class

© 2000 PTC 53

Debugging a post-processorDebugging a post-processor

In FIL set the trace options PRINT/ON : trace the macro lines in the listing file DMY=POSTF(24,1) : print FIL ISN numbers, this will help

you to find the FIL line creating the problem

When the post-processor is ready for Production put the following commands in the FIL header to minimize the size of the FIL file :

PRINT/OFF,IN ; DMY=POSTF(24,0)

In FIL set the trace options PRINT/ON : trace the macro lines in the listing file DMY=POSTF(24,1) : print FIL ISN numbers, this will help

you to find the FIL line creating the problem

When the post-processor is ready for Production put the following commands in the FIL header to minimize the size of the FIL file :

PRINT/OFF,IN ; DMY=POSTF(24,0)

•Edit the Listing File•Search for the word ERROR •Check the ISN Number•Go to the ISN number in the FIL header of the listing file

Page 54: Advanced Class

© 2000 PTC 54

The TEXT Command The TEXT Command

The TEXT statement is used to assign a symbol to a string of characters.

Symbol = TEXT / string, string1, string2, … stringn

Search & Replace: the MODIFY option allows to perform a search/replace on a string :

newstr = TEXT / MODIFY, oldstr, searchstr, replacestr, nbtimes

Remove blanks: the OMIT option allows to remove blank from a string :

newstr = TEXT / OMIT, oldstr, option(where option =1 for trailing blanks, =2 for leading blanks, =3 for all blanks)

Note : Each time you want to print a text string coming from the CL file, do not forget to use : TXT=TEXT/CLW, TXT=TEXT/OMIT,TXT,1

The TEXT statement is used to assign a symbol to a string of characters.

Symbol = TEXT / string, string1, string2, … stringn

Search & Replace: the MODIFY option allows to perform a search/replace on a string :

newstr = TEXT / MODIFY, oldstr, searchstr, replacestr, nbtimes

Remove blanks: the OMIT option allows to remove blank from a string :

newstr = TEXT / OMIT, oldstr, option(where option =1 for trailing blanks, =2 for leading blanks, =3 for all blanks)

Note : Each time you want to print a text string coming from the CL file, do not forget to use : TXT=TEXT/CLW, TXT=TEXT/OMIT,TXT,1

Page 55: Advanced Class

© 2000 PTC 55

The TEXT CommandThe TEXT Command

Extract a sub-string: newstr = TEXT / RANGE, oldstr, startpos, endpos

Add non printing characters: newstr = TEXT / CONVS, ascii_val

Example: EOT=TEXT/CONVS,4 $$ EOT for Maho

Get current date and time: T1 = TEXT/TIMES [,0] >2 digits years

T1=TEXT/TIMES,1 > 4 digits year

Get CL file name:

CLNAME = TEXT / PART

Extract a sub-string: newstr = TEXT / RANGE, oldstr, startpos, endpos

Add non printing characters: newstr = TEXT / CONVS, ascii_val

Example: EOT=TEXT/CONVS,4 $$ EOT for Maho

Get current date and time: T1 = TEXT/TIMES [,0] >2 digits years

T1=TEXT/TIMES,1 > 4 digits year

Get CL file name:

CLNAME = TEXT / PART

Page 56: Advanced Class

© 2000 PTC 56

The TEXT CommandThe TEXT Command

EXAMPLE

$$ extract the date or the time

T1=TEXT/TIMES $$ return the date and time

T2=TEXT/’ ’ $$ one space string

SPOS=INDXF(T1,T2) $$ position of space in T1

$$ extract the date from T1 (date and time)

TDATE=TEXT/RANGE,T1,1,(SPOS-1)

$$

TLEN=CANF(T1,1) $$ string length

$$ Extract the time from T1

TTIME=TEXT/RANGE,(SPOS+1),TLEN

EXAMPLE

$$ extract the date or the time

T1=TEXT/TIMES $$ return the date and time

T2=TEXT/’ ’ $$ one space string

SPOS=INDXF(T1,T2) $$ position of space in T1

$$ extract the date from T1 (date and time)

TDATE=TEXT/RANGE,T1,1,(SPOS-1)

$$

TLEN=CANF(T1,1) $$ string length

$$ Extract the time from T1

TTIME=TEXT/RANGE,(SPOS+1),TLEN

Page 57: Advanced Class

© 2000 PTC 57

The TEXT CommandThe TEXT Command

T1=TEXT/CONVI,12,4 $$ -> T1 is ‘ 12’

R1=12.345678

T1=TEXT/CONVF,R1,7,4 $$ -> T1 is ‘12.3456’

T2=TEXT/CONVF,R1,8,3 $$ -> T2 is ‘ 12.345’

R2=1234567.8912

T1=TEXT/CONVF,R2,8,3 $$ -> Error it is not possible

R3= 0.01236

T1=TEXT/CONVE,R3,12,6 $$ -> ‘ .123600-01’

T1=TEXT/CONVI,12,4 $$ -> T1 is ‘ 12’

R1=12.345678

T1=TEXT/CONVF,R1,7,4 $$ -> T1 is ‘12.3456’

T2=TEXT/CONVF,R1,8,3 $$ -> T2 is ‘ 12.345’

R2=1234567.8912

T1=TEXT/CONVF,R2,8,3 $$ -> Error it is not possible

R3= 0.01236

T1=TEXT/CONVE,R3,12,6 $$ -> ‘ .123600-01’

Page 58: Advanced Class

© 2000 PTC 58

The TEXT CommandThe TEXT Command

CLNAME = MACRO / $$ Macro to extract CL file name without extension and path PRG=TEXT/PART

$$ Strip-out absolute path in CL file name (Unix and NT) PRGLEN=CANF(PRG,1) DO/SLASH,LOOPV=PRGLEN,4,-1 1CHAR=TEXT/RANGE,PRG,LOOPV,LOOPV ASCII=ICHARF(1CHAR) IF(ASCII.EQ.47.OR.ASCII.EQ.92)THEN PRG=TEXT/RANGE,PRG,LOOPV+1,PRGLEN JUMPTO/OK1 ENDIF SLASH)CONTIN OK1)CONTIN

.. To continue ...

CLNAME = MACRO / $$ Macro to extract CL file name without extension and path PRG=TEXT/PART

$$ Strip-out absolute path in CL file name (Unix and NT) PRGLEN=CANF(PRG,1) DO/SLASH,LOOPV=PRGLEN,4,-1 1CHAR=TEXT/RANGE,PRG,LOOPV,LOOPV ASCII=ICHARF(1CHAR) IF(ASCII.EQ.47.OR.ASCII.EQ.92)THEN PRG=TEXT/RANGE,PRG,LOOPV+1,PRGLEN JUMPTO/OK1 ENDIF SLASH)CONTIN OK1)CONTIN

.. To continue ...

Page 59: Advanced Class

© 2000 PTC 59

The TEXT CommandThe TEXT Command

...$$ Strip out extensions and convert name to uppercase PGNAME=TEXT/' ' PRGLEN=CANF(PRG,1) DO/DOT,LOOPV=1,PRGLEN,1 1CHAR=TEXT/RANGE,PRG,LOOPV,LOOPV ASCII=ICHARF(1CHAR) IF(ASCII.EQ.46)THEN JUMPTO/OK2 ELSE IF(ASCII.GE.97.AND.ASCII.LE.122)THEN PGNAME=TEXT/PGNAME,(TEXT/CONVS,ASCII-32) ELSE PGNAME=TEXT/PGNAME,1CHAR ENDIF ENDIF DOT)CONTIN OK2)CONTIN CLNAM=TEXT/OMIT,PGNAME,2TERMAC

...$$ Strip out extensions and convert name to uppercase PGNAME=TEXT/' ' PRGLEN=CANF(PRG,1) DO/DOT,LOOPV=1,PRGLEN,1 1CHAR=TEXT/RANGE,PRG,LOOPV,LOOPV ASCII=ICHARF(1CHAR) IF(ASCII.EQ.46)THEN JUMPTO/OK2 ELSE IF(ASCII.GE.97.AND.ASCII.LE.122)THEN PGNAME=TEXT/PGNAME,(TEXT/CONVS,ASCII-32) ELSE PGNAME=TEXT/PGNAME,1CHAR ENDIF ENDIF DOT)CONTIN OK2)CONTIN CLNAM=TEXT/OMIT,PGNAME,2TERMAC

Page 60: Advanced Class

© 2000 PTC 60

The TEXT CommandThe TEXT Command

String Conversion Integer to string: string =

TEXT / CONVI, integer, num_chars

Real to string (fix point notation):

string = TEXT / CONVF, real, num_chars, decimalstring = TEXT / CONVF, real, num_chars, decimal, $

sign, point, zero

Exponential notation:

string = TEXT / CONVE, real, decimal Upper Case, Lower Case

string = TEXT / UP, string to convertstring = TEXT / LOW, string to convert

Note : In either case, string will be right-justified

String Conversion Integer to string: string =

TEXT / CONVI, integer, num_chars

Real to string (fix point notation):

string = TEXT / CONVF, real, num_chars, decimalstring = TEXT / CONVF, real, num_chars, decimal, $

sign, point, zero

Exponential notation:

string = TEXT / CONVE, real, decimal Upper Case, Lower Case

string = TEXT / UP, string to convertstring = TEXT / LOW, string to convert

Note : In either case, string will be right-justified

Page 61: Advanced Class

© 2000 PTC 61

The TEXT CommandThe TEXT Command

T1=TEXT/CONVI,12,4 $$ -> T1 is ‘ 12’

R1=12.345678

T1=TEXT/CONVF,R1,7,4 $$ -> T1 is ‘12.3456’

T2=TEXT/CONVF,R1,8,3 $$ -> T2 is ‘ 12.345’

R2=1234567.8912

T1=TEXT/CONVF,R2,8,3 $$ -> Error it is not possible

R3= 0.01236

T1=TEXT/CONVE,R3,12,6 $$ -> ‘ .123600-01’

T1=TEXT/CONVI,12,4 $$ -> T1 is ‘ 12’

R1=12.345678

T1=TEXT/CONVF,R1,7,4 $$ -> T1 is ‘12.3456’

T2=TEXT/CONVF,R1,8,3 $$ -> T2 is ‘ 12.345’

R2=1234567.8912

T1=TEXT/CONVF,R2,8,3 $$ -> Error it is not possible

R3= 0.01236

T1=TEXT/CONVE,R3,12,6 $$ -> ‘ .123600-01’

Page 62: Advanced Class

© 2000 PTC 62

The TEXT CommandThe TEXT Command

EXAMPLES OF CONVERSION

IZERO = MACRO / VAL,SIZE$$ Format an integer with leading zero$$ VAL is the value to format$$ SIZE is the size of the registerRETVAL=TEXT/CONVF,VAL,SIZE,0,0,1,1TERMAC

IREAL = MACRO / VAL,DECIM$$ Format a real with decimal point$$ no leading and trailing zero$$ DECIM is the number of digits after decimal pointRETVAL=TEXT/CONVF,VAL,8,DECIM,0,0,4TERMAC

CALL/IZERO,VAL=2,SIZE=3INSERT/’T’,RETVAL $$ Will print T002

CALL/IREAL,VAL=12.34567,DECIM=3INSERT/’X’,RETVAL $$ Will print X12.345

EXAMPLES OF CONVERSION

IZERO = MACRO / VAL,SIZE$$ Format an integer with leading zero$$ VAL is the value to format$$ SIZE is the size of the registerRETVAL=TEXT/CONVF,VAL,SIZE,0,0,1,1TERMAC

IREAL = MACRO / VAL,DECIM$$ Format a real with decimal point$$ no leading and trailing zero$$ DECIM is the number of digits after decimal pointRETVAL=TEXT/CONVF,VAL,8,DECIM,0,0,4TERMAC

CALL/IZERO,VAL=2,SIZE=3INSERT/’T’,RETVAL $$ Will print T002

CALL/IREAL,VAL=12.34567,DECIM=3INSERT/’X’,RETVAL $$ Will print X12.345

Page 63: Advanced Class

© 2000 PTC 63

The TEXT CommandThe TEXT Command

Example : techniques to output lower and upper case together :Example : techniques to output lower and upper case together :

$$ LOWER CASE ALPHA A-ZLCA=097;LCB=098;LCC=099;LCD=100;LCE=101;LCF=102LCG=103;LCH=104;LCI=105;LCJ=106;LCK=107;LCL=108LCM=109;LCN=110;LCO=111;LCP=112;LCQ=113;LCR=114LCS=115;LCT=116;LCU=117;LCV=118;LCW=119;LCX=120LCY=121;LCZ=122$$$$$$ OUTPUT COMBINED LOW/UP CASE TEXTCIMFIL/ON,LOADTL DMY=POSTF(20) $$ SAVE LOADTL $$ ALL INSERTS ARE SAME $$ TYPE-1 INSERT/'T',(TEXT/LOW,(TEXT/'his is a ')),$ 'T',(TEXT/LOW,(TEXT/'est')),'$'

$$ TYPE-2 INSERT/'T',(TEXT/LOW,(TEXT/'HIS IS A ')),$ 'T',(TEXT/LOW,(TEXT/'EST')),'$'

$$ TYPE-3 USING CONTIN CHAR INTCOM(1951)=92 (BACKSLASH \) INSERT/'T\$' SEQNO/OFF INSERT/(TEXT/LOW,(TEXT/'his is a \$')) INSERT/'T\$' INSERT/(TEXT/LOW,(TEXT/'est')) INSERT/'$' SEQNO/ON

$$ TYPE-4 T1=TEXT/'T',(TEXT/LOW,(TEXT/'HIS IS A ')),$ 'T',(TEXT/LOW,(TEXT/'EST')),'$' INSERT/T1

$$ TYPE-5 T1=TEXT/'T',(TEXT/LOW,(TEXT/'HIS IS A ')) T2=TEXT/'T',(TEXT/LOW,(TEXT/'EST')) INSERT/T1,T2,'$'

$$ TYPE-6 T1=TEXT/'T',$ CONVS,LCH,$ CONVS,LCI,$ CONVS,LCS,$ ' ',$ CONVS,LCI,$ CONVS,LCS,$ ' ',$ CONVS,LCA,$ ' ',$ 'T',$ CONVS,LCE,$ CONVS,LCS,$ CONVS,LCT INSERT/T1,'$'

Page 64: Advanced Class

© 2000 PTC 64

Functions in Pro/NC-GPOSTFunctions in Pro/NC-GPOST

The general syntax is :

function_nameF (arguments)

Examples: ABSF(n) : absolute value of a real

ATANF(tangent) : arctangent of an angle

COSF(angle) : cosine (degrees)

INDXF (string1, string2) : index of a sub-string

MAXF(real1, real2, …) largest value

SQRT(real) : square root

SCALF (string) : convert to real

Not documented : ACOSF, ASINF

The general syntax is :

function_nameF (arguments)

Examples: ABSF(n) : absolute value of a real

ATANF(tangent) : arctangent of an angle

COSF(angle) : cosine (degrees)

INDXF (string1, string2) : index of a sub-string

MAXF(real1, real2, …) largest value

SQRT(real) : square root

SCALF (string) : convert to real

Not documented : ACOSF, ASINF

Page 65: Advanced Class

© 2000 PTC 65

POSTF FunctionsPOSTF Functions

POSTF allow access to the internal processing of the post-processor :

rslt = POSTF ( function_type,arg1, arg2, … argn)

rslt is a real or a string that reports the result of the operation.

Function_type is a two_digit number that represents the function type.

There are 27 POSTF functions.

POSTF allow access to the internal processing of the post-processor :

rslt = POSTF ( function_type,arg1, arg2, … argn)

rslt is a real or a string that reports the result of the operation.

Function_type is a two_digit number that represents the function type.

There are 27 POSTF functions.

Page 66: Advanced Class

© 2000 PTC 66

POSTF FunctionsPOSTF Functions

Get Common value

rslt = POSTF (1, type, location)

rslt : common value returned

type : 1:INTCOM 2:RELCOM 3:DBLCOM

location : common location number to get

Set Common value

rslt = POSTF (2, type, location, value)

rslt : 0

type : 1:INTCOM 2:RELCOM 3:DBLCOM

location : common location number

value : value to be stored in the common location

Get Common value

rslt = POSTF (1, type, location)

rslt : common value returned

type : 1:INTCOM 2:RELCOM 3:DBLCOM

location : common location number to get

Set Common value

rslt = POSTF (2, type, location, value)

rslt : 0

type : 1:INTCOM 2:RELCOM 3:DBLCOM

location : common location number

value : value to be stored in the common location

Page 67: Advanced Class

© 2000 PTC 67

POSTF FunctionsPOSTF Functions

EXAMPLES : $$ get current MXRPM programmed

$$ this is RELCOM 1

MRPM=POSTF(1,2,1)

$$ Get current Feed mode

$$ This is INTCOM 492

FMODE=POSTF(1,1,492) $$ return G94 or G93

REDEF/ON $$ allow redefinition of DMY

$$ Change G codes for circle CLW and CCLW

$$ There are INTCOM 498(CCLW) and 499(CLW)

DMY=POSTF(2,1,498,13) $$ CCLW is G13

DMY=POSTF(2,1,499,12) $$ CLW is G12

EXAMPLES : $$ get current MXRPM programmed

$$ this is RELCOM 1

MRPM=POSTF(1,2,1)

$$ Get current Feed mode

$$ This is INTCOM 492

FMODE=POSTF(1,1,492) $$ return G94 or G93

REDEF/ON $$ allow redefinition of DMY

$$ Change G codes for circle CLW and CCLW

$$ There are INTCOM 498(CCLW) and 499(CLW)

DMY=POSTF(2,1,498,13) $$ CCLW is G13

DMY=POSTF(2,1,499,12) $$ CLW is G12

Page 68: Advanced Class

© 2000 PTC 68

POSTF FunctionsPOSTF Functions

EXAMPLES :

$$ Multiply the X value by -2XX = POSTF(2,3,486,-2)

$$ Get RAPID flagRAP = POSTF(1,1,856)IF (RAP.EQ.ICODEF(ON)) THEN $$ We have a RAPID move …ELSE $$ We have a feed move …ENDIF

EXAMPLES :

$$ Multiply the X value by -2XX = POSTF(2,3,486,-2)

$$ Get RAPID flagRAP = POSTF(1,1,856)IF (RAP.EQ.ICODEF(ON)) THEN $$ We have a RAPID move …ELSE $$ We have a feed move …ENDIF

Page 69: Advanced Class

© 2000 PTC 69

POSTF FunctionsPOSTF Functions

PLABEL Command

PLABEL / OPTION, number , TO, value This command is used to access directly some of the

INTCOMs :

PLABEL / OPTION,1 ,TO,1 = POSTF ( 2,1,1831,1)WARNING : PLABEL is a CL command (and will be treated by GPOST as a CL command) and POSTF a function. It is

recommended to use POSTF(2 instead of PLABEL in a FIL macro

Examples :PLABEL / OPTION, 19, TO , 0 $$ Do not check travel limitsPLABEL / OPTION, 19, TO, 1 $$ Check travel limitsPLABEL / OPTION, 19, TO, 2 $$ Check travel limits and call

$$ _REPOS macro is neededPLABEL / OPTION, 65, TO, 2 $$ Special DPM for MILL/TURNPLABEL / OPTION, 88, TO, 1 $$ Axis registers non modalPLABEL / OPTION, 18, TO, 1 $$ remove redundant F code

PLABEL Command

PLABEL / OPTION, number , TO, value This command is used to access directly some of the

INTCOMs :

PLABEL / OPTION,1 ,TO,1 = POSTF ( 2,1,1831,1)WARNING : PLABEL is a CL command (and will be treated by GPOST as a CL command) and POSTF a function. It is

recommended to use POSTF(2 instead of PLABEL in a FIL macro

Examples :PLABEL / OPTION, 19, TO , 0 $$ Do not check travel limitsPLABEL / OPTION, 19, TO, 1 $$ Check travel limitsPLABEL / OPTION, 19, TO, 2 $$ Check travel limits and call

$$ _REPOS macro is neededPLABEL / OPTION, 65, TO, 2 $$ Special DPM for MILL/TURNPLABEL / OPTION, 88, TO, 1 $$ Axis registers non modalPLABEL / OPTION, 18, TO, 1 $$ remove redundant F code

Page 70: Advanced Class

© 2000 PTC 70

POSTF FunctionsPOSTF Functions

Set Common value to empty

rslt = POSTF (3, type, location)

rslt : 0

type : 1:INTCOM 2:RELCOM 3:DBLCOM

location : common location number to set

Test for Common empty

rslt = POSTF (4, type, location)

rslt : 0:unused 1:empty

type : 1:INTCOM 2:RELCOM 3:DBLCOM

location : common location number to check

Set Common value to empty

rslt = POSTF (3, type, location)

rslt : 0

type : 1:INTCOM 2:RELCOM 3:DBLCOM

location : common location number to set

Test for Common empty

rslt = POSTF (4, type, location)

rslt : 0:unused 1:empty

type : 1:INTCOM 2:RELCOM 3:DBLCOM

location : common location number to check

Page 71: Advanced Class

© 2000 PTC 71

POSTF FunctionsPOSTF Functions

EXAMPLES : G1 non modal

$$ CLEAR PREV-G LOCATION AND FORCE G-OUTPUTCIMFIL/ON,5 $$ Empty last content of register G (7) : DMY=POSTF(3,3,(355+7)) DMY=POSTF(13)CIMFIL/OFF

Output -0 instead of -360 DMY = POSTF(2,1,2706,0) $

$ Output -0 instead of -360

EXAMPLES : G1 non modal

$$ CLEAR PREV-G LOCATION AND FORCE G-OUTPUTCIMFIL/ON,5 $$ Empty last content of register G (7) : DMY=POSTF(3,3,(355+7)) DMY=POSTF(13)CIMFIL/OFF

Output -0 instead of -360 DMY = POSTF(2,1,2706,0) $

$ Output -0 instead of -360

Page 72: Advanced Class

© 2000 PTC 72

POSTF FunctionsPOSTF Functions

Output current post block

rslt = POSTF(19)

Get Machine number

rslt = POSTF(22)

rslt : machine number

Move Common values

rslt = POSTF(23, type, new_location, existing_location)

rslt : 0

type : 1:INTCOM 2:RELCOM 3:DBLCOM

new_location : new common location number

existing_location : existing common location

Output current post block

rslt = POSTF(19)

Get Machine number

rslt = POSTF(22)

rslt : machine number

Move Common values

rslt = POSTF(23, type, new_location, existing_location)

rslt : 0

type : 1:INTCOM 2:RELCOM 3:DBLCOM

new_location : new common location number

existing_location : existing common location

Page 73: Advanced Class

© 2000 PTC 73

POSTF FunctionsPOSTF Functions

EXAMPLE

CL Command output alone on one NC block

CIMFIL / ON, major_wordXX = POSTF(19) $$ Purge current blockXX=POSTF(13) $$ Process major wordXX=POSTF(19) $$ Purge current blockCIMFIL/OFF

EXAMPLE

CL Command output alone on one NC block

CIMFIL / ON, major_wordXX = POSTF(19) $$ Purge current blockXX=POSTF(13) $$ Process major wordXX=POSTF(19) $$ Purge current blockCIMFIL/OFF

Page 74: Advanced Class

© 2000 PTC 74

POSTF FunctionsPOSTF Functions

Get number of arguments of current CL record

rslt = POSTF(5)

rslt : number of arguments

Get CL word type

rslt = POSTF(6, location)

rslt : 0:minor word 1:real 2:text

location : argument number

Get CL word value

rslt = POSTF(7, location)

rslt : value

location : argument number

Get number of arguments of current CL record

rslt = POSTF(5)

rslt : number of arguments

Get CL word type

rslt = POSTF(6, location)

rslt : 0:minor word 1:real 2:text

location : argument number

Get CL word value

rslt = POSTF(7, location)

rslt : value

location : argument number

Page 75: Advanced Class

© 2000 PTC 75

Pro/NC CL record : 12 : SPINDL / RPM, 1500, CLW

Internally stored as : 12,#2000,#1031 / #78 ,1500, #60

CIMFIL / ON, SPINDL

NBARG = POSTF( 5) $$ NBARG=6CLREC = POSTF(7,1) $$ CLREC=12

$$ Find type of the arguments

TYPG4=POSTF(6,4) $$ equal to 0 (minor word RPM)

TYPG5=POSTF(6,5) $$ equal to 1 (real 1500)

$$ find value of the arguments

VARG4=POSTF(7,4) $$ returns 78

VARG5=POSTF(7,5) $$ returns 150

$$ Test if VARG4 is RPM

IF (VARG4 .EQ. ICODEF(RPM)) THEN…..

Pro/NC CL record : 12 : SPINDL / RPM, 1500, CLW

Internally stored as : 12,#2000,#1031 / #78 ,1500, #60

CIMFIL / ON, SPINDL

NBARG = POSTF( 5) $$ NBARG=6CLREC = POSTF(7,1) $$ CLREC=12

$$ Find type of the arguments

TYPG4=POSTF(6,4) $$ equal to 0 (minor word RPM)

TYPG5=POSTF(6,5) $$ equal to 1 (real 1500)

$$ find value of the arguments

VARG4=POSTF(7,4) $$ returns 78

VARG5=POSTF(7,5) $$ returns 150

$$ Test if VARG4 is RPM

IF (VARG4 .EQ. ICODEF(RPM)) THEN…..

POSTF FunctionsPOSTF Functions

Page 76: Advanced Class

© 2000 PTC 76

POSTF FunctionsPOSTF Functions

Get CL Text

string = TEXT / CLW (function 8)

Load a minor word

rslt = POSTF(9, location, word)

rslt : 0

location : argument to be set

word : integer code of minor word to be set

Load a scalar

rslt = POSTF(10, location, value)

rslt : 0

location : argument to be set

value : real value to set

Get CL Text

string = TEXT / CLW (function 8)

Load a minor word

rslt = POSTF(9, location, word)

rslt : 0

location : argument to be set

word : integer code of minor word to be set

Load a scalar

rslt = POSTF(10, location, value)

rslt : 0

location : argument to be set

value : real value to set

Page 77: Advanced Class

© 2000 PTC 77

POSTF FunctionsPOSTF Functions

EXAMPLE Do not process PPRINT with the word “COMMENTS”

CIMFIL/ON,PPRINT$$ Start on all PPRINT$$ Do not process PPRINTs containing the word

COMMENTSTXT=TEXT/CLW $$ extract the PPRINT textTEST=TEXT / ‘COMMENTS’OK = INDXF ( TXT, TEST) $$ Position of TEST in TXTIF (OK .EQ. 0) THEN$$ this is not the word COMMENTS$$ Process the PPRINT DMY = POSTF(13)ENDIFCIMFIL / OFF

EXAMPLE Do not process PPRINT with the word “COMMENTS”

CIMFIL/ON,PPRINT$$ Start on all PPRINT$$ Do not process PPRINTs containing the word

COMMENTSTXT=TEXT/CLW $$ extract the PPRINT textTEST=TEXT / ‘COMMENTS’OK = INDXF ( TXT, TEST) $$ Position of TEST in TXTIF (OK .EQ. 0) THEN$$ this is not the word COMMENTS$$ Process the PPRINT DMY = POSTF(13)ENDIFCIMFIL / OFF

Page 78: Advanced Class

© 2000 PTC 78

POSTF FunctionsPOSTF Functions

Set number of CL words

rslt = POSTF(12, number_of_words)

rslt : 0

number_of_words : number of arguments

Execute current CL record

rslt = POSTF(13)

Save current CL record

rslt = POSTF(20)

Restore saved CL record

rslt = POSTF(21)

Set number of CL words

rslt = POSTF(12, number_of_words)

rslt : 0

number_of_words : number of arguments

Execute current CL record

rslt = POSTF(13)

Save current CL record

rslt = POSTF(20)

Restore saved CL record

rslt = POSTF(21)

Page 79: Advanced Class

© 2000 PTC 79

POSTF FunctionsPOSTF Functions

EXAMPLE Remove COOLNT options

CIMFIL / ON , COOLNT$$ Starts on all COOLNT commands$$ Process only the first parameter of COOLNT (position 4)$$ by changing the number of arguments to 4DMY = POSTF (12, 4)$$ Process the recordDMY = POSTF (13)CIMFIL / OFF

EXAMPLE Remove COOLNT options

CIMFIL / ON , COOLNT$$ Starts on all COOLNT commands$$ Process only the first parameter of COOLNT (position 4)$$ by changing the number of arguments to 4DMY = POSTF (12, 4)$$ Process the recordDMY = POSTF (13)CIMFIL / OFF

Page 80: Advanced Class

© 2000 PTC 80

POSTF FunctionsPOSTF Functions

Read next CL record

rslt = POSTF(14)

rslt : 0=OK 1=Error

Position to CL record

rslt = POSTF(15, cl_rec_number)rslt : 0:OK 1=Errorcl_rec_number : position to go to in CL file

Control CIMFIL/ON

rslt = POSTF(26,class, sub-class, status)rslt : 0class : class of PP wordsub-class : sub-class of PP wordstatus : 0:disabled 1:enabled

Read next CL record

rslt = POSTF(14)

rslt : 0=OK 1=Error

Position to CL record

rslt = POSTF(15, cl_rec_number)rslt : 0:OK 1=Errorcl_rec_number : position to go to in CL file

Control CIMFIL/ON

rslt = POSTF(26,class, sub-class, status)rslt : 0class : class of PP wordsub-class : sub-class of PP wordstatus : 0:disabled 1:enabled

Page 81: Advanced Class

© 2000 PTC 81

REPLAC CommandREPLAC Command

The REPLAC command allows to edit/modify the tape output block :

REPLAC / string, replace_string, [nb_times nb_block]

REPLAC / string, replace_string, wild_card, [nbt, nbb]

REPLAC / string, OFF

REPLAC / OFF REPLAC is a FIL command REPLAC are applied in the order of definition

Typical Applications

Change the order of output of G codes, for example for

cycles : G81G99 to G99G81, G82G99 to G99G82, …

REPLAC/(TEXT/'G8?G99'),(TEXT/'G99G8?'),(TEXT/'?')

The REPLAC command allows to edit/modify the tape output block :

REPLAC / string, replace_string, [nb_times nb_block]

REPLAC / string, replace_string, wild_card, [nbt, nbb]

REPLAC / string, OFF

REPLAC / OFF REPLAC is a FIL command REPLAC are applied in the order of definition

Typical Applications

Change the order of output of G codes, for example for

cycles : G81G99 to G99G81, G82G99 to G99G82, …

REPLAC/(TEXT/'G8?G99'),(TEXT/'G99G8?'),(TEXT/'?')

Page 82: Advanced Class

© 2000 PTC 82

REPLAC CommandREPLAC Command

Remove the / in PPRINT message :T1=TEXT/’( /’;T2=TEXT/’(‘;REPLAC/T1,T2

Add “Excess zero” : XX1=TEXT/'. ';XX2=TEXT/'.0 ';REPLAC/XX1,XX2XX1=TEXT/'-.';XX2=TEXT/'-0.';REPLAC/XX1,XX2XX1=TEXT/'X.';XX2=TEXT/'X0.';REPLAC/XX1,XX2XX1=TEXT/'Y.';XX2=TEXT/'Y0.';REPLAC/XX1,XX2XX1=TEXT/'Z.';XX2=TEXT/'Z0.';REPLAC/XX1,XX2XX1=TEXT/'P.';XX2=TEXT/'P0.';REPLAC/XX1,XX2XX1=TEXT/'Q.';XX2=TEXT/'Q0.';REPLAC/XX1,XX2XX1=TEXT/'R.';XX2=TEXT/'R0.';REPLAC/XX1,XX2XX1=TEXT/'I.';XX2=TEXT/'I0.';REPLAC/XX1,XX2XX1=TEXT/'J.';XX2=TEXT/'J0.';REPLAC/XX1,XX2XX1=TEXT/'K.';XX2=TEXT/'K0.';REPLAC/XX1,XX2XX1=TEXT/'F.';XX2=TEXT/'F0.';REPLAC/XX1,XX2

Remove the / in PPRINT message :T1=TEXT/’( /’;T2=TEXT/’(‘;REPLAC/T1,T2

Add “Excess zero” : XX1=TEXT/'. ';XX2=TEXT/'.0 ';REPLAC/XX1,XX2XX1=TEXT/'-.';XX2=TEXT/'-0.';REPLAC/XX1,XX2XX1=TEXT/'X.';XX2=TEXT/'X0.';REPLAC/XX1,XX2XX1=TEXT/'Y.';XX2=TEXT/'Y0.';REPLAC/XX1,XX2XX1=TEXT/'Z.';XX2=TEXT/'Z0.';REPLAC/XX1,XX2XX1=TEXT/'P.';XX2=TEXT/'P0.';REPLAC/XX1,XX2XX1=TEXT/'Q.';XX2=TEXT/'Q0.';REPLAC/XX1,XX2XX1=TEXT/'R.';XX2=TEXT/'R0.';REPLAC/XX1,XX2XX1=TEXT/'I.';XX2=TEXT/'I0.';REPLAC/XX1,XX2XX1=TEXT/'J.';XX2=TEXT/'J0.';REPLAC/XX1,XX2XX1=TEXT/'K.';XX2=TEXT/'K0.';REPLAC/XX1,XX2XX1=TEXT/'F.';XX2=TEXT/'F0.';REPLAC/XX1,XX2

Page 83: Advanced Class

© 2000 PTC 83

REPEAT CommandREPEAT Command

The REPEAT Command is used to output an extra address and value automatically whenever a specific address is output.

REPEAT / register1, register2, value, [ON or OFF] register1 : register to force the output

register2 : register to output

value : value for the register

ON : register2 will be output for every occurrence of register1 until OFF is programmed.

REPEAT / register1, register2, ... Register_out, value, ALL

In this case any occurrence of either register1, register2, … registern will force the output of register_out with its value

Important : try to use REPEAT/OFF before a

REPEAT to “empty” the REPEAT table

The REPEAT Command is used to output an extra address and value automatically whenever a specific address is output.

REPEAT / register1, register2, value, [ON or OFF] register1 : register to force the output

register2 : register to output

value : value for the register

ON : register2 will be output for every occurrence of register1 until OFF is programmed.

REPEAT / register1, register2, ... Register_out, value, ALL

In this case any occurrence of either register1, register2, … registern will force the output of register_out with its value

Important : try to use REPEAT/OFF before a

REPEAT to “empty” the REPEAT table

Page 84: Advanced Class

© 2000 PTC 84

REPEAT CommandREPEAT Command

Example of application : Output Spindle start with next Z

M=13;S=19;Z=26CIMFIL / ON, SPINDLARG1=POSTF(7,4) $$ first argument of SPINDLIF (ARG1 .NE. (ICODEF(OFF))) THEN DMY=POSTF(2,1,1867,1) $$ Disable tape output DMY=POSTF(13) $$ Process Spindl DMY=POSTF(2,1,1867,0) $$ Enable Tape output REPEAT / OFF REPEAT / Z, M, 3 $$ Output M3 with next Z $$ Get current Spindle speed (DBLCOM 10) SRPM=POSTF(1,3,10) REPEAT / Z, S, SRPM $$ Output Svalue with next ZELSE DMY=POSTF(13) $$ Process SPINDL/OFFENDIFCIMFIL / OFF

Example of application : Output Spindle start with next Z

M=13;S=19;Z=26CIMFIL / ON, SPINDLARG1=POSTF(7,4) $$ first argument of SPINDLIF (ARG1 .NE. (ICODEF(OFF))) THEN DMY=POSTF(2,1,1867,1) $$ Disable tape output DMY=POSTF(13) $$ Process Spindl DMY=POSTF(2,1,1867,0) $$ Enable Tape output REPEAT / OFF REPEAT / Z, M, 3 $$ Output M3 with next Z $$ Get current Spindle speed (DBLCOM 10) SRPM=POSTF(1,3,10) REPEAT / Z, S, SRPM $$ Output Svalue with next ZELSE DMY=POSTF(13) $$ Process SPINDL/OFFENDIFCIMFIL / OFF

Page 85: Advanced Class

© 2000 PTC 85

REPEAT CommandREPEAT Command

Output fixture offset with next motion

CIMFIL/ON,SET$$ Macro on SET$$ Output fixture offset with next motion$$ Extract the fixture offset valueIF (POSTF(6,5).EQ.1) THEN$$ Argument 2 is a real FIXT=POSTF(7,5)$$ output with next X or Y REPEAT/OFF REPEAT/X,Y,G,FIXT,ALLENDIFCIMFIL/OFF

Output fixture offset with next motion

CIMFIL/ON,SET$$ Macro on SET$$ Output fixture offset with next motion$$ Extract the fixture offset valueIF (POSTF(6,5).EQ.1) THEN$$ Argument 2 is a real FIXT=POSTF(7,5)$$ output with next X or Y REPEAT/OFF REPEAT/X,Y,G,FIXT,ALLENDIFCIMFIL/OFF

Page 86: Advanced Class

© 2000 PTC 86

REPEAT CommandREPEAT Command

5 Axis Milling machine with a special compensation :

G1 X Y Z A B U V W

CIMFIL/ON,GOTO$$ Calculate U,V,W using tool vector and 1000 XX=POSTF(20) $$ Save CL rec$$ Extract tool vectorIVAL=POSTF(7,9);JVAL=POSTF(7,10);KVAL=POSTF(7,11)TOT=IVAL+JVAL+KVAL$$ Only when in 5 axis mode not vertical !IF ((KVAL.NE.1).AND.(TOT.NE.0)) THEN REPEAT/OFF UVAL=1000*IVAL;REPEAT/X,Y,Z,U,UVAL,ALL VVAL=1000*JVAL;REPEAT/X,Y,Z,V,VVAL,ALL WVAL=1000*KVAL;REPEAT/X,Y,Z,W,WVAL,ALLENDIFXX=POSTF(21);XX=POSTF(13)CIMFIL/OFF

5 Axis Milling machine with a special compensation :

G1 X Y Z A B U V W

CIMFIL/ON,GOTO$$ Calculate U,V,W using tool vector and 1000 XX=POSTF(20) $$ Save CL rec$$ Extract tool vectorIVAL=POSTF(7,9);JVAL=POSTF(7,10);KVAL=POSTF(7,11)TOT=IVAL+JVAL+KVAL$$ Only when in 5 axis mode not vertical !IF ((KVAL.NE.1).AND.(TOT.NE.0)) THEN REPEAT/OFF UVAL=1000*IVAL;REPEAT/X,Y,Z,U,UVAL,ALL VVAL=1000*JVAL;REPEAT/X,Y,Z,V,VVAL,ALL WVAL=1000*KVAL;REPEAT/X,Y,Z,W,WVAL,ALLENDIFXX=POSTF(21);XX=POSTF(13)CIMFIL/OFF

Page 87: Advanced Class

© 2000 PTC 87

The POSTN CommandThe POSTN Command

The POSTN command allows to insert registers and values to the NC tape block

POSTN / (IN or OUT), register_address, value, [NEXT]

IN : Combine with existing blockOUT : Create new blockregister_address : letter addresses, must be 1 through 26 to indicate the alpha characters Athrough Z.value : value for the registerNEXT : output the register with next block

POSTN / ALL will reset all the registers

The POSTN command allows to insert registers and values to the NC tape block

POSTN / (IN or OUT), register_address, value, [NEXT]

IN : Combine with existing blockOUT : Create new blockregister_address : letter addresses, must be 1 through 26 to indicate the alpha characters Athrough Z.value : value for the registerNEXT : output the register with next block

POSTN / ALL will reset all the registers

Page 88: Advanced Class

© 2000 PTC 88

The POSTN CommandThe POSTN Command

To Output G90 G70 G40

POSTN / OUT, G , 90POSTN / OUT, G, 40POSTN / OUT, G, 70

To Output G90 G70 G40

POSTN / OUT, G , 90POSTN / OUT, G, 40POSTN / OUT, G, 70

Page 89: Advanced Class

© 2000 PTC 89

Disable Tape outputDisable Tape output

INTCOM 1867 = PLABEL (37) is used to control tape output :

Simulation ON means CL record are processed but no output to the tape : XX=POSTF(2,1,1867,1)

Simulation OFF (default) means CL records are processed and tape is generated :XX=POSTF(2,1,1867,0)

INTCOM 1867 = PLABEL (37) is used to control tape output :

Simulation ON means CL record are processed but no output to the tape : XX=POSTF(2,1,1867,1)

Simulation OFF (default) means CL records are processed and tape is generated :XX=POSTF(2,1,1867,0)

Page 90: Advanced Class

© 2000 PTC 90

Disable Tape OutputDisable Tape Output

EXAMPLE : Output Tool name on same line than tool change

CIMFIL/ON,PPRINT$$ Macro to store the tool name in a variable$$ to re-issue with the tool changeTXT=TEXT/CLW $$ Text of messageTEST=TEXT/'TOOL NAME' $$ Text to test forOKCOM=INDXF(TXT,TEST)IF (OKCOM.NE.0) THEN $$ This is a tool comment MESS=TEXT/OMIT,TXT,1 $$ Omit trailing blank COL=TEXT/':' COLPOS=INDXF(MESS,COL) $$ position of : in MESS LEN=CANF(MESS,1) $$ number of char in MESS NMESS=TEXT/RANGE,MESS,COLPOS+1,LEN $$ Extract from : to endELSE DMY=POSTF(13) $$ ProcessENDIFCIMFIL/OFF

EXAMPLE : Output Tool name on same line than tool change

CIMFIL/ON,PPRINT$$ Macro to store the tool name in a variable$$ to re-issue with the tool changeTXT=TEXT/CLW $$ Text of messageTEST=TEXT/'TOOL NAME' $$ Text to test forOKCOM=INDXF(TXT,TEST)IF (OKCOM.NE.0) THEN $$ This is a tool comment MESS=TEXT/OMIT,TXT,1 $$ Omit trailing blank COL=TEXT/':' COLPOS=INDXF(MESS,COL) $$ position of : in MESS LEN=CANF(MESS,1) $$ number of char in MESS NMESS=TEXT/RANGE,MESS,COLPOS+1,LEN $$ Extract from : to endELSE DMY=POSTF(13) $$ ProcessENDIFCIMFIL/OFF

Page 91: Advanced Class

© 2000 PTC 91

Disable Tape OutputDisable Tape Output

CIMFIL/ON,LOADTLIF (OKCOM.EQ.0) THEN DMY=POSTF(13) $$ ProcessELSE $$ Tool name programmed XX=POSTF(2,1,1867,1) $$ no tape output DMY=POSTF(13) $$ process tool change TNUM=POSTF(7,4) $$ Tool number XX=POSTF(2,1,1867,0) $$ re-activate tape output\ INSERT/'T',TNUM,'M6(',NMESS,')$'ENDIF

CIMFIL/OFF

CIMFIL/ON,LOADTLIF (OKCOM.EQ.0) THEN DMY=POSTF(13) $$ ProcessELSE $$ Tool name programmed XX=POSTF(2,1,1867,1) $$ no tape output DMY=POSTF(13) $$ process tool change TNUM=POSTF(7,4) $$ Tool number XX=POSTF(2,1,1867,0) $$ re-activate tape output\ INSERT/'T',TNUM,'M6(',NMESS,')$'ENDIF

CIMFIL/OFF

Page 92: Advanced Class

© 2000 PTC 92

Re-Direct Tape OutputRe-Direct Tape Output

POSTF(25,…) can be used to re-direct the output of the tape and listing file to an auxiliary file

POSTF(25, arg) arg = 0 : default, normal post output

arg = 1 : re-direct output to auxiliary file

arg = 2 : rewind the auxiliary file

TEXT / READ, PUNCH and TEXT / READ, PRINT can be used to read the content of the auxiliary files.

POSTF(25,…) can be used to re-direct the output of the tape and listing file to an auxiliary file

POSTF(25, arg) arg = 0 : default, normal post output

arg = 1 : re-direct output to auxiliary file

arg = 2 : rewind the auxiliary file

TEXT / READ, PUNCH and TEXT / READ, PRINT can be used to read the content of the auxiliary files.

MCOPY=MACRO/ $$ RELOAD CONTENT OF AUXILIARY FILE TEOF=TEXT/'ERROR$EOF’ $$ EOF text L10)CONTIN TXTAUX=TEXT/READ,PUNCH I1=CMPRF(TXTAUX,TEOF) IF(I1 .EQ. 1)JUMPTO/L90 INSERT/TXTAUX,'$' JUMPTO/L10 L90)CONTINTERMAC

Exercise : AGIE wire EDM element switching

Page 93: Advanced Class

© 2000 PTC 93

Macro on Motion Macro on Motion

Macro on motion are started with :

CIMFIL / ON, class, subclass

or directly

CIMFIL / ON, GOTO (Class 5000 , subclass 5)

CIMFIL / ON, FROM (Class 5000, subclass 3)

CIMFIL / ON, CIRCLE (Class 3000)

Activation / Deactivation of macro on motion can be controlled

with POSTF(26, … )

XX=POSTF(26,5,5,1) : Activate macro on motion (default)

XX=POSTF(26,5,5,0) : De-activate macro on motion

Note : POSTF(26, …) can be used to control activation/deactivation of any CIMFIL

Macro on motion are started with :

CIMFIL / ON, class, subclass

or directly

CIMFIL / ON, GOTO (Class 5000 , subclass 5)

CIMFIL / ON, FROM (Class 5000, subclass 3)

CIMFIL / ON, CIRCLE (Class 3000)

Activation / Deactivation of macro on motion can be controlled

with POSTF(26, … )

XX=POSTF(26,5,5,1) : Activate macro on motion (default)

XX=POSTF(26,5,5,0) : De-activate macro on motion

Note : POSTF(26, …) can be used to control activation/deactivation of any CIMFIL

Page 94: Advanced Class

© 2000 PTC 94

Macro on MotionMacro on Motion

Motion Coordinates in Macro on GOTO

CIMFIL / ON, GOTOXVAL = POSTF(7,6)YVAL = POSTF(7,7)ZVAL = POSTF(7,8)IVAL = POSTF(7,9)JVAL = POSTF(7,10)KVAL = POSTF(7,11)$$ Current position in CL coord.CURX = POSTF(1,3,350)CURY = POSTF(1,3,351)CURZ = POSTF(1,3,352)...

Motion Coordinates in Macro on GOTO

CIMFIL / ON, GOTOXVAL = POSTF(7,6)YVAL = POSTF(7,7)ZVAL = POSTF(7,8)IVAL = POSTF(7,9)JVAL = POSTF(7,10)KVAL = POSTF(7,11)$$ Current position in CL coord.CURX = POSTF(1,3,350)CURY = POSTF(1,3,351)CURZ = POSTF(1,3,352)...

Page 95: Advanced Class

© 2000 PTC 95

Macro on MotionMacro on Motion

Support for Super GI on Makino : G05P10000 : activate Super GI mode after first motion

G05P0 : de-activate Super GI mode before tool change

Support for Super GI on Makino : G05P10000 : activate Super GI mode after first motion

G05P0 : de-activate Super GI mode before tool change

SGI=0 $$ Super GI mode ON:1 OFF:0

CIMFIL/ON,MACHINXX=POSTF(13) $$ ProcessXX=POSTF(26,5,5,0) $$ disable macro on GOTOCIMFIL/OFF

CIMFIL/ON,LOADTLXX=POSTF(20) $$ Save CL rec.IF (SGI.NE.0) THEN SGI=0 INSERT/’G05P0$’ENDIFXX=POSTF(21) $$ restore CL rec.XX=POSTF(13) $$ ProcessXX=POSTF(26,5,5,1) $$ Activate motion macroCIMFIL/OFF

CIMFIL/ON,GOTOXX=POSTF(13) $$ ProcessSGI=1INSERT/’G05P10000$’$$ disable macro on GOTOXX=POSTF(26,5,5,0) CIMFIL/OFF

Page 96: Advanced Class

© 2000 PTC 96

Macro on MotionMacro on Motion

EXAMPLE : 3D Compensation Pro/NC can

outputs information for3D compensationfor 3 axis surfacemilling

An additional vector definesthe surfacenormal

Pro/NC-GPOSTcan processthe informationand a FIL macrois used to generate the output needed by the machine

EXAMPLE : 3D Compensation Pro/NC can

outputs information for3D compensationfor 3 axis surfacemilling

An additional vector definesthe surfacenormal

Pro/NC-GPOSTcan processthe informationand a FIL macrois used to generate the output needed by the machine

MODE / 3DCOMP, ONSPINDL / RPM, 1200.000000, CLWRAPID GOTO / -2.6049664968, -1.6546238805, 2.0000000000RAPID GOTO / -2.6049664968, -1.6546238805, 0.8683175847FEDRAT / 12.000000, IPMGOTO / -2.6049664968, -1.6546238805, 0.6683175847CUTCOM / ONGOTO / -2.3573283320, -1.6583390255, 0.5974283950, $0.0000000000, 0.0000000000, 1.0000000000, $0.0000000000, -0.9986295348, 0.0523359562GOTO / -2.1057717020, -1.6616855756, 0.5335724151, $0.0000000000, 0.0000000000, 1.0000000000, $0.0000000000, -0.9986295348, 0.0523359562….GOTO / -2.6000000000, 0.4860895490, 1.0000000000, $0.0000000000, 0.0000000000, 1.0000000000, $0.0000000000, 0.0000000000, 1.0000000000CUTCOM / OFFGOTO / -2.6000000000, 0.4860895490, 2.0000000000, $0.0000000000, 0.0000000000, 1.0000000000, $0.0000000000, 0.0000000000, 1.0000000000MODE / 3DCOMP, OFF

Page 97: Advanced Class

© 2000 PTC 97

Macro on MotionMacro on Motion

EXAMPLE : 3D Compensation Pro/NC-GPOST converts the ncl format

GOTO/x,y,z,i,j,k,l,m,n becomes CUTCOM/XYZ,I,j,k,l,m,n GOTO/x,y,z

A FIL macro is used to generate the output :

EXAMPLE : 3D Compensation Pro/NC-GPOST converts the ncl format

GOTO/x,y,z,i,j,k,l,m,n becomes CUTCOM/XYZ,I,j,k,l,m,n GOTO/x,y,z

A FIL macro is used to generate the output :REDEF/ON

$$ AddressesA=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=14O=15;P=16;Q=17;R=18;S=19;T=20;U=21;V=22;W=23;X=24;Y=25;Z=26

OKCOMP=0 $$ To detect comp valueLVECT=0 $$ NX value of 3D comp.MVECT=0 $$ NY value of 3D comp.NVECT=0 $$ NZ value of 3D comp.

CIMFIL/ON,CUTCOMARG1=POSTF(7,4)IF (ARG1.EQ.ICODEF(XYZ)) THEN$$ This is 3D compensation move LVECT=POSTF(7,8) $$ extract L MVECT=POSTF(7,9) $$ Extract M NVECT=POSTF(7,10) $$ Extract N XX=POSTF(26,5,5,1) $$ Activate macro on Motion ELSE XX=POSTF(26,5,5,0) $$ De-activate macro on MotionENDIFCIMFIL/OFF

CIMFIL/ON,GOTODMY=POSTF(20) $$ save record$$ Check if 3D Comp. IF (OKCOMP.EQ.1) THEN $$ output the register with the next block $$ (the motion processed by GPOST) POSTN/OUT,U,LVECT,V,MVECT,W,NVECT,NEXT ENDIFDMY=POSTF(21) $$ restore recordDMY=POSTF(13) $$ processCIMFIL/OFF

CIMFIL/ON,MACHINXX=POSTF(13) $$ ProcessXX=POSTF(26,5,5,0) $$ De-activate GOTO macroCIMFIL/OFF

Page 98: Advanced Class

© 2000 PTC 98

APT-Like MACRO in FILAPT-Like MACRO in FIL

You can assign a name to a group of statements and subsequently cause them to be executed each time you call the name.

The syntax is based on the APT macro call technique :

macnam = MACRO / var1, var2, …. Varn…Statements…TERMAC

CALL / macnam, var1=value1, … varn=valuen

You can assign a name to a group of statements and subsequently cause them to be executed each time you call the name.

The syntax is based on the APT macro call technique :

macnam = MACRO / var1, var2, …. Varn…Statements…TERMAC

CALL / macnam, var1=value1, … varn=valuen

DDATE = MACRO $$ Macro to insert the date and time _TT = TEXT / DATE PPRINT / _TTTERMAC...CALL / DDATE

Page 99: Advanced Class

© 2000 PTC 99

APT-Like MACRO in FILAPT-Like MACRO in FIL

Examples : Macro to set the number of argument of a CL record :

SETARG = MACRO / NBARG$$ Macro to set the number of arguments$$ NBARG : number of argument after the /XXX=POSTF(12, NBARG+3)TERMAC

CIMFIL / ON, COOLNT$$ Remove COOLNT options (Low, High, ..)CALL / SETARG, NBARG=1XX=POSTF(13)CIMFIL / OFF

Examples : Macro to set the number of argument of a CL record :

SETARG = MACRO / NBARG$$ Macro to set the number of arguments$$ NBARG : number of argument after the /XXX=POSTF(12, NBARG+3)TERMAC

CIMFIL / ON, COOLNT$$ Remove COOLNT options (Low, High, ..)CALL / SETARG, NBARG=1XX=POSTF(13)CIMFIL / OFF

Page 100: Advanced Class

© 2000 PTC 100

Look-ahead TechniqueLook-ahead Technique

Key functions for look-ahead are : ICODEF(MAJOR_WORD) : return the integer value of a

minor word

POSTF(7,1) : CL record position (line number)

POSTF(7,2) : CL record class

POSTF(7,3) : CL record sub-class

POSTF(7,(3+I)) : CL record ith argument21:LOADTL/1,OSETNO,10POSTF(7,1) = 21POSTF(7,2) = 2000 POSTF(7,3)=1055POSTF(7,4) = 1

POSTF(14) : get next CL record

POSTF(15,clpos) : go the CL position clpos

Key functions for look-ahead are : ICODEF(MAJOR_WORD) : return the integer value of a

minor word

POSTF(7,1) : CL record position (line number)

POSTF(7,2) : CL record class

POSTF(7,3) : CL record sub-class

POSTF(7,(3+I)) : CL record ith argument21:LOADTL/1,OSETNO,10POSTF(7,1) = 21POSTF(7,2) = 2000 POSTF(7,3)=1055POSTF(7,4) = 1

POSTF(14) : get next CL record

POSTF(15,clpos) : go the CL position clpos

Page 101: Advanced Class

© 2000 PTC 101

Look Ahead TechniqueLook Ahead Technique

Generic Macro to find the next CL record …

CLFIND = MACRO / CLTYPE, ARGNUM CLPOS=POSTF(7,1)+1 $$ Current CL position

OKFIND=0

DO/ENDO1,ILOOP=1,10

DMY=POSTF(14) $$ Get next CL (TAPERD)

CLC=POSTF(7,2) $$ Class of CL record

SCL=POSTF(7,3) $$ sub-class of CL record

ILOOP=1 $$ Stay in loop

IF(CLC.EQ.14000)THEN

$$ This is FINI

OKFIND=0 $$ CL not found

ILOOP=11 $$ Exit the loop

ENDIF

IF(CLC.EQ.2000.AND.SCL.EQ.CLTYPE) THEN

$$ This is a CLTYPE cl record

ARGVAL=POSTF(7,(3+ARGNUM)) $$ ARGNUMth parameter

OKFIND=1

ILOOP=11

ENDIF

ENDO1) CONTIN $$ End of DO loop

$$ return initial position in CL

RSLT=POSTF(15,CLPOS)

TERMAC

Generic Macro to find the next CL record …

CLFIND = MACRO / CLTYPE, ARGNUM CLPOS=POSTF(7,1)+1 $$ Current CL position

OKFIND=0

DO/ENDO1,ILOOP=1,10

DMY=POSTF(14) $$ Get next CL (TAPERD)

CLC=POSTF(7,2) $$ Class of CL record

SCL=POSTF(7,3) $$ sub-class of CL record

ILOOP=1 $$ Stay in loop

IF(CLC.EQ.14000)THEN

$$ This is FINI

OKFIND=0 $$ CL not found

ILOOP=11 $$ Exit the loop

ENDIF

IF(CLC.EQ.2000.AND.SCL.EQ.CLTYPE) THEN

$$ This is a CLTYPE cl record

ARGVAL=POSTF(7,(3+ARGNUM)) $$ ARGNUMth parameter

OKFIND=1

ILOOP=11

ENDIF

ENDO1) CONTIN $$ End of DO loop

$$ return initial position in CL

RSLT=POSTF(15,CLPOS)

TERMAC

For example to find the next tool number :

CC=ICODEF(LOADTL)CALL/CLFIND,CLTYPE=CC,ARGNUM=1IF (OKFIND.EQ.1) THEN NT=ARGVALENDIF

Page 102: Advanced Class

© 2000 PTC 102

Look Ahead TechniqueLook Ahead Technique

Macro to output machining time at the beginning of the tape

CIMFIL/ON,MACHIN$$ Macro to output machining time$$ At the beginning of tape$$ Process $$ Process MACHINECLPOS=POSTF(7,1)$$ Current CL position$$ disable tape outputDMY=POSTF(2,1,1867,1) $$ Set INTCOM 1867 to 1$$ Loop in the CL...

Macro to output machining time at the beginning of the tape

CIMFIL/ON,MACHIN$$ Macro to output machining time$$ At the beginning of tape$$ Process $$ Process MACHINECLPOS=POSTF(7,1)$$ Current CL position$$ disable tape outputDMY=POSTF(2,1,1867,1) $$ Set INTCOM 1867 to 1$$ Loop in the CL...

Page 103: Advanced Class

© 2000 PTC 103

Look Ahead TechniqueLook Ahead Technique

...DO / ENDDO, ILOOP=0, 10 $$ Read next CL record DMY=POSTF(14) $$ Test if not FINI CLASS=POSTF(7,2) IF (CLASS.EQ.14000) THEN $$ This is FINI set ILOOP to 10 ILOOP=10 ELSE $$ Process DMY=POSTF(13) $$ Set ILOOP to 2 ILOOP=2 ENDIFENDDO)...

...DO / ENDDO, ILOOP=0, 10 $$ Read next CL record DMY=POSTF(14) $$ Test if not FINI CLASS=POSTF(7,2) IF (CLASS.EQ.14000) THEN $$ This is FINI set ILOOP to 10 ILOOP=10 ELSE $$ Process DMY=POSTF(13) $$ Set ILOOP to 2 ILOOP=2 ENDIFENDDO)...

...$$ Go back at beginning CLDMY=POSTF(15,(CLPOS+1))$$ Re-enable tape output$$ Set INTCOM 1867 to 0DMY=POSTF(2,1,1867,0) $$ Insert the mfg time DBLCOM 495TIM=POSTF(1,3,495)INSERT/'(MACHINING TIME : ',TIM,')$'CIMFIL/OFF

Page 104: Advanced Class

© 2000 PTC 104

Enable/Disable RegistersEnable/Disable Registers

To disable a register you need to set the tape order of the register to 53

Tape order of register : INTCOM 1 to 26

XX=POSTF(2,1,intcom_val,53) to set the INTCOM to 53

To enable a register you need to reset its tape order to the initial value

Store the tape order of the register before disabling it : INTVAL = POSTF(1,1,intcom_val)

Restore the tape order : XX=POSTF(2,1,intcom_val, intval)

To disable a register you need to set the tape order of the register to 53

Tape order of register : INTCOM 1 to 26

XX=POSTF(2,1,intcom_val,53) to set the INTCOM to 53

To enable a register you need to reset its tape order to the initial value

Store the tape order of the register before disabling it : INTVAL = POSTF(1,1,intcom_val)

Restore the tape order : XX=POSTF(2,1,intcom_val, intval)

Page 105: Advanced Class

© 2000 PTC 105

Enable/Disable RegistersEnable/Disable Registers

Example : disable X & Y on the first cycle motion (GPOST repeats them automatically)XREG=POSTF(1,1,24)YREG=POSTF(1,1,25)

CIMFIL/ON,CYCLEXX=POSTF(13)CYCTYP=POSTF(7,4)IF (CYCTYP.NE.ICODEF(OFF)) THEN $$ Activate macro on GOTO XX=POSTF(26,5,5,1)ENDIFCIMFIL/OFF

CIMFIL/ON,MACHINXX=POSTF(13)$$ De-activate macro on GOTOXX=POSTF(26,5,5,0)CIMFIL/OFF

Example : disable X & Y on the first cycle motion (GPOST repeats them automatically)XREG=POSTF(1,1,24)YREG=POSTF(1,1,25)

CIMFIL/ON,CYCLEXX=POSTF(13)CYCTYP=POSTF(7,4)IF (CYCTYP.NE.ICODEF(OFF)) THEN $$ Activate macro on GOTO XX=POSTF(26,5,5,1)ENDIFCIMFIL/OFF

CIMFIL/ON,MACHINXX=POSTF(13)$$ De-activate macro on GOTOXX=POSTF(26,5,5,0)CIMFIL/OFF

CIMFIL/ON,GOTO$$ first motion after CYCLE$$ disable X and YRSLT=POSTF(2,1,24,53)RSLT=POSTF(2,1,25,53)$$ Process the motionDMY=POSTF(13)$$ re-enable X and Y DMY=POSTF(2,1,24,XREG)DMY=POSTF(2,1,25,YREG) $$ De-activate macro on GOTOXX=POSTF(26,5,5,0)CIMFIL/OFF

Page 106: Advanced Class

© 2000 PTC 106

Enable / Disable RegistersEnable / Disable Registers

Macros to replace a register by another

MAD1=MACRO/ADR,STR

$$ MAD1 IS A MACRO TO CHANGE LETTER ADDRESS TO STRING

$$ ADR IS ADDRESS TO BE SET A=1,B=2 ETC

$$ STR IS IS THE ALIAS STRING FOR EXAMPLE TB=TEXT/'R101='

L1=POSTF(1,1,ADR) $$ GET JORDER(ADR)

L2=(9-1)*26+L1+2216-1 $$ COMPUTE JPARAD(X,9)

DMY=POSTF(2,1,L2,1) $$ SET JPARAD(X,9)

DO/L10,N1=1,8 $$ ALLOW UPTO 8CHARS

L2=(N1-1)*26+L1+2216-1 $$ COMPUTE JPARAD(X,N)

DMY=POSTF(3,1,L2) $$ SET JPARAD(X,N)=IEMPTY

IF(N1 .GT. CANF(STR,1))JUMPTO/L10 $$ SKIP IF OVER STRING LENGTH

A1=ICHARF((TEXT/RANGE,STR,N1,N1)) $$ GET CHARACTER NUMBER

DMY=POSTF(2,1,L2,A1) $$ INSERT STRING(N)

L10)CONTIN

TERMAC

Macros to replace a register by another

MAD1=MACRO/ADR,STR

$$ MAD1 IS A MACRO TO CHANGE LETTER ADDRESS TO STRING

$$ ADR IS ADDRESS TO BE SET A=1,B=2 ETC

$$ STR IS IS THE ALIAS STRING FOR EXAMPLE TB=TEXT/'R101='

L1=POSTF(1,1,ADR) $$ GET JORDER(ADR)

L2=(9-1)*26+L1+2216-1 $$ COMPUTE JPARAD(X,9)

DMY=POSTF(2,1,L2,1) $$ SET JPARAD(X,9)

DO/L10,N1=1,8 $$ ALLOW UPTO 8CHARS

L2=(N1-1)*26+L1+2216-1 $$ COMPUTE JPARAD(X,N)

DMY=POSTF(3,1,L2) $$ SET JPARAD(X,N)=IEMPTY

IF(N1 .GT. CANF(STR,1))JUMPTO/L10 $$ SKIP IF OVER STRING LENGTH

A1=ICHARF((TEXT/RANGE,STR,N1,N1)) $$ GET CHARACTER NUMBER

DMY=POSTF(2,1,L2,A1) $$ INSERT STRING(N)

L10)CONTIN

TERMAC

Page 107: Advanced Class

© 2000 PTC 107

Enable / Disable RegistersEnable / Disable Registers

MAD2=MACRO/ADR$$ MAD2 IS A MACRO TO RESET THE LETTER ADDRESS BACK FROM A$$ STRING. ADR IS ADDRESS TO BE SET A=1,B=2 ETC L1=POSTF(1,1,ADR) $$ GET JORDER(ADR) L2=(9-1)*26+L1+2216-1 $$ COMPUTE JPARAD(X,9) DMY=POSTF(3,1,L2) $$ SET JPARAD(X,9)=IEMPTYTERMAC

…$$ Replace Z by R101=Z=26T1=TEXT/’R101=‘CALL / MAD1, ADR=Z,STR=T1

$$ Reset Z to ZCALL / MAD2, ADR=Z

MAD2=MACRO/ADR$$ MAD2 IS A MACRO TO RESET THE LETTER ADDRESS BACK FROM A$$ STRING. ADR IS ADDRESS TO BE SET A=1,B=2 ETC L1=POSTF(1,1,ADR) $$ GET JORDER(ADR) L2=(9-1)*26+L1+2216-1 $$ COMPUTE JPARAD(X,9) DMY=POSTF(3,1,L2) $$ SET JPARAD(X,9)=IEMPTYTERMAC

…$$ Replace Z by R101=Z=26T1=TEXT/’R101=‘CALL / MAD1, ADR=Z,STR=T1

$$ Reset Z to ZCALL / MAD2, ADR=Z

Page 108: Advanced Class

© 2000 PTC 108

File I/OFile I/O

FIL provides the means to open, read and write from external files (maximum 2 at a given time) :

rslt = FILEF(fn,op,t1)

rslt : Result of operation (0:OK 1:Failed) fn: File number to be used (0, 1, 2, 3, or 4).

If fn is 0, output is sent to the terminal. op: Operation to be executed

= 1 Write one record from text string t1 to file fn.= 2 Open an existing file; file name is t1; fn must be 1 or 2.= 3 Open a new file; file name in t1; fn must be 1 or 2.= 4 Rewind file; t1 not required; fn must be 1 or 2.= 5 Close file; t1 not required; fn must be 1 or 2.= 6 Close and delete file; t1 not required; fn must be 1 or 2.= 7 Inquire if file exist; rslt will be set to 1 if file exist,

otherwise rslt will be set to 0; fn must be 1 or 2.

FIL provides the means to open, read and write from external files (maximum 2 at a given time) :

rslt = FILEF(fn,op,t1)

rslt : Result of operation (0:OK 1:Failed) fn: File number to be used (0, 1, 2, 3, or 4).

If fn is 0, output is sent to the terminal. op: Operation to be executed

= 1 Write one record from text string t1 to file fn.= 2 Open an existing file; file name is t1; fn must be 1 or 2.= 3 Open a new file; file name in t1; fn must be 1 or 2.= 4 Rewind file; t1 not required; fn must be 1 or 2.= 5 Close file; t1 not required; fn must be 1 or 2.= 6 Close and delete file; t1 not required; fn must be 1 or 2.= 7 Inquire if file exist; rslt will be set to 1 if file exist,

otherwise rslt will be set to 0; fn must be 1 or 2.

Page 109: Advanced Class

© 2000 PTC 109

File I/OFile I/O

FILEF(1,4,string) : Write directly to tape file For example write a blank line to the tape file :

SP1=TEXT/’ ‘XX=FILEF(1,4,SP1)

FILEF(1,4,string) : Write directly to tape file For example write a blank line to the tape file :

SP1=TEXT/’ ‘XX=FILEF(1,4,SP1)

Page 110: Advanced Class

© 2000 PTC 110

File I/OFile I/O

Read from External file

string = TEXT / READ, fn

Example : prompt during PP executionCIMFIL/ON,MACHIN$$ Macro on MACHINDMY = POSTF(13) $$ ProcessSEQNO/OFF $$ Stop sequence numberingMSG = TEXT/’Program Number : [1111]'RSLT = FILEF(0,1,MSG) $$ Prompt userANSW = TEXT/READ,0 $$ Read answer$$ Check if answer is just CR (Return)TVAL = TEXT/ANSW,'-' $$ Append - to the answerTCOMP = TEXT/'-' DIFF = CMPRF(TVAL,TCOMP) $$ Test is answer = -IF(DIFF .EQ. 1)THEN INSERT/’O1111$’ $$ Default valueELSE INSERT/’O’,ANSW,’$’ENDIFCIMFIL/OFF

Read from External file

string = TEXT / READ, fn

Example : prompt during PP executionCIMFIL/ON,MACHIN$$ Macro on MACHINDMY = POSTF(13) $$ ProcessSEQNO/OFF $$ Stop sequence numberingMSG = TEXT/’Program Number : [1111]'RSLT = FILEF(0,1,MSG) $$ Prompt userANSW = TEXT/READ,0 $$ Read answer$$ Check if answer is just CR (Return)TVAL = TEXT/ANSW,'-' $$ Append - to the answerTCOMP = TEXT/'-' DIFF = CMPRF(TVAL,TCOMP) $$ Test is answer = -IF(DIFF .EQ. 1)THEN INSERT/’O1111$’ $$ Default valueELSE INSERT/’O’,ANSW,’$’ENDIFCIMFIL/OFF

Page 111: Advanced Class

© 2000 PTC 111

File I/OFile I/O

Macro to read the tool file : *.tl1

This file is created automatically by GPOST before the processing of the CL file :

The first line is the number of tool changes in your CL file. In this case 3 tool changes. Each line there after is as follows:

First value is the cl record number of the tool change Second value is the type of tool change, 1=LOADTL 2=TURRET Third value is the tool number Fourth value is the offset number Fifth value is the Z length from the LOADTL, 0= if TURRET Sixth value is the X gage from the TURRET, 0= if LOADTL Seventh value is the Y gage from the TURRET, 0= if LOADTL Eighth value is the CLW-CCLW from the TURRET, 1=CLW -1=CCLW, 0= if LOADTL Nineth value is the TURRET that is being indexed 1=front, 2=read, 3=saddle, 4=main, rail=5

and 0= if LOADTL

Macro to read the tool file : *.tl1

This file is created automatically by GPOST before the processing of the CL file :

The first line is the number of tool changes in your CL file. In this case 3 tool changes. Each line there after is as follows:

First value is the cl record number of the tool change Second value is the type of tool change, 1=LOADTL 2=TURRET Third value is the tool number Fourth value is the offset number Fifth value is the Z length from the LOADTL, 0= if TURRET Sixth value is the X gage from the TURRET, 0= if LOADTL Seventh value is the Y gage from the TURRET, 0= if LOADTL Eighth value is the CLW-CCLW from the TURRET, 1=CLW -1=CCLW, 0= if LOADTL Nineth value is the TURRET that is being indexed 1=front, 2=read, 3=saddle, 4=main, rail=5

and 0= if LOADTL

Page 112: Advanced Class

© 2000 PTC 112

File I/OFile I/O

Reserv/#TLLST,100 $$ Tool List Data Statements, Default 100

_RdTL1 = Macro/

$$ this macro will read the .tl1 file and make a

$$ a set of data statements named #TLLST and

$$ sets a "number of tool changes" variable, #MXTLS

#MXTLS = 0 $$ DEFAULT NUMBER OF TOOLS

#FNAME = TEXT/PART $$ GET THE INPUT FILE NAME

EXT=TEXT/'.NCL'

IPOS=INDXF(#FNAME,EXT) $$ POSITION OF .NCL

#FNAME = TEXT/RANGE,#FNAME,1,IPOS+3 $$ REMOVE THE EXTENSION

#FNAME = TEXT/#FNAME,'.TL1' $$ ADD .TL1 EXTENSION

#FEXST = FILEF(1,7,#FNAME) $$ CHECK IF FILE EXIST

IF(#FEXST .EQ. 1)THEN $$ FOUND THE FILE

#FOPEN = FILEF(1,2,#FNAME) $$ OPEN THE EXISTING FILE

#TMPST = TEXT/READ,1 $$ READ THE 1ST LINE OF THE FILE

#MXTLS = SCALF(#TMPST) $$ CONVERT TEXT TO SCALAR

IF(#MXTLS .GT. 0)THEN $$ THERE IS SOME TOOL CHANGES

LOOPST $$ LOOP BOUNDARY

...

Reserv/#TLLST,100 $$ Tool List Data Statements, Default 100

_RdTL1 = Macro/

$$ this macro will read the .tl1 file and make a

$$ a set of data statements named #TLLST and

$$ sets a "number of tool changes" variable, #MXTLS

#MXTLS = 0 $$ DEFAULT NUMBER OF TOOLS

#FNAME = TEXT/PART $$ GET THE INPUT FILE NAME

EXT=TEXT/'.NCL'

IPOS=INDXF(#FNAME,EXT) $$ POSITION OF .NCL

#FNAME = TEXT/RANGE,#FNAME,1,IPOS+3 $$ REMOVE THE EXTENSION

#FNAME = TEXT/#FNAME,'.TL1' $$ ADD .TL1 EXTENSION

#FEXST = FILEF(1,7,#FNAME) $$ CHECK IF FILE EXIST

IF(#FEXST .EQ. 1)THEN $$ FOUND THE FILE

#FOPEN = FILEF(1,2,#FNAME) $$ OPEN THE EXISTING FILE

#TMPST = TEXT/READ,1 $$ READ THE 1ST LINE OF THE FILE

#MXTLS = SCALF(#TMPST) $$ CONVERT TEXT TO SCALAR

IF(#MXTLS .GT. 0)THEN $$ THERE IS SOME TOOL CHANGES

LOOPST $$ LOOP BOUNDARY

...

Page 113: Advanced Class

© 2000 PTC 113

File I/OFile I/O

...

DO/#REDO,#NN=1,#MXTLS,1 $$ SET UP THE LOOP

#TMPST = TEXT/READ,1 $$ READ THE NEXT LINE

#TVAL1 = TEXT/RANGE,#TMPST,1,12 $$ 12 CHARS CL NUMBER

#TNUM1 = SCALF(#TVAL1) $$ CONVERT TO SCALAR

#TVAL2 = TEXT/RANGE,#TMPST,13,16 $$ 4 TYPE 1=LOADTL 2=TURRET

#TNUM2 = SCALF(#TVAL2) $$ CONVERT TO SCALAR

#TVAL3 = TEXT/RANGE,#TMPST,17,30 $$ 14 CHARS TOOL NUMBER

#TNUM3 = SCALF(#TVAL3) $$ CONVERT TO SCALAR

#TVAL4 = TEXT/RANGE,#TMPST,31,44 $$ 14 CHARS OFFSET NUMBER

#TNUM4 = SCALF(#TVAL4) $$ CONVERT TO SCALAR

#TVAL5 = TEXT/RANGE,#TMPST,45,58 $$ 14 CHARS Z LENGHT

#TNUM5 = SCALF(#TVAL5) $$ CONVERT TO SCALAR

#TVAL6 = TEXT/RANGE,#TMPST,59,72 $$ 14 CHARS X GAGE

#TNUM6 = SCALF(#TVAL6) $$ CONVERT TO SCALAR

#TVAL7 = TEXT/RANGE,#TMPST,73,86 $$ 14 CHARS Y GAGE LENGTH

#TNUM7 = SCALF(#TVAL7) $$ CONVERT TO SCALAR

#TVAL8 = TEXT/RANGE,#TMPST,87,89 $$ 3 CHARS #TNUM8 =

SCALF(#TVAL8) $$ CONVERT TO SCALAR

#TVAL9 = TEXT/RANGE,#TMPST,90,92 $$ 3 CHARS TURRET SELECTED

#TNUM9 = SCALF(#TVAL9) $$ CONVERT TO SCALAR...

...

DO/#REDO,#NN=1,#MXTLS,1 $$ SET UP THE LOOP

#TMPST = TEXT/READ,1 $$ READ THE NEXT LINE

#TVAL1 = TEXT/RANGE,#TMPST,1,12 $$ 12 CHARS CL NUMBER

#TNUM1 = SCALF(#TVAL1) $$ CONVERT TO SCALAR

#TVAL2 = TEXT/RANGE,#TMPST,13,16 $$ 4 TYPE 1=LOADTL 2=TURRET

#TNUM2 = SCALF(#TVAL2) $$ CONVERT TO SCALAR

#TVAL3 = TEXT/RANGE,#TMPST,17,30 $$ 14 CHARS TOOL NUMBER

#TNUM3 = SCALF(#TVAL3) $$ CONVERT TO SCALAR

#TVAL4 = TEXT/RANGE,#TMPST,31,44 $$ 14 CHARS OFFSET NUMBER

#TNUM4 = SCALF(#TVAL4) $$ CONVERT TO SCALAR

#TVAL5 = TEXT/RANGE,#TMPST,45,58 $$ 14 CHARS Z LENGHT

#TNUM5 = SCALF(#TVAL5) $$ CONVERT TO SCALAR

#TVAL6 = TEXT/RANGE,#TMPST,59,72 $$ 14 CHARS X GAGE

#TNUM6 = SCALF(#TVAL6) $$ CONVERT TO SCALAR

#TVAL7 = TEXT/RANGE,#TMPST,73,86 $$ 14 CHARS Y GAGE LENGTH

#TNUM7 = SCALF(#TVAL7) $$ CONVERT TO SCALAR

#TVAL8 = TEXT/RANGE,#TMPST,87,89 $$ 3 CHARS #TNUM8 =

SCALF(#TVAL8) $$ CONVERT TO SCALAR

#TVAL9 = TEXT/RANGE,#TMPST,90,92 $$ 3 CHARS TURRET SELECTED

#TNUM9 = SCALF(#TVAL9) $$ CONVERT TO SCALAR...

Page 114: Advanced Class

© 2000 PTC 114

File I/OFile I/O

...

#TLLST(#NN) = DATA/#TNUM1,#TNUM2,#TNUM3, $

#TNUM4,#TNUM5,#TNUM6, $

#TNUM7,#TNUM8,#TNUM9 $$ BUILD THE DATA STATEMENT

#REDO) CONTIN

LOOPND $$ LOOP BOUNDARY

ENDIF

IF(#FOPEN .EQ. 0)THEN

#FCLOS = FILEF(1,5) $$ CLOSE THE .TL1 FILE

ENDIF

ENDIF

TERMAC

The data can be extracted with the OBTAIN function (after calling the macro) :

For example to extract the first tool number :OBTAIN, DATA / #TLIST(1),,,TNUM

For example to extract the last tool number :OBTAIN, DATA / #TLIST(#MXTLS),,,TNUM

...

#TLLST(#NN) = DATA/#TNUM1,#TNUM2,#TNUM3, $

#TNUM4,#TNUM5,#TNUM6, $

#TNUM7,#TNUM8,#TNUM9 $$ BUILD THE DATA STATEMENT

#REDO) CONTIN

LOOPND $$ LOOP BOUNDARY

ENDIF

IF(#FOPEN .EQ. 0)THEN

#FCLOS = FILEF(1,5) $$ CLOSE THE .TL1 FILE

ENDIF

ENDIF

TERMAC

The data can be extracted with the OBTAIN function (after calling the macro) :

For example to extract the first tool number :OBTAIN, DATA / #TLIST(1),,,TNUM

For example to extract the last tool number :OBTAIN, DATA / #TLIST(#MXTLS),,,TNUM

Page 115: Advanced Class

© 2000 PTC 115

SPWNF CommandSPWNF Command

The SPWNF command spawns a sub-process :

SPWNF ( command, option)

command : text string containing the command line to be passed to the operating system

option : processing option, 0:process after the FINI (available only in Pro/E 2000i2 build 280 or better), 1:wait for process to return to GPOST before continuing and 2:continue GPOST processing without waiting.

The SPWNF command spawns a sub-process :

SPWNF ( command, option)

command : text string containing the command line to be passed to the operating system

option : processing option, 0:process after the FINI (available only in Pro/E 2000i2 build 280 or better), 1:wait for process to return to GPOST before continuing and 2:continue GPOST processing without waiting.

Page 116: Advanced Class

© 2000 PTC 116

SPWNF CommandSPWNF Command

Macro to rename the NC File(there seems to be a bug (C and windows bug) and we can’t run directly a command or a bat file from SPWNF, only an executable. A rbatfile.exe is provided to run batch file)

MRENTP=MACRO/ T1=TEXT/'XXRENXX.BAT' I1=FILEF(1,7,T1) $$ Check if file already exist IF(I1 .EQ. 1) THEN DMY=FILEF(1,2,T1) DMY=FILEF(1,6) $$ Close and delete ENDIF DMY=FILEF(1,3,T1) $$ Open a new file T1=TEXT/PART $$ CL file name and path T1=TEXT/UP,T1 $$ Put in upper case I1=INDXF(T1,(TEXT/'.NCL')) T1=TEXT/RANGE,T1,1,I1 $$ extract CL file name without extension T1=TEXT/T1,'TAP’ $$ Old tape extension

...

Macro to rename the NC File(there seems to be a bug (C and windows bug) and we can’t run directly a command or a bat file from SPWNF, only an executable. A rbatfile.exe is provided to run batch file)

MRENTP=MACRO/ T1=TEXT/'XXRENXX.BAT' I1=FILEF(1,7,T1) $$ Check if file already exist IF(I1 .EQ. 1) THEN DMY=FILEF(1,2,T1) DMY=FILEF(1,6) $$ Close and delete ENDIF DMY=FILEF(1,3,T1) $$ Open a new file T1=TEXT/PART $$ CL file name and path T1=TEXT/UP,T1 $$ Put in upper case I1=INDXF(T1,(TEXT/'.NCL')) T1=TEXT/RANGE,T1,1,I1 $$ extract CL file name without extension T1=TEXT/T1,'TAP’ $$ Old tape extension

...

Page 117: Advanced Class

© 2000 PTC 117

SPWNF CommandSPWNF Command

…$$ Create the batch file to run : new extension if .NC DMY=FILEF(1,1,(TEXT/'COPY ',T1,' *.NC')) DMY=FILEF(1,1,(TEXT/'DEL ',T1)) DMY=FILEF(1,5) $$ Close the bat file $$ Create command to run the bat file T1=TEXT/'C:\RBATFILE XXRENXX.BAT’ $$ Run the bat file after the end of execution of GPOST DMY=SPWNF(T1,0)TERMAC

Note : Another to do this, is to re-direct the output of the tape file to the auxiliary file (POSTF(25,1)) and in a CIMFIL on FINI read the auxiliary file and write it to a new tape file !

…$$ Create the batch file to run : new extension if .NC DMY=FILEF(1,1,(TEXT/'COPY ',T1,' *.NC')) DMY=FILEF(1,1,(TEXT/'DEL ',T1)) DMY=FILEF(1,5) $$ Close the bat file $$ Create command to run the bat file T1=TEXT/'C:\RBATFILE XXRENXX.BAT’ $$ Run the bat file after the end of execution of GPOST DMY=SPWNF(T1,0)TERMAC

Note : Another to do this, is to re-direct the output of the tape file to the auxiliary file (POSTF(25,1)) and in a CIMFIL on FINI read the auxiliary file and write it to a new tape file !

Page 118: Advanced Class

global solutions

innovation

collaboration

© 2000 PTC

Pro/NC-GPOSTPro/NC-GPOST

Advanced Machine configuration

Advanced Machine configuration

Page 119: Advanced Class

© 2000 PTC 119

Multi-axis RecommendationsMulti-axis Recommendations

Apply to Multi-axis Mill and Mill/Turn CL File format :

4 Axis :ROTATE or MULTAX 5 Axis : MULTAX

CL File accuracy : mfg_ijk_num_digits >= 8

Linear Tolerance (LINTOL) for 4 and 5 axis continuous

Apply to Multi-axis Mill and Mill/Turn CL File format :

4 Axis :ROTATE or MULTAX 5 Axis : MULTAX

CL File accuracy : mfg_ijk_num_digits >= 8

Linear Tolerance (LINTOL) for 4 and 5 axis continuous

LINTOL Deviation

Page 120: Advanced Class

© 2000 PTC 120

Multi-Axis Milling MachinesMulti-Axis Milling Machines

Multi-axis milling machine with “orthogonal” axis : Main kinematics directly

available in the Questionnaire

Look at the machine with all the axis at “Zero”

Look at the axis of rotation, not the name of the register

Primary axis is the axis that GPOST is going to try to resolve first :

Table / Table configuration : Primary is the axis on which the part is going to be mounted

Head / Head configuration : Secondary is the axis on which the tool is going to be mounted

Note : there are some errors on the machine graphics in Optfile so do not rely on them for the kinematics !

Multi-axis milling machine with “orthogonal” axis : Main kinematics directly

available in the Questionnaire

Look at the machine with all the axis at “Zero”

Look at the axis of rotation, not the name of the register

Primary axis is the axis that GPOST is going to try to resolve first :

Table / Table configuration : Primary is the axis on which the part is going to be mounted

Head / Head configuration : Secondary is the axis on which the tool is going to be mounted

Note : there are some errors on the machine graphics in Optfile so do not rely on them for the kinematics !

Page 121: Advanced Class

© 2000 PTC 121

Multi-Axis Milling MachinesMulti-Axis Milling Machines

“Translate” axis if needed : For example a configuration Table B / Table C is the same as Table B / Table A (B “zero” is translated by 90 deg.)

Note : you can use the new questionnaire V5.4 to create your post and run it with the Pro/NC-GPOST 2000i2 - build 280 or better

“Translate” axis if needed : For example a configuration Table B / Table C is the same as Table B / Table A (B “zero” is translated by 90 deg.)

Note : you can use the new questionnaire V5.4 to create your post and run it with the Pro/NC-GPOST 2000i2 - build 280 or better

Page 122: Advanced Class

© 2000 PTC 122

Multi-Axis Milling Machines Pivot DistancesMulti-Axis Milling Machines Pivot Distances

Page 123: Advanced Class

© 2000 PTC 123

Multi-Axis Milling Machines Multi-Axis Milling Machines

Bostomatic type : A table / B head(supported directly in questionnaire for 2001)

Define a 5 axis machineB Table / A Head

FIL Macro to modify the kinematics :CIMFIL/ON,MACHINDMY=POSTF(13)$$AB-BOSTOMATIC $$ TABLE/HEADDMY=POSTF(2,1,2081,4)DMY=POSTF(2,1,2082,5)CIMFIL/OFF

Bostomatic type : A table / B head(supported directly in questionnaire for 2001)

Define a 5 axis machineB Table / A Head

FIL Macro to modify the kinematics :CIMFIL/ON,MACHINDMY=POSTF(13)$$AB-BOSTOMATIC $$ TABLE/HEADDMY=POSTF(2,1,2081,4)DMY=POSTF(2,1,2082,5)CIMFIL/OFF

Page 124: Advanced Class

© 2000 PTC 124

Multi-Axis Milling MachinesMulti-Axis Milling Machines

Right Angle Head orDual Spindle Machine (Maho)

Create a 4 axis milling machine (rotary head A axis for example)

Create a special register for the rotary axis : alias “AAA”,format 0

Disable the AAA registerin FIL : T1=TEXT/’AAA’;T2=TEST/’’;REPLAC/T1,T2

Right Angle Head orDual Spindle Machine (Maho)

Create a 4 axis milling machine (rotary head A axis for example)

Create a special register for the rotary axis : alias “AAA”,format 0

Disable the AAA registerin FIL : T1=TEXT/’AAA’;T2=TEST/’’;REPLAC/T1,T2

Page 125: Advanced Class

© 2000 PTC 125

Multi-Axis Milling MachinesMulti-Axis Milling Machines

Right Angle Head or Dual Spindle Machine (Maho) In Pro/NC outputs MULTAX, the post will automatically

orient the spindle in horizontal or vertical position Macro to output plan selection on LOADTL :

Right Angle Head or Dual Spindle Machine (Maho) In Pro/NC outputs MULTAX, the post will automatically

orient the spindle in horizontal or vertical position Macro to output plan selection on LOADTL :

G17G18 = MACRO /$$ Check the tool vector of the next GOTOCLREC=POSTF(7,1)+1 $$ Current CL pos.DO / LOP1, ILOOP=1, 2 ILOOP=1 XX=POSTF(14) $$ Read next CL rec. CLASS=POSTF(7,2) IF (CLASS.EQ.5000) THEN $$ GOTO ILOOP=3 $$ Exit the loop NBARG=POSTF(5) $$ number of argument IF (NBARG.GT.8) THEN $$ MULTAX JVAL=POSTF(7,10) IF (JVAL.EQ.1) THEN GPLAN=18 ELSE GPLAN=17 ENDIF ELSE GPLAN=17 ENDIF ENDIFLOP1) CONTINXX=POSTF(15,CLREC) $$ return to initial pos.TERMAC

T=20;G=7

CIMFIL/ON,LOADTL$$ Macro will output$$ G17 T..$$ or G18 T..XX=POSTF(20) $$ Save CL recCALL/G17G18REPEAT/OFFREPEAT/T,G,GPLANXX=POSTF(21)XX=POSTF(21)CIMFIL/OFF

Page 126: Advanced Class

© 2000 PTC 126

Multi-Axis Milling MachinesMulti-Axis Milling Machines

Multi-axis milling machine with “non orthogonal” axis Nutating Heads are directly

supported in the questionnaire

Multi-axis milling machine with “non orthogonal” axis Nutating Heads are directly

supported in the questionnaire

Page 127: Advanced Class

© 2000 PTC 127

Multi-Axis Milling MachinesMulti-Axis Milling Machines

Multi-axis milling machine with “non orthogonal” axis Swiveling table like with MAHO

are supported with FIL macro (Questionnaire in 2001)

FLEN=155.006/25.4ANUT=45.0TRNX=0.0

CIMFIL/ON,MACHINDMY=POSTF(13)$$ CB-NUTATOR TABLEDMY=POSTF(2,3,635,FLEN) $$ PVTDST in ZDMY=POSTF(2,3,653,TRNX) $$ PVTD in XDMY=POSTF(2,3,881,ANUT) $$ NUTAT ANGLECIMFIL/OFF

“B40=“ and “C40=“ registers output (feedrate calculation) can be controlled with DBLCOM 985 (register selection with INTCOM 2456, 2457)

Multi-axis milling machine with “non orthogonal” axis Swiveling table like with MAHO

are supported with FIL macro (Questionnaire in 2001)

FLEN=155.006/25.4ANUT=45.0TRNX=0.0

CIMFIL/ON,MACHINDMY=POSTF(13)$$ CB-NUTATOR TABLEDMY=POSTF(2,3,635,FLEN) $$ PVTDST in ZDMY=POSTF(2,3,653,TRNX) $$ PVTD in XDMY=POSTF(2,3,881,ANUT) $$ NUTAT ANGLECIMFIL/OFF

“B40=“ and “C40=“ registers output (feedrate calculation) can be controlled with DBLCOM 985 (register selection with INTCOM 2456, 2457)

Page 128: Advanced Class

© 2000 PTC 128

Multi-Axis Milling MachinesMulti-Axis Milling Machines

When the kinematics elements are defined, the second step is to define the “behavior” of the rotary axisWhen the kinematics elements are defined, the second step is to define the “behavior” of the rotary axis

GPOST is always looking at the part stationary and the tool moving even in a table/table configuration

Page 129: Advanced Class

© 2000 PTC 130

Multi-Axis Milling MachinesMulti-Axis Milling Machines

Machine Limits : the _REPOS macro Macro activated with PLABEL / OPTION, 19, TO, 2

CIMFIL/ON,MACHIN DMY = POSTF(13) PLABEL/OPTION,19,TO,2,CIMFIL/OFF

Macro called each time a rotary limit is broken

This is a generic macro that allow you to “rewind” the rotary axis and use the alternate solution

Macro need to be customized for each case

_REPOS in the questionnaire for 2001

Machine Limits : the _REPOS macro Macro activated with PLABEL / OPTION, 19, TO, 2

CIMFIL/ON,MACHIN DMY = POSTF(13) PLABEL/OPTION,19,TO,2,CIMFIL/OFF

Macro called each time a rotary limit is broken

This is a generic macro that allow you to “rewind” the rotary axis and use the alternate solution

Macro need to be customized for each case

_REPOS in the questionnaire for 2001

Page 130: Advanced Class

© 2000 PTC 131

Multi-Axis Milling MachinesMulti-Axis Milling Machines

THE _REPOS Macro

_REPOS=MACRO/ $$ SAVE CURRENT GOTO

DMY=POSTF(20) $$ RETRACT Z-DISTANCE

RTDIS=1 $$ GET LAST RAW CLPOS - NOT USED

X1=POSTF(1,3,911)

Y1=POSTF(1,3,912)

Z1=POSTF(1,3,913)

I1=POSTF(1,3,914)

J1=POSTF(1,3,915)

K1=POSTF(1,3,916) $$ GET ABC POSITION FROM PRES(A-C)

A1=POSTF(1,3,292)

B1=POSTF(1,3,293)

C1=POSTF(1,3,294) $$ GET CYCLE FLAG

ICY=POSTF(1,1,482) $$ UPDATE WARNING COUNT

IWN=POSTF(1,1,1932)

IWN=IWN+1

DMY=POSTF(2,1,1932,IWN) $$ GET PRIMARY AXIS

IPRM=POSTF(1,1,2081)-3 $$ FIND AXIS THAT HIT LIMIT - NOT USED

ILM=0

IF(POSTF(1,1,1) .NE. 53) THEN

IF(A1 .LT. (POSTF(1,3,595)))ILM=1

IF(A1 .GT. (POSTF(1,3,601)))ILM=1

ENDIF

IF(POSTF(1,1,2) .NE. 53) THEN

IF(B1 .LT. (POSTF(1,3,596)))ILM=2

IF(B1 .GT. (POSTF(1,3,602)))ILM=2

ENDIF

...

THE _REPOS Macro

_REPOS=MACRO/ $$ SAVE CURRENT GOTO

DMY=POSTF(20) $$ RETRACT Z-DISTANCE

RTDIS=1 $$ GET LAST RAW CLPOS - NOT USED

X1=POSTF(1,3,911)

Y1=POSTF(1,3,912)

Z1=POSTF(1,3,913)

I1=POSTF(1,3,914)

J1=POSTF(1,3,915)

K1=POSTF(1,3,916) $$ GET ABC POSITION FROM PRES(A-C)

A1=POSTF(1,3,292)

B1=POSTF(1,3,293)

C1=POSTF(1,3,294) $$ GET CYCLE FLAG

ICY=POSTF(1,1,482) $$ UPDATE WARNING COUNT

IWN=POSTF(1,1,1932)

IWN=IWN+1

DMY=POSTF(2,1,1932,IWN) $$ GET PRIMARY AXIS

IPRM=POSTF(1,1,2081)-3 $$ FIND AXIS THAT HIT LIMIT - NOT USED

ILM=0

IF(POSTF(1,1,1) .NE. 53) THEN

IF(A1 .LT. (POSTF(1,3,595)))ILM=1

IF(A1 .GT. (POSTF(1,3,601)))ILM=1

ENDIF

IF(POSTF(1,1,2) .NE. 53) THEN

IF(B1 .LT. (POSTF(1,3,596)))ILM=2

IF(B1 .GT. (POSTF(1,3,602)))ILM=2

ENDIF

...

...

IF(POSTF(1,1,3) .NE. 53) THEN

IF(C1 .LT. (POSTF(1,3,597)))ILM=3

IF(C1 .GT. (POSTF(1,3,603)))ILM=3

ENDIF

$$ KILL CYCLE

IF(ICY .EQ. 1) THEN

CYCLE/OFF

ENDIF

$$ RETRACT TOOL AND INDEX PRIMARY AXIS

DISPLY/NEXT

PPRINT/' *** WARNING *** AXIS RE-POSITION BY TRAVEL LIMIT'

GODLTA/RTDIS

CASE/IPRM

WHEN/1

ROTATE/AAXIS,INCR,180

WHEN/2

ROTATE/BAXIS,INCR,180

WHEN/3

ROTATE/CAXIS,INCR,180

ENDCAS

SPINDL/OFF

COOLNT/OFF

STOP

$$ ADVANCE TOOL BACK TO SAME POS

SPINDL/ON

COOLNT/ON

GODLTA/-RTDIS

IF(ICY .EQ. 1) THEN

CYCLE/ON

ENDIF

$$ REDO GOTO POINT

DMY=POSTF(21)

DMY=POSTF(13)

TERMAC

...

IF(POSTF(1,1,3) .NE. 53) THEN

IF(C1 .LT. (POSTF(1,3,597)))ILM=3

IF(C1 .GT. (POSTF(1,3,603)))ILM=3

ENDIF

$$ KILL CYCLE

IF(ICY .EQ. 1) THEN

CYCLE/OFF

ENDIF

$$ RETRACT TOOL AND INDEX PRIMARY AXIS

DISPLY/NEXT

PPRINT/' *** WARNING *** AXIS RE-POSITION BY TRAVEL LIMIT'

GODLTA/RTDIS

CASE/IPRM

WHEN/1

ROTATE/AAXIS,INCR,180

WHEN/2

ROTATE/BAXIS,INCR,180

WHEN/3

ROTATE/CAXIS,INCR,180

ENDCAS

SPINDL/OFF

COOLNT/OFF

STOP

$$ ADVANCE TOOL BACK TO SAME POS

SPINDL/ON

COOLNT/ON

GODLTA/-RTDIS

IF(ICY .EQ. 1) THEN

CYCLE/ON

ENDIF

$$ REDO GOTO POINT

DMY=POSTF(21)

DMY=POSTF(13)

TERMAC

Page 131: Advanced Class

© 2000 PTC 132

Multi-Axis Milling MachinesMulti-Axis Milling Machines

Developing and testing a 5 axis milling post-processor First Validate the kinematics

before working on the tape format (tool change, cycles, …)

Test the kinematics in positioning with simple and known positions (cube !)

Initially without pivot distance to check the angular positions

Then with pivot distance to check positions Test continuous motions

(Linearization) Test limits

Then develop tape format Feedrate calculation ( 1/T ) Cycles ...

Developing and testing a 5 axis milling post-processor First Validate the kinematics

before working on the tape format (tool change, cycles, …)

Test the kinematics in positioning with simple and known positions (cube !)

Initially without pivot distance to check the angular positions

Then with pivot distance to check positions Test continuous motions

(Linearization) Test limits

Then develop tape format Feedrate calculation ( 1/T ) Cycles ...

Inverse time feedrate : When combined linear/rotary motion exist, most good CNC controls require the inverse of the amount of time necessary to make the move

F(code) = 1 (minute) / (time = 3D distance / velocity)

Page 132: Advanced Class

© 2000 PTC 134

Multi-axis LathesMulti-axis Lathes

NCL File from Pro/NC

HEAD / BOTH

HEAD / 1

HEAD / 2

HEAD / OFF

HEAD / hd, OPTION, op

NCL File from Pro/NC

HEAD / BOTH

HEAD / 1

HEAD / 2

HEAD / OFF

HEAD / hd, OPTION, op

Processed by GPOST

HEAD / BOTH

HEAD / 1

HEAD / 2

HEAD / OFF

OP / op, HED, hd

Processed by GPOST

HEAD / BOTH

HEAD / 1

HEAD / 2

HEAD / OFF

OP / op, HED, hd

FIL macro should start on the syntax generated by GPOST during its pre-processing of the CL file

Page 133: Advanced Class

© 2000 PTC 135

Multi-axis LathesMulti-axis Lathes

Synchronized Lathes 2 Tapes Method Can be done with two techniques

Process two times the CL file Macro on HEAD, FINI, MACHIN and OP

Redirect output for tape 2 and write it in a second tap file Macro on HEAD, FINI, MACHIN and OP

Synchronized Lathes by block : G13/G14 Method Macro on HEAD and OP to generate the codes

HEAD /1 for G13 and sequence number HEAD / 2 for G14 and sequence number OP / op, HED, hd to generate M(100+op)

Synchronized Lathes 2 Tapes Method Can be done with two techniques

Process two times the CL file Macro on HEAD, FINI, MACHIN and OP

Redirect output for tape 2 and write it in a second tap file Macro on HEAD, FINI, MACHIN and OP

Synchronized Lathes by block : G13/G14 Method Macro on HEAD and OP to generate the codes

HEAD /1 for G13 and sequence number HEAD / 2 for G14 and sequence number OP / op, HED, hd to generate M(100+op)

Page 134: Advanced Class

© 2000 PTC 136

Multi-axis LathesMulti-axis Lathes

For Example OKUMA : G13/G14 techniqueCURHED=1SEQ1=1SEQ2=1

CIMFIL/ON,HEADHSIDE=POSTF(7,4)IF ((HSIDE.EQ.1).AND.(CURHED.NE.1)) THEN $$ Store next sequence number to be output for Head 2 SEQ2=POSTF(1,1,2012) $$ INTCOM 2012 : next sequence number SEQNO/SEQ1,INCR,1 INSERT/' G13$' CURHED=1ENDIFIF ((HSIDE.EQ.2).AND.(CURHED.NE.2)) THEN$$ Store next sequence number to be output for Head 1 SEQ1=POSTF(1,1,2012) SEQNO/SEQ2,INCR,1 INSERT/' G14$' CURHED=2ENDIFENDIF$$ Ignore the other HEAD commandsCIMFIL/OFF

For Example OKUMA : G13/G14 techniqueCURHED=1SEQ1=1SEQ2=1

CIMFIL/ON,HEADHSIDE=POSTF(7,4)IF ((HSIDE.EQ.1).AND.(CURHED.NE.1)) THEN $$ Store next sequence number to be output for Head 2 SEQ2=POSTF(1,1,2012) $$ INTCOM 2012 : next sequence number SEQNO/SEQ1,INCR,1 INSERT/' G13$' CURHED=1ENDIFIF ((HSIDE.EQ.2).AND.(CURHED.NE.2)) THEN$$ Store next sequence number to be output for Head 1 SEQ1=POSTF(1,1,2012) SEQNO/SEQ2,INCR,1 INSERT/' G14$' CURHED=2ENDIFENDIF$$ Ignore the other HEAD commandsCIMFIL/OFF

CIMFIL/ON,OPPVAL=100+POSTF(7,4)INSERT/'P',PVAL,'$'CIMFIL/OFF

Page 135: Advanced Class

© 2000 PTC 137

Wire EDMWire EDM

Pro/NC-GPOST supports 2 Axis Wire EDM

4 Axis Wire EDM XYUV Output

UV Definition : Abs,Incr, Incr from XY, …

Wire Height DefinitionDBLCOM 889 CIMFIL/ON,SET$$ SET / UPPER, Zhigh, LOWER, ZlowZHIGH=POSTF(7,5)DMY=POSTF(2,3,889,ZHIGH)CIMFIL/OFF

XYQR Output MULTAX Data Input only 2 contours input with FIL macros

Pro/NC-GPOST supports 2 Axis Wire EDM

4 Axis Wire EDM XYUV Output

UV Definition : Abs,Incr, Incr from XY, …

Wire Height DefinitionDBLCOM 889 CIMFIL/ON,SET$$ SET / UPPER, Zhigh, LOWER, ZlowZHIGH=POSTF(7,5)DMY=POSTF(2,3,889,ZHIGH)CIMFIL/OFF

XYQR Output MULTAX Data Input only 2 contours input with FIL macros

Page 136: Advanced Class

© 2000 PTC 138

Wire EDMWire EDM

AGIE CUTCOM Flip

AGIE CUTCOM Flip

$$ AddressesA=1;B=2;C=3;D=4;E=5;F=6;G=7;H=8;I=9J=10;K=11;L=12;M=13;N=14O=15;P=16;Q=17;R=18;S=19;T=20U=21;V=22;W=23;X=24;Y=25;Z=26

AGIE=MACRO/$$ This macro will split the GOTO$$ following a CUTCOM in 2 $$ and flip the order of output$$ This macro is called from the CUTCOM$$ Current positionXPOS=POSTF(1,3,350);YPOS=POSTF(1,3,351)ZPOS=POSTF(1,3,352)$$ Read the GOTO or FEDRAT ?1XX=POSTF(14)CLASS=POSTF(7,2)IF (CLASS.EQ.2000) THEN$$ This is the FEDRAT, process and read next CL XX=POSTF(13) XX=POSTF(14)ENDIF...

...$$ GOTO coordinatesXVAL=POSTF(7,6);YVAL=POSTF(7,7);ZVAL=POSTF(7,8)$$ Mid pointXMID=(XVAL-XPOS)/2;YMID=(YVAL-YPOS)/2;ZMID=(ZVAL-ZPOS)/2$$ Redirect outputXX=POSTF(25,1)SEQNO/OFF $$ Stop sequence numbering$$ Output in 2 motionsGOTO/XMID,YMID,ZMIDGOTO/XVAL,YVAL,ZVALSEQNO/ON $$ restart sequence numbering$$ Reset output re-directionXX=POSTF(25,0)$$ Read back the two blocksBLK1=TEXT/READ,PUNCHBLK2=TEXT/READ,PUNCH$$ Flip the output and add CUTCOM codesINSERT/' ',BLK2,' G44$'INSERT/' ',BLK1,' G40$'$$ Issue the last G44 with the next X Y block$$ L is an extra register at the end of the MCD list$$ alliased to GREPEAT/X,Y,L,44,ALL TERMAC

CIMFIL/ON,CUTCOMTYP=POSTF(7,4)IF (TYP.NE.ICODEF(OFF)) THEN CALL/AGIEENDIFCIMFIL/OFF

GOTO / P1GOTO / P2GOTO / P3

G1 P2 G44G1 P1 G40G1 P3 G44

Page 137: Advanced Class

© 2000 PTC 139

Punch PressPunch Press

Punch presses are supported using FIL routines

2 Types of Punch press : Standard output (G1/G2/G3)

(Trumpf, ... ) Polar Coordinates

(Fanuc, Amada, Strippit, ...) Macros on CYCLE

CYCLE / NIBBLE, STEP, step_valueGOTO / start positionGOTO / end position CYCLE / OFF

CYCLE / NIBBLE, STEP, step_valueGOTO / start positionCIRCLE / …GOTO / end positionCYCLE / OFF

Punch presses are supported using FIL routines

2 Types of Punch press : Standard output (G1/G2/G3)

(Trumpf, ... ) Polar Coordinates

(Fanuc, Amada, Strippit, ...) Macros on CYCLE

CYCLE / NIBBLE, STEP, step_valueGOTO / start positionGOTO / end position CYCLE / OFF

CYCLE / NIBBLE, STEP, step_valueGOTO / start positionCIRCLE / …GOTO / end positionCYCLE / OFF

Page 138: Advanced Class

© 2000 PTC 140

Punch PressPunch Press

Macro for Sheet sizeGETSIZ = MACRO /$$ Macro to find the sheet size$$ PPRINT / SIZE : xval X yval X thickness$$ PPRINT before the first LOADTL$$ Return OKSIZ 0:not found 1:foundCLPOS=POSTF(7,1)+1 $$ Current CL positionTSIZE=TEXT/'SIZE'COLON=TEXT/':'XMULT=TEXT/'X'DO / ENDO1, ILOOP=1, 10 DMY=POSTF(14) $$ read next CL record CLC=POSTF(7,2) $$ CL rec class SCL=POSTF(7,3) $$ CL rec sub-class IF (CLC.EQ.2000.AND.SCL.EQ.ICODEF(LOADTL))THEN OKSIZ=0 $$ PPRINT/SIZE not found ILOOP=11 $$ Exit the loop ELSE IF (CLC.EQ.2000.AND.SCL.EQ.ICODEF(PPRINT)) THEN TPPR=TEXT/CLW $$ PPRINT text TPPR=TEXT/OMIT,TPPR,1 $$ Omit trailing blanks OKSIZ=INDXF(TPPR,TSIZE) $$ look for word SIZE IF (OKSIZ.NE.0) THEN ILOOP=11 $$ Exit the loop $$ Extract the sheet size ICOL=INDXF(TPPR,COLON) $$ Position of : ILEN=CANF(TPPR,1) $$ Length of string TPPR=TEXT/RANGE,TPPR,ICOL+1,ILEN ...

Macro for Sheet sizeGETSIZ = MACRO /$$ Macro to find the sheet size$$ PPRINT / SIZE : xval X yval X thickness$$ PPRINT before the first LOADTL$$ Return OKSIZ 0:not found 1:foundCLPOS=POSTF(7,1)+1 $$ Current CL positionTSIZE=TEXT/'SIZE'COLON=TEXT/':'XMULT=TEXT/'X'DO / ENDO1, ILOOP=1, 10 DMY=POSTF(14) $$ read next CL record CLC=POSTF(7,2) $$ CL rec class SCL=POSTF(7,3) $$ CL rec sub-class IF (CLC.EQ.2000.AND.SCL.EQ.ICODEF(LOADTL))THEN OKSIZ=0 $$ PPRINT/SIZE not found ILOOP=11 $$ Exit the loop ELSE IF (CLC.EQ.2000.AND.SCL.EQ.ICODEF(PPRINT)) THEN TPPR=TEXT/CLW $$ PPRINT text TPPR=TEXT/OMIT,TPPR,1 $$ Omit trailing blanks OKSIZ=INDXF(TPPR,TSIZE) $$ look for word SIZE IF (OKSIZ.NE.0) THEN ILOOP=11 $$ Exit the loop $$ Extract the sheet size ICOL=INDXF(TPPR,COLON) $$ Position of : ILEN=CANF(TPPR,1) $$ Length of string TPPR=TEXT/RANGE,TPPR,ICOL+1,ILEN ...

... IX=INDXF(TPPR,XMULT) $$ First X STX=TEXT/RANGE,TPPR,1,IX-1 $$ Extract X ILEN=CANF(TPPR,1) $$ Length of string TPPR=TEXT/RANGE,TPPR,IX+1,ILEN $$ second X ILEN=CANF(TPPR,1) $$ Length of string IX=INDXF(TPPR,XMULT) $$ Position of first X STY=TEXT/RANGE,TPPR,1,IX-1 $$ Extract Y STZ=TEXT/RANGE,TPPR,IX+1,ILEN $$ Extract Z $$ Debug : INSERT/'STX=',STX,'STY=',STY,'STZ=',STZ,'$' $$ Conversion to real XSIZE=SCALF(STX) YSIZE=SCALF(STY) ZSIZE=SCALF(STZ) ELSE ILOOP=1 $$ Continue the loop ENDIF ELSE ILOOP=1 $$ Continue the loop ENDIF ENDIFENDO1) CONTIN$$ return initial position in CL RSLT=POSTF(15,CLPOS) TERMAC

... IX=INDXF(TPPR,XMULT) $$ First X STX=TEXT/RANGE,TPPR,1,IX-1 $$ Extract X ILEN=CANF(TPPR,1) $$ Length of string TPPR=TEXT/RANGE,TPPR,IX+1,ILEN $$ second X ILEN=CANF(TPPR,1) $$ Length of string IX=INDXF(TPPR,XMULT) $$ Position of first X STY=TEXT/RANGE,TPPR,1,IX-1 $$ Extract Y STZ=TEXT/RANGE,TPPR,IX+1,ILEN $$ Extract Z $$ Debug : INSERT/'STX=',STX,'STY=',STY,'STZ=',STZ,'$' $$ Conversion to real XSIZE=SCALF(STX) YSIZE=SCALF(STY) ZSIZE=SCALF(STZ) ELSE ILOOP=1 $$ Continue the loop ENDIF ELSE ILOOP=1 $$ Continue the loop ENDIF ENDIFENDO1) CONTIN$$ return initial position in CL RSLT=POSTF(15,CLPOS) TERMAC

Page 139: Advanced Class

© 2000 PTC 141

Merged Post-processorMerged Post-processor

Merged post-processors can be used for :

Mill/Turn Punch/Laser Special machine

Multiple processes One for each post : generate

a clfilename.Pui tape file for each post

One for the merging post : used to merge the *.Pui tape file in one tape file : *.tap

Setup of merged PP One main PP with the list of

all the PPs (creates UNC?01.Mnn)

All the PPs need “Merged Post” checked

Merged post-processors can be used for :

Mill/Turn Punch/Laser Special machine

Multiple processes One for each post : generate

a clfilename.Pui tape file for each post

One for the merging post : used to merge the *.Pui tape file in one tape file : *.tap

Setup of merged PP One main PP with the list of

all the PPs (creates UNC?01.Mnn)

All the PPs need “Merged Post” checked

Page 140: Advanced Class

© 2000 PTC 142

Merged Post-processor : Basic Mill/Turn ZXCMerged Post-processor : Basic Mill/Turn ZXC

Turning functionality 2 Axis Lathe post-processor

Create the list of Merged PPs

Milling functionality “Polar Coordinates” ZXC :

Machine type “Radial axis”

Change TURRET in LOADTL : CIMFIL/ON,TURRET

XX=POSTF(9,3,(ICODEF(LOADTL)))XX=POSTF(13)CIMFIL/OFF

CIMFIL on MODE to issue switching codes

Turning functionality 2 Axis Lathe post-processor

Create the list of Merged PPs

Milling functionality “Polar Coordinates” ZXC :

Machine type “Radial axis”

Change TURRET in LOADTL : CIMFIL/ON,TURRET

XX=POSTF(9,3,(ICODEF(LOADTL)))XX=POSTF(13)CIMFIL/OFF

CIMFIL on MODE to issue switching codes

Page 141: Advanced Class

© 2000 PTC 143

Merged Post-processor : Advanced Mill/Turn : ZXYC, ZXYCB, ...Merged Post-processor : Advanced Mill/Turn : ZXYC, ZXYCB, ...More than one millingpost can be used

MODE/MILL,ppnumber and MODE/TURN, ppnumber used to switch between PP

MODE macro can be used to manuallyswitch the post processors :CL file :MODE/MILL,code or minor wordFIL File :CIMFIL/ON,MODEMACH=POSTF(7,4)IF (MACH.EQ.ICODEF(MILL)) THEN OPTION=POSTF(7,5) CASE/OPTION WHEN/1 $$ or ICODEF(minor_word) $$ Call UNCX01.F01 MODE/MILL,1 WHEN/2 $$ Call UNCX01.F10 MODE/MILL,10 ...

More than one millingpost can be used

MODE/MILL,ppnumber and MODE/TURN, ppnumber used to switch between PP

MODE macro can be used to manuallyswitch the post processors :CL file :MODE/MILL,code or minor wordFIL File :CIMFIL/ON,MODEMACH=POSTF(7,4)IF (MACH.EQ.ICODEF(MILL)) THEN OPTION=POSTF(7,5) CASE/OPTION WHEN/1 $$ or ICODEF(minor_word) $$ Call UNCX01.F01 MODE/MILL,1 WHEN/2 $$ Call UNCX01.F10 MODE/MILL,10 ...

Page 142: Advanced Class

global solutions

innovation

collaboration

© 2000 PTC

Pro/NC-GPOST2000i2

Pro/NC-GPOST2000i2

Build 2000280Build 2000280

Page 143: Advanced Class

© 2000 PTC 145

Pro/NC-GPOST 2000i2 build 280Pro/NC-GPOST 2000i2 build 280

This is a special build

The questionnaire (OPTFILE) is the same than previous version

The run-time (GPOST) is equivalent to Pro/NC-GPOST 2001

New functionality available through macro !

This is a special build

The questionnaire (OPTFILE) is the same than previous version

The run-time (GPOST) is equivalent to Pro/NC-GPOST 2001

New functionality available through macro !

Page 144: Advanced Class

© 2000 PTC 146

MiscellaneousMiscellaneous

Macro on REMARK : all the $$ text in Pro/E CL file are converted automatically to REMARK / text :

CIMFIL/ON,REMARKTXT=TEXT/CLW $$ Extract textTXT=TEXT/OMIT,TT,1 $$ Remove trailing blank….

Control Pivot point output for 5 axis Head/Head machine : INTCOM(1510) = 0, Output at pivot control point (default)

= 1, Output at spindle face

The output of the ABC axis can now be suppressed with the CYCLE/ commands

INTCOM(4337) = 0 Repeat ABC axes with new CYCLE = 1 Do not repeat ABC axes with new

CYCLE

Macro on REMARK : all the $$ text in Pro/E CL file are converted automatically to REMARK / text :

CIMFIL/ON,REMARKTXT=TEXT/CLW $$ Extract textTXT=TEXT/OMIT,TT,1 $$ Remove trailing blank….

Control Pivot point output for 5 axis Head/Head machine : INTCOM(1510) = 0, Output at pivot control point (default)

= 1, Output at spindle face

The output of the ABC axis can now be suppressed with the CYCLE/ commands

INTCOM(4337) = 0 Repeat ABC axes with new CYCLE = 1 Do not repeat ABC axes with new

CYCLE

Page 145: Advanced Class

© 2000 PTC 147

MiscellaneousMiscellaneous

Machining Time

DBLCOM(0989) = Time for feedrate motion

DBLCOM(0990) = Time for rapid motion

DBLCOM(0991) = Time for dwell

DBLCOM(0992) = Time for tool change

DBLCOM(0993) = Time for misc operation

Specify G01 modality INTCOM(4339) = 0 G01 is modal as before = 1 G01 is non-modal

Circle Information

DBLCOM(926) = circle start angle

DBLCOM(910) = total angle

INTCOM(538) = circle direction

Machining Time

DBLCOM(0989) = Time for feedrate motion

DBLCOM(0990) = Time for rapid motion

DBLCOM(0991) = Time for dwell

DBLCOM(0992) = Time for tool change

DBLCOM(0993) = Time for misc operation

Specify G01 modality INTCOM(4339) = 0 G01 is modal as before = 1 G01 is non-modal

Circle Information

DBLCOM(926) = circle start angle

DBLCOM(910) = total angle

INTCOM(538) = circle direction

Page 146: Advanced Class

© 2000 PTC 148

Automatic CLAMP/UNCLAMPAutomatic CLAMP/UNCLAMP

A new option to control the automatic clamp/unclamp of the axes has been added. For each GOTO/ command, the required axes will be unclamped (M-code) before the move and clamped after.

INTCOM(4319) = 0, No clamp/unclamp needed – Default = 1, Auto axes clamp/unclamp required.

A new option to control the automatic clamp/unclamp of the axes has been added. For each GOTO/ command, the required axes will be unclamped (M-code) before the move and clamped after.

INTCOM(4319) = 0, No clamp/unclamp needed – Default = 1, Auto axes clamp/unclamp required.

UNCLAMP CLAMP

Set INTCOM(4320) > 0 to specify M-code to unclamp all axes

Set INTCOM(4320) = 0 to Unclamp each axis individually

Set INTCOM(4321-26) = to specify M-code for each xyzabc axis.

If set to zero then that axis will not be unclamped.

Set INTCOM(4327) > 0 to specify M-code to unclamp all axes

Set INTCOM(4327) = 0 to Unclamp each axis individually

Set INTCOM(4328-33) = to specify M-code for each xyzabc axis.

If set to zero then that axis will not be unclamped.

Page 147: Advanced Class

© 2000 PTC 149

Tangential ArcfittingTangential Arcfitting

Generates circular and helical interpolation records by collecting linear motions within tolerance

Keep arcs tangent to each other Works in any plane supported by the NC machine

2D Planes : XY, YZ, ZX planes 3D Arcs for FANUC

(G03.4,G02.4) and SIEMENS (CIP format)

Control available for : Tolerances Fitting Plane Minimum and Maximum number of points

Generates circular and helical interpolation records by collecting linear motions within tolerance

Keep arcs tangent to each other Works in any plane supported by the NC machine

2D Planes : XY, YZ, ZX planes 3D Arcs for FANUC

(G03.4,G02.4) and SIEMENS (CIP format)

Control available for : Tolerances Fitting Plane Minimum and Maximum number of points

Page 148: Advanced Class

© 2000 PTC 150

TANGENTIAL ARCFITTING SETUP(Pro/NC-GPOST 2000i2 - build 280)

Set INTCOM(4334)=1 Arcfitting activation by CL

commands in CL file : CRVFIT/ARC, [ ON, OFF ]

Options To allow helical fitting :

CRVFIT/ ARCSLP, [ON,OFF] OFF is the default For 3D Arcs :

CRVFIT / XYZ, [ON,OFF] OFF is the default Select fitting plane

CRVFIT/PLANE, [XYPLAN,ZXPLAN, YZPLAN,ALL] ALL is the default Tolerances :

CRVFIT / TOLER, type, valueType : 1-fit tolerance (0.005) , 2-Z change tolerance (0.005), …..

Number of POINTSCRVFIT/POINT1,min number (5) or CRVFIT/POINT,2,max number (150)

… more options are available - check documentation NURBSFITTING.doc

TANGENTIAL ARCFITTING SETUP(Pro/NC-GPOST 2000i2 - build 280)

Set INTCOM(4334)=1 Arcfitting activation by CL

commands in CL file : CRVFIT/ARC, [ ON, OFF ]

Options To allow helical fitting :

CRVFIT/ ARCSLP, [ON,OFF] OFF is the default For 3D Arcs :

CRVFIT / XYZ, [ON,OFF] OFF is the default Select fitting plane

CRVFIT/PLANE, [XYPLAN,ZXPLAN, YZPLAN,ALL] ALL is the default Tolerances :

CRVFIT / TOLER, type, valueType : 1-fit tolerance (0.005) , 2-Z change tolerance (0.005), …..

Number of POINTSCRVFIT/POINT1,min number (5) or CRVFIT/POINT,2,max number (150)

… more options are available - check documentation NURBSFITTING.doc

Tangential ArcfittingTangential Arcfitting

Page 149: Advanced Class

© 2000 PTC 151

NURBS FittingNURBS Fitting

NURBS FITTING

Generate polynomial or spline curve interpolation record by collecting linear motions within tolerances

Support for Bezier (Heidenhain) NURBS (Fanuc) Polynomial (Philips,Siemens) B-Spline (Siemens, NUM,

Mikron)

Control available for : Tolerances Fitting Plane Minimum and Maximum number of points

NURBS FITTING

Generate polynomial or spline curve interpolation record by collecting linear motions within tolerances

Support for Bezier (Heidenhain) NURBS (Fanuc) Polynomial (Philips,Siemens) B-Spline (Siemens, NUM,

Mikron)

Control available for : Tolerances Fitting Plane Minimum and Maximum number of points

N6G1X11.9195Y-.2367Z-5.25F1.N7POLY PO[Y]=(.1723,.4208,-.0119)PO[Z]=(-3.222,-.0008,-.0536)N8PO[Y]=(.9761,.2143,-.0117)PO[Z]=(-1.8997,-.09,-.0198)N9PO[Y]=(2.8101,.403,-.0609)PO[Z]=(-.4939,-.3364,-.0467)N10PO[Y]=(4.2958,.0978,-.0222)PO[Z]=(-.0612,-.2118,-.0061

Page 150: Advanced Class

© 2000 PTC 152

NURBS FittingNURBS Fitting

NURBS FITTING SETUP(Pro/NC-GPOST 2000i2 - build 280)

Set INTCOM(4334)=1 NURBS fitting activation by CL

commands in CL file : CRVFIT/SPLINE, [ ON, OFF ]

Options Select type of NURBS

CRVFIT/TYPE, idid : 0- NURBS : FANUC, HEIDENHAIN, SIEMENS, 1-Cubic Spline : SIEMENS POLY

Select fitting planeCRVFIT/PLANE, [XYPLAN,ZXPLAN, YZPLAN,ALL] ALL is the default

Tolerances :CRVFIT / TOLER, type, valueType : 1-fit tolerance (0.005) , 2-Z change tolerance (0.005), …..

Number of POINTSCRVFIT/POINT1,min number (5) or CRVFIT/POINT,2,max number (150)

NURBS FITTING SETUP(Pro/NC-GPOST 2000i2 - build 280)

Set INTCOM(4334)=1 NURBS fitting activation by CL

commands in CL file : CRVFIT/SPLINE, [ ON, OFF ]

Options Select type of NURBS

CRVFIT/TYPE, idid : 0- NURBS : FANUC, HEIDENHAIN, SIEMENS, 1-Cubic Spline : SIEMENS POLY

Select fitting planeCRVFIT/PLANE, [XYPLAN,ZXPLAN, YZPLAN,ALL] ALL is the default

Tolerances :CRVFIT / TOLER, type, valueType : 1-fit tolerance (0.005) , 2-Z change tolerance (0.005), …..

Number of POINTSCRVFIT/POINT1,min number (5) or CRVFIT/POINT,2,max number (150)

Page 151: Advanced Class

© 2000 PTC 153

NURBS & ARC FittingNURBS & ARC Fitting

CL COMMANDS SUMMARY

FANUC G6.2, SIEMENS BSPLINE, HEIDENHAIN NURBS

CRVFIT/TYPE,1 CRVFIT/SPLINE,ON

SIEMENS POLY

CRVFIT/TYPE,2 CRVFIT/SPLINE,ON

3D Arcs : SIEMENS CIP and FANUC G3.4/G2.4

CRVFIT/XYZ,ON CRVFIT/ARC,ON

2D Arcs

CRVFIT/ARC,ON

CL COMMANDS SUMMARY

FANUC G6.2, SIEMENS BSPLINE, HEIDENHAIN NURBS

CRVFIT/TYPE,1 CRVFIT/SPLINE,ON

SIEMENS POLY

CRVFIT/TYPE,2 CRVFIT/SPLINE,ON

3D Arcs : SIEMENS CIP and FANUC G3.4/G2.4

CRVFIT/XYZ,ON CRVFIT/ARC,ON

2D Arcs

CRVFIT/ARC,ON

Page 152: Advanced Class

© 2000 PTC 154

NURBS & ARC FittingNURBS & ARC Fitting

SAMPLE PPs PROVIDED UNCX01.P01 : FANUC

(Makino) NURBS and 3D Arcs

UNCX01.P02 : SIEMENSBSPLINE

UNCX01.P03 : HEIDENHAINNURBS

UNCX01.P04 : SIEMENS POLY format and 3D Arcs CIP

MAPKEYS FOR CL COMMANDS config.pro & config.win

SAMPLE PPs PROVIDED UNCX01.P01 : FANUC

(Makino) NURBS and 3D Arcs

UNCX01.P02 : SIEMENSBSPLINE

UNCX01.P03 : HEIDENHAINNURBS

UNCX01.P04 : SIEMENS POLY format and 3D Arcs CIP

MAPKEYS FOR CL COMMANDS config.pro & config.win

3D Arc ON

Arcfitting ON

Arcfitting OFF NURBS Fitting ON

NURBS Poly ON

NURBS OFF

Page 153: Advanced Class

© 2000 PTC 155

FIL File encryptionFIL File encryption

It is possible to encrypt part of the FIL file to : Hide your algorithm or macros

Create a licensing system for the post-processor

The key functions are : PUNCH/20,filename : function to

create the encrypted file

READ/20,ALL,filename : function to read or “includ” the encrypted file in the FIL file.

CPUID=POSTF(27) : returns CPU ID of user

Note : this functionality is available in Pro/E 2000i2 build 2000280 or better

It is possible to encrypt part of the FIL file to : Hide your algorithm or macros

Create a licensing system for the post-processor

The key functions are : PUNCH/20,filename : function to

create the encrypted file

READ/20,ALL,filename : function to read or “includ” the encrypted file in the FIL file.

CPUID=POSTF(27) : returns CPU ID of user

Note : this functionality is available in Pro/E 2000i2 build 2000280 or better

Page 154: Advanced Class

© 2000 PTC 156

FIL File encryption (continued)FIL File encryption (continued)

Steps Create and test your post-processor normally

(UNCX01.Pnn and UNCX01.Fnn)

Isolate the lines of code you want to “Hide”

Create a MACRO for these lines

Replace the lines by a macro CALL

Put all the macros in a separate file UNCX01.Lnn with a special header :

PPWORD/PUNCH,827PUNCH/20,ALL, macro_file_name (6 chars maxi)

Steps Create and test your post-processor normally

(UNCX01.Pnn and UNCX01.Fnn)

Isolate the lines of code you want to “Hide”

Create a MACRO for these lines

Replace the lines by a macro CALL

Put all the macros in a separate file UNCX01.Lnn with a special header :

PPWORD/PUNCH,827PUNCH/20,ALL, macro_file_name (6 chars maxi)

CIMFIL/ON,LOADTLTVAL=POSTF(7,4)IF (TVAL.EQ.99) THEN INSERT/’M99$’ELSE XX=POSTF(13)ENDIFCIMFIL/OFF

TLOAD=MACRO/TVAL=POSTF(7,4)IF (TVAL.EQ.99) THEN INSERT/’M99$’ELSE XX=POSTF(13)ENDIFTERMAC

CIMFIL/ON,LOADTLCALL/TLOADCIMFIL/OFF

Page 155: Advanced Class

© 2000 PTC 157

FIL File encryption (continued)FIL File encryption (continued)

Rename UNCX01.Fnn UNCX01.sav and rename UNCX01.Lnn to UNCX01.Fnn

Execute the post-processor : this will create an encrypted file with all the macros called : macro_file_name.extension

Rename UNCX01.sav to UNCX01.Fnn

Change the header of UNCX01.Fnn to include the macro file :

READ/20,ALL, macro_file_name

Important : this should be the first line

You are now ready to use the Post-processor

Rename UNCX01.Fnn UNCX01.sav and rename UNCX01.Lnn to UNCX01.Fnn

Execute the post-processor : this will create an encrypted file with all the macros called : macro_file_name.extension

Rename UNCX01.sav to UNCX01.Fnn

Change the header of UNCX01.Fnn to include the macro file :

READ/20,ALL, macro_file_name

Important : this should be the first line

You are now ready to use the Post-processor

Page 156: Advanced Class

© 2000 PTC 158

FIL File encryption (continued)FIL File encryption (continued)

Example of application : creation of a license scheme for a custom post-processor

CPUID=POSTF(27) can be used to find the CPU ID of the machine

Example of application : creation of a license scheme for a custom post-processor

CPUID=POSTF(27) can be used to find the CPU ID of the machine

CIMFIL/ON,MACHIN CALL/SECURCIMFIL/OFF

SECUR=MACRO/$$ LICENCE CHECK FIL$$ YOU CAN GET CPU BY USING POSTF(27) FIL AT USER MACHINETCPU=TEXT/'000123456789' $$ INTERCIM TEST CPU FROM POSTF(27)MYCPU=POSTF(27) $$ GET USER CPU TMCP=TEXT/CONVF,MYCPU,12,0,0,1,1OK=CMPRF(TMCP,TCPU)IF(OK .EQ. 0) THEN DMY=FILEF(0,1,(TEXT/' ***ERROR*** NOT AUTORIZED TO RUN POST!')) DMY=FILEF(0,1,(TEXT/' YOUR CPU=',TMCP)) DMY=POSTF(10,2,14000) $$ issue a FINI DMY=POSTF(13) $$ Process the FINIELSE XX=POSTF(13)ENDIFTERMAC

FIL File Encrypted File

Page 157: Advanced Class

© 2000 PTC 159

Pro/NC-GPOST LocalisationPro/NC-GPOST Localisation

Pro/NC-GPOST 2001 can be localized Java based interface

File to translate : Pro/E loadpoint / platform / gpost/ ncjlibs / Resources_Optfile_PTC.properties

Keep the original file as a reference

Translate after the equal sign

Pro/NC-GPOST 2001 can be localized Java based interface

File to translate : Pro/E loadpoint / platform / gpost/ ncjlibs / Resources_Optfile_PTC.properties

Keep the original file as a reference

Translate after the equal sign