You are on page 1of 157

collaboration

Pro/NC-GPOST
innovation

global solutions

Advanced Training & Workshop November 2000


2000 PTC

Agenda
Product Review

General Overview

Questionnaire Overview
FIL Macros Overview

Advanced FIL Macro programming String manipulation Passing information to the CL file from Pro/NC REPEAT Disable/Enable registers REPLAC Debugging a post-processor POSTF functions Macro on motion Tape file re-direction POSTN Macros SPWNF Look-ahead strategy
2000 PTC

File I/O

Agenda
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


3

2000 PTC

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

Pro/NC-GPOST 2001
Workshop Conclusion Whats next ? How to work together ? request to Intercim
2000 PTC 4

collaboration

Pro/NC-GPOST
innovation

Product Review
global solutions

2000 PTC

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
6

2000 PTC

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

2000 PTC

What is Pro/NC-GPOST
DOCUMENTATION : GPOST and FIL manual

Documentation in HTML format on Pro/ENGINEER on-line CDROM

2000 PTC

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.

2000 PTC

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
2000 PTC 10

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]

2000 PTC

11

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)
2000 PTC

Execution error file name : *.ERR

12

What is Pro/NC-GPOST ?
GPOST executable are found in $PRO_DIRECTORY/$MC/obj
for example : c:\ptc\proe2000i\i486_nt\obj

GPOST Data files are found in $PRO_DIRECTORY/$MC/gpost


for 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
2000 PTC

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

13

What is Pro/NC-GPOST ?
QUESTIONNAIRE

Microsoft type menu driven interface Extensive documentation

No licensing required Text based on UNIX

2000 PTC

14

What is Pro/NC-GPOST ?
Pro/NC-GPOST GUI Optfile screen is divided in 4 main areas
Pull Down Menu Toolbar

Main menu
Main Panel

2000 PTC

15

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
2000 PTC 16

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
New File File Open Close File Save File Help Cancel Edit Decrease size Main Panel Increase size Main Panel
17

2000 PTC

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, click on the category title.

2000 PTC

18

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.

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

Different mechanisms are available to input data

Selection Box

Register Box

Edit Box Function Code Box

Spin Button
2000 PTC

Check Box

ASCII Character Box


19

What is Pro/NC-GPOST ?
QUESTIONNAIRE : Did you know ? Speed-up development with CNC defaults

2000 PTC

20

What is Pro/NC-GPOST ?
QUESTIONNAIRE : Did you know ? Register format and position : match an existing NC program % sample tape O1234 N1(OBR-11-T/G137-A- ) Register Addresses N2(TOOL NAME : D6_CDR)

Register Output Order

N3T02 N4S2000M03 N5M51 N6G0X-145.42Y-46.351 N7G81G98X-145.42Y-46.351Z-5.101R01=5.F200P5000 .

Register Format

Register Alias Space between Register


21

2000 PTC

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

2000 PTC

22

What is Pro/NC-GPOST ?
QUESTIONNAIRE : Did you know ?

Motion Analysis : Plunge : G0 X Y Z

Retract : G0 Z XY

2000 PTC

23

What is Pro/NC-GPOST ?
QUESTIONNAIRE : Did you know ?

Operator Messages : Convert Pro/NC PPRINTs in operator message The output is going to include a / i.e. : ( / TOOL NAME : FEM1)

Add the following lines in your FIL macro : T1=TEXT/( / T2=TEXT/( REPLAC/T1,T2 ( / TOOL NAME : FEM1)
2000 PTC

(TOOL NAME : FEM1)


24

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 motion ENDIF DMY=POSTF(13) $$ Process CIMFIL/OFF

2000 PTC

25

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
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)
26

2000 PTC

What is Pro/NC-GPOST ?
QUESTIONNAIRE : Did you know ?

CYCLEs Pro/E syntax automatically supported G codes Motion types Registers

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

2000 PTC

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

27

What is Pro/NC-GPOST ?
QUESTIONNAIRE : Did you know ?

NC Tape Header and Footer


Percent sign at the beginning Program number Date and time Safe startup code Safe startup code

% O1234 (Date:07/01/00 Time:10:45:38) G90G40G80 G49G17

CIMFIL/ON,MACHIN XX=POSTF(13) DD=TEXT/TIMES INSERT/(,DD,)$ INSERT/G90G40G80$ INSERT/G49G17$ CIMFIL/OFF


2000 PTC 28

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)
2000 PTC 29

What is Pro/NC-GPOST ?
COMMON VARIABLES : 3 types

INTCOM : Integer values DBLCOM : real values RELCOM : real values

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


RELCOM number range is 1 - 902 DBLCOM number range is 1 - 2000

2000 PTC

30

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

2000 PTC

31

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
CL File

FIL

UNCL01.Fnn UNCL01.Pnn

Lathe G-Post

MULTAX G-Post

UNCX01.Fnn UNCX01.Pnn

MCD File

2000 PTC

32

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

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

FTOOL=0 G=7;X=24;Y=25 CIMFIL/ON,LOADTL XX=POSTF(20) IF (FTOOL.NE.0) THEN INSERT/G91G28Z0$ ENDIF FTOOL=1 XX=POSTF(21) XX=POSTF(13) REPEAT/X,Y,G,90,ALL CIMFIL/OFF

2000 PTC

33

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,
2000 PTC 34

What is Pro/NC-GPOST ?
INTRODUCTION TO FIL MACRO LANGUAGE Sample FIL File
$$ ******************************************************************** $$ * VARIABLES SECTION * $$ ******************************************************************** $$ REDEF/ON $$ Variable redefinition OK $$ Addresses A=1;B=2;C=3;D=4;E=5;F=6;G=7;H=8;I=9;J=10;K=11;L=12;M=13;N=14 O=15;P=16;Q=17;R=18;S=19;T=20;U=21;V=22;W=23;X=24;Y=25;Z=26 $$ PARTNO %PARTN=TEXT/'DEFAULT NAME' $$ Simulation ALIAS/%simul_on,DMY=POSTF(2,1,1867,1) ALIAS/%simul_off,DMY=POSTF(2,1,1867,0) ALIAS/%output,DMY=POSTF(13)

$$ PPFUN/8,ALL,OFF $$ PPFUN/8,ALL,ON $$ OUTPUT

$$ ******************************************************************** $$ * CIMFIL SECTION * $$ ******************************************************************** $$ ************************************************************* PARTNO CIMFIL/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 $$ Process CIMFIL/OFF $$ ************************************************************* MACHIN CIMFIL/ON,MACHIN %output $$ process, nothing output before it ! $$ Machine Startup $$ PPRINT/%PARTN $$ output the PARTNO $$ $$ End Machine Startup CIMFIL/OFF

2000 PTC

35

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

2000 PTC

; terminates current statement.


36

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

2000 PTC

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

37

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

IF (logical expression) THEN statement(s) ELSE statement(s) ENDIF


2000 PTC

DO / label, do_variable=initial_value, final_value, [incr] Statement(s) CASE / variable Label) WHEN / value statement(s) . WHEN/OTHERS Statement(s) ENDCAS
38

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

2000 PTC

39

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,..)

2000 PTC

40

What is Pro/NC-GPOST ?
INTRODUCTION TO FIL MACRO LANGUAGE 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=6 $$ Find type of the arguments TYPG4=POSTF(6,4) $$ equal 0 (minor word RPM) TYPG5=POSTF(6,5) $$ equal 1 (real 1500) $$ find value of the arguments VARG4=POSTF(7,4) $$ return 78 VARG5=POSTF(7,5) $$ return 1500 $$ Test if VARG4 is RPM IF (VARG4 .EQ. ICODEF(RPM)) THEN ..

2000 PTC

41

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 options PRINT/ON REDEF/ON $$ Allow redefinition of Var. $$ Addresses A=1;B=2;C=3;D=4;E=5;F=6;G=7;H=8;I=9;J=10;K=11;L=12 M=13;N=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 processed XX=POSTF(13) $$ Process do what you want to do here ... CIMFIL/OFF

2000 PTC

42

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_word XX=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

2000 PTC

43

The Secret of post-processing !


CHECK THE DETAILS : request and analyze a sample NC tape !
% O1234 (Date:07/01/00 Time:10:45:38) G90G40G80 G49G17 N1T01M6 S8000M3 G0G90X.0026Y0. G43Z1.H1M8 G1Z-.9809F100. X.0185Z-.9825 X.0461Z-.9911 X.126Z-1.0244 X.2315Z-1.0605 X.3216Z-1.0853 X.4174Z-1.1063 G2G18X.5194Z-1.1234I.123J.04 ...
2000 PTC

G0Z1 M5 M9 G91G28Z0. G28X0.Y0. N2T02M6 S10000M3 G0G90X0X0.3Y0. G43Z1.H2M8 G1Z.3F200 G0Z1. G91G28Z0. G28X0.Y0. M2 %
44

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 )
45

2000 PTC

The Secret of post-processing !


NC TAPE HEADER
% O1234 (Date:07/01/00 Time:10:45:38) G90G40G80 G49G17 Percent sign at the beginning Program number Date and time Safe startup code Safe startup code

CIMFIL/ON,MACHIN XX=POSTF(13) DD=TEXT/TIMES INSERT/(,DD,)$ INSERT/G90G40G80$ INSERT/G49G17$ CIMFIL/OFF


2000 PTC 46

The Secret of post-processing !


NC TAPE FOOTER
G91G28Z0. G28X0.Y0. M2 % Return Home Return Home End of tape Rewind tape

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

2000 PTC

47

The Secret of post-processing !


TOOL CHANGE First tool change
N1T01M6 S8000M3 G0G90X.0026Y0. G43Z1.H1M8

Other tool change


G91G28Z0. G28X0.Y0. N2T02M6 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
FTOOL=0 X=24 Y=25 G=7

CIMFIL/ON,LOADTL XX=POSTF(20) IF (FTOOL.NE.0) THEN INSERT/G91G28Z0.$ INSERT/G28X0.Y0.$ ENDIF FTOOL=POSTF(7,4) XX=POSTF(21) XX=POSTF(13) REPEAT/X,Y,G,90,ALL CIMFIL/OFF
48

2000 PTC

collaboration

Pro/NC-GPOST
innovation

Advanced FIL programming


global solutions

2000 PTC

Passing information to the CL file


There are two solutions to pass information to the CL file :

PPRINT Table :

PPRINT/ param name : value

CIMFIL/ON,PPRINT $$ Macro to extract and print $$ only the text after the : MESS=TEXT/CLW MESS=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) ENDIF CIMFIL/OFF

2000 PTC

Inserting CL commands

50

Passing 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 / ON PPRINT / DWELL : &DWELL:FID_1234

See example area_turning.zip and probing.zip


2000 PTC 51

Debugging 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

2000 PTC

52

Debugging 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

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
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)

2000 PTC

53

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
2000 PTC 54

The 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

2000 PTC

55

The TEXT Command


EXAMPLE $$ extract the date or the time T1=TEXT/TIMES T2=TEXT/ SPOS=INDXF(T1,T2) $$ return the date and time $$ one space string $$ 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
2000 PTC 56

The TEXT Command


T1=TEXT/CONVI,12,4 R1=12.345678 T1=TEXT/CONVF,R1,7,4 T2=TEXT/CONVF,R1,8,3 $$ -> T1 is 12

$$ -> T1 is 12.3456 $$ -> 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

2000 PTC

57

The 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 ...

2000 PTC

58

The 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,2 TERMAC
2000 PTC 59

The 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, decimal string = 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 convert string = TEXT / LOW, string to convert

2000 PTC

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

60

The TEXT Command


T1=TEXT/CONVI,12,4 R1=12.345678 T1=TEXT/CONVF,R1,7,4 T2=TEXT/CONVF,R1,8,3 $$ -> T1 is 12

$$ -> T1 is 12.3456 $$ -> 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

2000 PTC

61

The 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 register RETVAL=TEXT/CONVF,VAL,SIZE,0,0,1,1 TERMAC

IREAL = MACRO / VAL,DECIM $$ Format a real with decimal point $$ no leading and trailing zero $$ DECIM is the number of digits after decimal point RETVAL=TEXT/CONVF,VAL,8,DECIM,0,0,4 TERMAC CALL/IZERO,VAL=2,SIZE=3 INSERT/T,RETVAL $$ Will print T002 CALL/IREAL,VAL=12.34567,DECIM=3 INSERT/X,RETVAL $$ Will print X12.345
2000 PTC 62

The TEXT Command


Example : techniques to output lower and upper case together :
$$ LOWER CASE ALPHA A-Z LCA=097;LCB=098;LCC=099;LCD=100;LCE=101;LCF=102 LCG=103;LCH=104;LCI=105;LCJ=106;LCK=107;LCL=108 LCM=109;LCN=110;LCO=111;LCP=112;LCQ=113;LCR=114 LCS=115;LCT=116;LCU=117;LCV=118;LCW=119;LCX=120 LCY=121;LCZ=122 $$ $$ $$ OUTPUT COMBINED LOW/UP CASE TEXT CIMFIL/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,'$'

2000 PTC

63

Functions in Pro/NC-GPOST
The general syntax is :

function_nameF (arguments)
Examples:

2000 PTC

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
64

POSTF Functions
POSTF allow access to the internal processing of the postprocessor :

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.

2000 PTC

65

POSTF 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
2000 PTC 66

POSTF 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
2000 PTC 67

POSTF Functions
EXAMPLES : $$ Multiply the X value by -2 XX = POSTF(2,3,486,-2) $$ Get RAPID flag RAP = POSTF(1,1,856) IF (RAP.EQ.ICODEF(ON)) THEN $$ We have a RAPID move ELSE $$ We have a feed move ENDIF

2000 PTC

68

POSTF 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 limits PLABEL / OPTION, 19, TO, 1 $$ Check travel limits PLABEL / OPTION, 19, TO, 2 $$ Check travel limits and call $$ _REPOS macro is needed PLABEL / OPTION, 65, TO, 2 $$ Special DPM for MILL/TURN PLABEL / OPTION, 88, TO, 1 $$ Axis registers non modal PLABEL / OPTION, 18, TO, 1 $$ remove redundant F code

2000 PTC

69

POSTF 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

2000 PTC

70

POSTF Functions
EXAMPLES :

G1 non modal $$ CLEAR PREV-G LOCATION AND FORCE G-OUTPUT CIMFIL/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

2000 PTC

71

POSTF 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
2000 PTC 72

POSTF Functions
EXAMPLE

CL Command output alone on one NC block CIMFIL / ON, major_word XX = POSTF(19) $$ Purge current block XX=POSTF(13) $$ Process major word XX=POSTF(19) $$ Purge current block CIMFIL/OFF

2000 PTC

73

POSTF 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


location : argument number Get CL word value

2:text

rslt = POSTF(7, location) rslt : value location : argument number


2000 PTC 74

POSTF Functions
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=6 CLREC = 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 ..

2000 PTC

75

POSTF 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
2000 PTC 76

POSTF Functions
EXAMPLE

Do not process PPRINT with the word COMMENTS CIMFIL/ON,PPRINT $$ Start on all PPRINT $$ Do not process PPRINTs containing the word COMMENTS TXT=TEXT/CLW $$ extract the PPRINT text TEST=TEXT / COMMENTS OK = INDXF ( TXT, TEST) $$ Position of TEST in TXT IF (OK .EQ. 0) THEN $$ this is not the word COMMENTS $$ Process the PPRINT DMY = POSTF(13) ENDIF CIMFIL / OFF
77

2000 PTC

POSTF 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)
2000 PTC 78

POSTF 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 4 DMY = POSTF (12, 4) $$ Process the record DMY = POSTF (13) CIMFIL / OFF

2000 PTC

79

POSTF 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=Error cl_rec_number : position to go to in CL file Control CIMFIL/ON rslt = POSTF(26,class, sub-class, status) rslt : 0 class : class of PP word sub-class : sub-class of PP word status : 0:disabled 1:enabled
2000 PTC 80

REPLAC 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/'?')
81

2000 PTC

REPLAC Command

Remove the / in PPRINT message :


T1=TEXT/( /;T2=TEXT/(;REPLAC/T1,T2

Add Excess zero :


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

2000 PTC

82

REPEAT 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
83

2000 PTC

REPEAT Command
Example of application : Output Spindle start with next Z
M=13;S=19;Z=26 CIMFIL / ON, SPINDL ARG1=POSTF(7,4) $$ first argument of SPINDL IF (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 Z ELSE DMY=POSTF(13) $$ Process SPINDL/OFF ENDIF CIMFIL / OFF

2000 PTC

84

REPEAT Command
Output fixture offset with next motion
CIMFIL/ON,SET $$ Macro on SET $$ Output fixture offset with next motion $$ Extract the fixture offset value IF (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,ALL ENDIF CIMFIL/OFF

2000 PTC

85

REPEAT 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 vector IVAL=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,ALL ENDIF XX=POSTF(21);XX=POSTF(13) CIMFIL/OFF
2000 PTC 86

The 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 block OUT : Create new block register_address : letter addresses, must be 1 through 26 to indicate the alpha characters A through Z. value : value for the register NEXT : output the register with next block POSTN / ALL will reset all the registers
2000 PTC 87

The POSTN Command


To Output G90 G70 G40 POSTN / OUT, G , 90 POSTN / OUT, G, 40 POSTN / OUT, G, 70

2000 PTC

88

Disable 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)
89

2000 PTC

Disable 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 change TXT=TEXT/CLW $$ Text of message TEST=TEXT/'TOOL NAME' $$ Text to test for OKCOM=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 end ELSE DMY=POSTF(13) $$ Process ENDIF CIMFIL/OFF
2000 PTC 90

Disable Tape Output


CIMFIL/ON,LOADTL IF (OKCOM.EQ.0) THEN DMY=POSTF(13) $$ Process ELSE $$ 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

2000 PTC

91

Re-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
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)CONTIN TERMAC

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

Exercise : AGIE wire EDM element switching


2000 PTC 92

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

2000 PTC

93

Macro on Motion
Motion Coordinates in Macro on GOTO CIMFIL / ON, GOTO XVAL = 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) ...
2000 PTC 94

Macro 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


$$ Super GI mode ON:1 OFF:0 CIMFIL/ON,GOTO XX=POSTF(13) $$ Process SGI=1 INSERT/G05P10000$ $$ disable macro on GOTO XX=POSTF(26,5,5,0) CIMFIL/OFF

SGI=0

CIMFIL/ON,MACHIN XX=POSTF(13) $$ Process XX=POSTF(26,5,5,0) $$ disable macro on GOTO CIMFIL/OFF


CIMFIL/ON,LOADTL XX=POSTF(20) $$ Save CL rec. IF (SGI.NE.0) THEN SGI=0 INSERT/G05P0$ ENDIF XX=POSTF(21) $$ restore CL rec. XX=POSTF(13) $$ Process XX=POSTF(26,5,5,1) $$ Activate motion macro CIMFIL/OFF
2000 PTC

95

Macro on Motion
EXAMPLE : 3D Compensation Pro/NC can MODE / 3DCOMP, ON SPINDL / RPM, 1200.000000, CLW outputs RAPID GOTO / -2.6049664968, -1.6546238805, 2.0000000000 information for RAPID 3D compensation GOTO / -2.6049664968, -1.6546238805, 0.8683175847 / 12.000000, IPM for 3 axis surface FEDRAT GOTO / -2.6049664968, -1.6546238805, 0.6683175847 CUTCOM / ON milling GOTO / -2.3573283320, -1.6583390255, 0.5974283950, $

An additional vector defines the surface normal

Pro/NC-GPOST can process the information and a FIL macro is used to generate the output needed by the machine

0.0000000000, 0.0000000000, 1.0000000000, $ 0.0000000000, -0.9986295348, 0.0523359562 GOTO / -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.0000000000 CUTCOM / OFF GOTO / -2.6000000000, 0.4860895490, 2.0000000000, $ 0.0000000000, 0.0000000000, 1.0000000000, $ 0.0000000000, 0.0000000000, 1.0000000000 MODE / 3DCOMP, OFF

2000 PTC

96

Macro 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 :


REDEF/ON

$$ Addresses A=1;B=2;C=3;D=4;E=5;F=6;G=7;H=8;I=9;J=10;K=11;L=12;M=13;N=14 O=15;P=16;Q=17;R=18;S=19;T=20;U=21;V=22;W=23;X=24;Y=25;Z=26


OKCOMP=0 LVECT=0 MVECT=0 NVECT=0 CIMFIL/ON,CUTCOM ARG1=POSTF(7,4) IF (ARG1.EQ.ICODEF(XYZ)) THEN $$ This is 3D compensation move LVECT=POSTF(7,8) MVECT=POSTF(7,9) NVECT=POSTF(7,10) XX=POSTF(26,5,5,1) ELSE XX=POSTF(26,5,5,0) ENDIF CIMFIL/OFF
2000 PTC

$$ To detect comp value $$ NX value of 3D comp. $$ NY value of 3D comp. $$ NZ value of 3D comp.

CIMFIL/ON,GOTO DMY=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 ENDIF DMY=POSTF(21) $$ restore record DMY=POSTF(13) $$ process CIMFIL/OFF CIMFIL/ON,MACHIN XX=POSTF(13) XX=POSTF(26,5,5,0) CIMFIL/OFF

$$ extract L $$ Extract M $$ Extract N $$ Activate macro on Motion $$ De-activate macro on Motion

$$ Process $$ De-activate GOTO macro

97

APT-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 DDATE = MACRO Statements $$ Macro to insert the _TT = TEXT / DATE TERMAC PPRINT / _TT
TERMAC ... CALL / DDATE

date and time

CALL / macnam, var1=value1, varn=valuen


2000 PTC 98

APT-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=1 XX=POSTF(13) CIMFIL / OFF

2000 PTC

99

Look-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 argument


21:LOADTL/1,OSETNO,10 POSTF(7,1) = 21 POSTF(7,2) = 2000 POSTF(7,3)=1055 POSTF(7,4) = 1

POSTF(14) : get next CL record POSTF(15,clpos) : go the CL position clpos


100

2000 PTC

Look 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 For example to find the next tool number : ILOOP=1 $$ Stay in loop CC=ICODEF(LOADTL) IF(CLC.EQ.14000)THEN CALL/CLFIND,CLTYPE=CC,ARGNUM=1 $$ This is FINI IF (OKFIND.EQ.1) THEN NT=ARGVAL OKFIND=0 $$ CL not found ENDIF 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
2000 PTC 101

Look 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 MACHINE CLPOS=POSTF(7,1)$$ Current CL position $$ disable tape output DMY=POSTF(2,1,1867,1) $$ Set INTCOM 1867 to 1 $$ Loop in the CL ...

2000 PTC

102

Look 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 ILOOP=10 ELSE $$ Process DMY=POSTF(13) $$ Set ILOOP to 2 ILOOP=2 ENDIF ENDDO) ...

to 10

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

2000 PTC

Enable/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)

2000 PTC

104

Enable/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,CYCLE XX=POSTF(13) CYCTYP=POSTF(7,4) IF (CYCTYP.NE.ICODEF(OFF)) THEN $$ Activate macro on GOTO XX=POSTF(26,5,5,1) ENDIF CIMFIL/OFF CIMFIL/ON,MACHIN XX=POSTF(13) $$ De-activate macro on GOTO XX=POSTF(26,5,5,0) CIMFIL/OFF
2000 PTC

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

105

Enable / 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) L2=(9-1)*26+L1+2216-1 $$ GET JORDER(ADR) $$ COMPUTE JPARAD(X,9)

DMY=POSTF(2,1,L2,1)
DO/L10,N1=1,8 L2=(N1-1)*26+L1+2216-1 DMY=POSTF(3,1,L2)

$$ SET JPARAD(X,9)
$$ ALLOW UPTO 8CHARS $$ COMPUTE JPARAD(X,N) $$ 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) L10)CONTIN TERMAC
2000 PTC 106

$$ INSERT STRING(N)

Enable / 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)=IEMPTY TERMAC

$$ Replace Z by R101= Z=26 T1=TEXT/R101= CALL / MAD1, ADR=Z,STR=T1 $$ Reset Z to Z CALL / MAD2, ADR=Z

2000 PTC

107

File 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.

2000 PTC 108

File 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)

2000 PTC

109

File I/O

Read from External file string = TEXT / READ, fn

Example : prompt during PP execution


CIMFIL/ON,MACHIN $$ Macro on MACHIN DMY = POSTF(13) $$ Process SEQNO/OFF $$ Stop sequence numbering MSG = TEXT/Program Number : [1111]' RSLT = FILEF(0,1,MSG) $$ Prompt user ANSW = TEXT/READ,0 $$ Read answer $$ Check if answer is just CR (Return) TVAL = TEXT/ANSW,'-' $$ Append - to the answer TCOMP = TEXT/'-' DIFF = CMPRF(TVAL,TCOMP) $$ Test is answer = IF(DIFF .EQ. 1)THEN INSERT/O1111$ $$ Default value ELSE INSERT/O,ANSW,$ ENDIF CIMFIL/OFF

2000 PTC

110

File 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:

2000 PTC

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

111

File 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 ...
2000 PTC 112

File 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 ...
2000 PTC 113

File 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
114

2000 PTC

SPWNF 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.

2000 PTC

115

SPWNF Command
Macro to rename the NC File
(there seems to be a bug (C and windows bug) and we cant 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

...
2000 PTC 116

SPWNF 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 !

2000 PTC

117

collaboration

Pro/NC-GPOST
innovation

global solutions

Advanced Machine configuration

2000 PTC

Multi-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

LINTOL Deviation

2000 PTC

119

Multi-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 !
120

2000 PTC

Multi-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
2000 PTC 121

Multi-Axis Milling Machines Pivot Distances

2000 PTC

122

Multi-Axis Milling Machines


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

Define a 5 axis machine B Table / A Head


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

2000 PTC

123

Multi-Axis Milling Machines


Right Angle Head or Dual 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

2000 PTC

Disable the AAA register in FIL : T1=TEXT/AAA;T2=TEST/;REPLAC/T1,T2

124

Multi-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 :
G17G18 = MACRO / $$ Check the tool vector of the next GOTO CLREC=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 ENDIF LOP1) CONTIN XX=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 rec CALL/G17G18 REPEAT/OFF REPEAT/T,G,GPLAN XX=POSTF(21) XX=POSTF(21) CIMFIL/OFF

2000 PTC

125

Multi-Axis Milling Machines


Multi-axis milling machine with non orthogonal axis

Nutating Heads are directly supported in the questionnaire

2000 PTC

126

Multi-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.4 ANUT=45.0 TRNX=0.0 CIMFIL/ON,MACHIN DMY=POSTF(13) $$ CB-NUTATOR TABLE DMY=POSTF(2,3,635,FLEN) $$ PVTDST in Z DMY=POSTF(2,3,653,TRNX) $$ PVTD in X DMY=POSTF(2,3,881,ANUT) $$ NUTAT ANGLE CIMFIL/OFF

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

2000 PTC

Multi-Axis Milling Machines


When 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
2000 PTC 128

Multi-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


130

2000 PTC

Multi-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 ... ... 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

2000 PTC

131

Multi-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 ...

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)
132

2000 PTC

Multi-axis Lathes
NCL File from Pro/NC Processed by GPOST

HEAD / BOTH HEAD / 1 HEAD / 2 HEAD / OFF HEAD / hd, OPTION, op

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
2000 PTC 134

Multi-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 Macro on HEAD, FINI, MACHIN and OP

Redirect output for tape 2 and write it in a second tap file

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)

2000 PTC

135

Multi-axis Lathes
For Example OKUMA : G13/G14 technique
CURHED=1 SEQ1=1 SEQ2=1 CIMFIL/ON,OP PVAL=100+POSTF(7,4) INSERT/'P',PVAL,'$' CIMFIL/OFF

2000 PTC

CIMFIL/ON,HEAD HSIDE=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=1 ENDIF IF ((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=2 ENDIF ENDIF $$ Ignore the other HEAD commands CIMFIL/OFF

136

Wire EDM
Pro/NC-GPOST supports

2 Axis Wire EDM

4 Axis Wire EDM XYUV Output


UV Definition : Abs,Incr, Incr from XY, Wire Height Definition DBLCOM 889

CIMFIL/ON,SET $$ SET / UPPER, Zhigh, LOWER, Zlow ZHIGH=POSTF(7,5) DMY=POSTF(2,3,889,ZHIGH) CIMFIL/OFF



2000 PTC

XYQR Output MULTAX Data Input only 2 contours input with FIL macros
137

Wire EDM
AGIE CUTCOM Flip
GOTO / P1 GOTO / P2 GOTO / P3 G1 P2 G44 G1 P1 G40 G1 P3 G44
... $$ GOTO coordinates XVAL=POSTF(7,6);YVAL=POSTF(7,7);ZVAL=POSTF(7,8) $$ Mid point XMID=(XVAL-XPOS)/2;YMID=(YVAL-YPOS)/2;ZMID=(ZVAL-ZPOS)/2 $$ Redirect output XX=POSTF(25,1) SEQNO/OFF $$ Stop sequence numbering $$ Output in 2 motions GOTO/XMID,YMID,ZMID GOTO/XVAL,YVAL,ZVAL SEQNO/ON $$ restart sequence numbering $$ Reset output re-direction XX=POSTF(25,0) $$ Read back the two blocks BLK1=TEXT/READ,PUNCH BLK2=TEXT/READ,PUNCH $$ Flip the output and add CUTCOM codes INSERT/' ',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 G REPEAT/X,Y,L,44,ALL TERMAC

$$ Addresses A=1;B=2;C=3;D=4;E=5;F=6;G=7;H=8;I=9 J=10;K=11;L=12;M=13;N=14 O=15;P=16;Q=17;R=18;S=19;T=20 U=21;V=22;W=23;X=24;Y=25;Z=26

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 position XPOS=POSTF(1,3,350);YPOS=POSTF(1,3,351) ZPOS=POSTF(1,3,352) $$ Read the GOTO or FEDRAT ?1 XX=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 ...
2000 PTC

CIMFIL/ON,CUTCOM TYP=POSTF(7,4) IF (TYP.NE.ICODEF(OFF)) THEN CALL/AGIE ENDIF CIMFIL/OFF


138

Punch Press
Punch presses are supported using FIL routines

2 Types of Punch press : Standard output (G1/G2/G3) (Trumpf, ... ) Polar Coordinates (Fanuc, Amada, Strippit, ...)

2000 PTC

Macros on CYCLE CYCLE / NIBBLE, STEP, step_value GOTO / start position GOTO / end position CYCLE / OFF CYCLE / NIBBLE, STEP, step_value GOTO / start position CIRCLE / GOTO / end position CYCLE / OFF

139

Punch Press
Macro for Sheet size
GETSIZ = 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:found CLPOS=POSTF(7,1)+1 $$ Current CL position TSIZE=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 ...
2000 PTC

... 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 ENDIF ENDO1) CONTIN $$ return initial position in CL RSLT=POSTF(15,CLPOS) TERMAC

140

Merged 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)
2000 PTC

All the PPs need Merged Post checked

141

Merged 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

2000 PTC

CIMFIL on MODE to issue switching codes

142

Merged Post-processor : Advanced Mill/Turn : ZXYC, ZXYCB, ...


More than one milling post can be used MODE/MILL,ppnumber and MODE/TURN, ppnumber used to switch between PP MODE macro can be used to manually switch the post processors :
CL file : MODE/MILL,code or minor word FIL File : CIMFIL/ON,MODE MACH=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 ...

2000 PTC

143

collaboration

innovation

Pro/NC-GPOST 2000i2
Build 2000280

global solutions

2000 PTC

Pro/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 !

2000 PTC

145

Miscellaneous
Macro on REMARK : all the $$ text in Pro/E CL file are converted automatically to REMARK / text : CIMFIL/ON,REMARK TXT=TEXT/CLW TXT=TEXT/OMIT,TT,1 .

$$ Extract text $$ 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

2000 PTC

146

Miscellaneous
Machining Time DBLCOM(0989) DBLCOM(0990) DBLCOM(0991) DBLCOM(0992) DBLCOM(0993) = Time for feedrate motion = Time for rapid motion = Time for dwell = Time for tool change = Time for misc operation

Specify G01 modality INTCOM(4339) = 0 G01 is modal as before = 1 G01 is non-modal

2000 PTC

Circle Information DBLCOM(926) = circle start angle DBLCOM(910) = total angle INTCOM(538) = circle direction

147

Automatic 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.
UNCLAMP
Set INTCOM(4320) Set INTCOM(4320) > 0 to specify M-code to unclamp all axes = 0 to Unclamp each axis individually

CLAMP
Set INTCOM(4327) Set INTCOM(4327) > 0 to specify M-code to unclamp all axes = 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(4328-33) = to specify M-code for each xyzabc axis. If set to zero then that axis will not be unclamped.

2000 PTC

148

Tangential 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

2000 PTC

149

Tangential Arcfitting
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, value Type : 1-fit tolerance (0.005) , 2-Z change tolerance (0.005), ..

Number of POINTS
150

2000 PTC

CRVFIT/POINT1,min number (5) or CRVFIT/POINT,2,max number (150) more options are available - check documentation NURBSFITTING.doc

NURBS 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)

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

Control available for : Tolerances Fitting Plane Minimum and Maximum number of points

2000 PTC

151

NURBS 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, id id : 0- NURBS : FANUC, HEIDENHAIN, SIEMENS, 1-Cubic Spline : SIEMENS POLY

Select fitting plane


CRVFIT/PLANE, [XYPLAN,ZXPLAN, YZPLAN,ALL] ALL is the default

Tolerances :
CRVFIT / TOLER, type, value Type : 1-fit tolerance (0.005) , 2-Z change tolerance (0.005), ..

2000 PTC

Number of POINTS
CRVFIT/POINT1,min number (5) or CRVFIT/POINT,2,max number (150)
152

NURBS & 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
153

2000 PTC

NURBS & ARC Fitting


SAMPLE PPs PROVIDED

UNCX01.P01 : FANUC (Makino) NURBS and 3D Arcs UNCX01.P02 : SIEMENS BSPLINE UNCX01.P03 : HEIDENHAIN NURBS UNCX01.P04 : SIEMENS POLY format and 3D Arcs CIP
3D Arc ON NURBS OFF NURBS Poly ON NURBS Fitting ON
154

MAPKEYS FOR CL COMMANDS

config.pro & config.win

Arcfitting ON Arcfitting OFF

2000 PTC

FIL 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

2000 PTC

155

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,827 PUNCH/20,ALL, macro_file_name (6 chars maxi)
156

CIMFIL/ON,LOADTL TVAL=POSTF(7,4) IF (TVAL.EQ.99) THEN INSERT/M99$ ELSE XX=POSTF(13) ENDIF CIMFIL/OFF

TLOAD=MACRO/ TVAL=POSTF(7,4) IF (TVAL.EQ.99) THEN INSERT/M99$ ELSE XX=POSTF(13) ENDIF TERMAC

CIMFIL/ON,LOADTL CALL/TLOAD CIMFIL/OFF

2000 PTC

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

2000 PTC

157

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


SECUR=MACRO/ $$ LICENCE CHECK FIL $$ YOU CAN GET CPU BY USING POSTF(27) FIL AT USER MACHINE TCPU=TEXT/'000123456789' $$ INTERCIM TEST CPU FROM POSTF(27) MYCPU=POSTF(27) $$ GET USER CPU TMCP=TEXT/CONVF,MYCPU,12,0,0,1,1 OK=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 FINI ELSE XX=POSTF(13) ENDIF TERMAC Encrypted File

CIMFIL/ON,MACHIN CALL/SECUR CIMFIL/OFF

FIL File

2000 PTC

158

Pro/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

2000 PTC

159

You might also like