Home
CAM-postwriter User Manual
Contents
1. ccssssscssssssccsssscccessscccesscccessssccecssccecsssacceessssccecsscecessaceeessseeces 21 10 1 GENERA cada areas 21 10 2 DEFINITION OF POSTPROCESSOR STATEMENTS IN CAM POSTWRITER occococonnncncnnononnnnononconononnnnos 22 10 3 EXECUTION OF POSTPROCESSOR STATEMENTS BY THE POSTPROCESSOR cccococococonnnnonanananannononono 23 Mk INCDA TA EE E S EE E E E E E S E E E E 26 11 1 GENERAL R P REE EN A REE E EANA E EES 26 11 2 NG GROUP BLOCK e ues serena A O A EEES 26 12 NCLIST E OR E E AAA AAA dia 29 12 1 GENERA Dena e E R E EE a E EEr NEE EE NEEE EE EEAS SESE 29 13 USER DEFINED VARIABLES AND CONSTANTSu cccccssscssscscscssssccscccesessssceneccecscsssscceccessesseseess 33 13 1 ETENI E a TN 33 13 2 PREDEFINED CONSTANTS e aeaea ea a E E A OA ERa E EE E nad 33 13 3 TYPES OF VARIABLES AND CONSTANTS c ccceseseseseseseveseseseseseresereeesesereseseceseeeresesesereseseseneeereeers 33 13 4 AR 34 13 5 RANGE OF VARIABLES 35 14 ASSIGN STATEMENT svsccssssssivecevcsososnsssecesesvesnscovcocsescussonscesvoesususscoevessocsvasensscdscsecssveosesesscousstsceveseseveess 36 Date printed 14 September 2005 Page 2 Race 3 O 6 User Manual CAM postwriter Version 3 1 Date 17 April 2005 15 AAA dl cu dv Ko e a e Sb Go Sucevesnseesousesscessvesessec cvsssonsesousee da da sbvbeses casado SeSe 37 16 NC BLOCK STATEMENT yisscicccssecissossectasnssvoseonsscoteceetesententesesvvosesenvcoteesvectoscsvecdasessooveonsnoeteseste
2. 6 continuation record 4 char name of geometry in programming system 4 integer index of geometry in programming system 4 real X coordinat endpoint 4 real Y coordinat endpoint First endpoint 4 real Z coordinat endpoint 4 real X coordinat endpoint 4 real Y coordinat endpoint Second endpoint 4 real Z coordinat endpoint 4 real X coordinat endpoint 4 real Y coordinat endpoint 4 real Z coordinat endpoint Endpoint in case 4 real I vector endpoint of multi axis 4 real J vector endpoint machining 4 real K vector endpoint Date printed 14 September 2005 Page 16 Race OS O User Manual CAM postwriter Version 3 1 Date 17 April 2005 The second item in a CL record is always indicating the type of record In this case a type 5000 record linear motion record is shown This type of record contains an implementation dependent maximum number of endpoints The interface of CAM postwriter breaks this record down to records containing just one endpoint Some other types of CL records are type kind of record 1000 Identification record 2000 Postprocessor statement machin command record 3000 Circle geometry record 5000 Linear motion record 6000 Don t CUT CUT record 14000 Fini record 15000 Circulair motion record Possible occurences of seguences of CL records 1
3. User Manual CA M postwriter Version 3 1 Date 17 April 2005 1 Document history 1 1 Document location This document is only valid on the day it is printed The original version of this document is stored on the location mentioned on the first page Version history Version Version Chans notes Changes date number 8 marked ES 1 0 rime O 9 10 03 20 GER of picture source and format o DD of document 21 11 04 English translation translation 17 04 2005 Chapter Error messages added 1 3 Distribution This document is distributed to Date printed 14 September 2005 Page 4 Page 5 of 56 User Manual CA M postwriter Version 3 1 Date 17 April 2005 2 What is CAM postwriter CAM postwriter is a special tool for development of postprocessors for CNC machines The postprocessor build by CAM postwriter gets its input from a CAM system CAD CAM system or NC programming system The only restriction for the CAM postwriter system is that the CAM system has to output a standardized Cutter Location file Other names are CL file or CLDATA The core of CAM postwriter is a specification language which allows you to describe the functionality of a postprocessor on a high abstraction level In this specification language specific elements are provided to describe the input from a CLDATA file and the output of NCDATA Besides a number of checks build in for example syntax checks of postprocessor sta
4. evaluated When the value is true the statement will be executed After this again the expression will be evaluated When the value of the expression is false execution of the WHILE loop will stop The expression has to be of type logical This expression is also called the condition of the loop Next flow diagram illustrates the WHILE loop Date printed 14 September 2005 Page 42 Page 43 of 1 User Manual CA M postwriter Version 3 1 Date 17 April 2005 condition true no Execute statement 17 3 REPEAT statement In next figure the syntax of the REPEAT loop is given The REPEAT loop is a conditional loop At the start of the loop the statement will be executed Notice that the statement in a REPEAT loop will be executed always at least one time Next step is to evaluate the expression When the value of the expression is true the REPEAT loop will stop When the value of the expression is false the statement will be executed again The expression has to be of type logical This expression is also called the condition of the loop Next flow diagram illustrates the REPEAT loop Date printed 14 September 2005 Page 43 Page 44 of 1 User Manual CA M postwriter Version 31 Date 17 April 2005 Execute statement condition true Date printed 14 September 2005 Page 44 Page 45 of 1 User Manual CA M postwriter Version 3 1 Date 17 April 2005 18 IF THE
5. A Z 0 9 mM The maximum length of a name is 32 characters A name may not be equal to a CAM postwriter key word Names of variable and constants are not case sensitive The variable ABC is the same as abc 13 2 Predefined constants Predefined constants are Name Type Value Remarks MAX INTEGER integer 2147483648 This value is implementation dependent MIN INTEGER integer 2147483648 This value is implementation dependent MAX REAL real 3 4E38 This value is implementation dependent MIN_REAL real 3 4E38 This value is implementation dependent TRUE logical true FALSE logical false Because the name of a variable or constant has to be unique a user cannot declare variables or constants with above listed names These names are reserved by CAM postwriter 13 3 Types of variables and constants Variables and constants in CAM postwriter are of type integer real character or logical Integer A variable of type integer is capable of representing all natural numbers like 342 1 0 1 45 or 35425255 The smallest and biggest natural numbers are represented by the predefined constants MIN INTEGER and MAX INTEGER Date printed 14 September 2005 Page 33 Page 34 of 1 User Manual CA M postwriter Version 3 1 Date 17 April 2005 Real Variables of type real are capable of representing real numbers like 234 99 2 3 1 0 0 1 3 3 141569 and 999 99 MIN REAL and MAX REAL represent the s
6. The lowest priority number means the highest priority in execution Date printed 14 September 2005 Page 52 User Manual CA M postwriter Page 53 of 1 Version 31 Date 17 April 2005 Function Priority Operand 1 type Operand 2 type Result type Description CHAR integer char 1 Returns the character by giving the ASCII character code ICHAR char 1 integer Returns the ASCII character code by giving the character SORT real real Returns sguare root of a number INT real integer Returns an integer value of a real number FLOAT integer real Returns a real value of an integer number ATAN real real Returns the arc tangent Angle in radians COS real real Returns co sinus of an angle SIN real real Returns sinus of an angle IABS integer integer Return absolute value of an integer number ABS real real Return absolute value of a real number EOF file identifier logical End of file Returns true if all characters have been read from file else false EOLN file identifier logical End of line Returns true if all characters have been read from current line else false TIME char Returns current time DATE char Returns current date MNR LMNT ACT minor element logical Returns true if minor e
7. Z coordinat endpoint This CL record contains a sequence of 3 integer numbers a character string an integer number and 3 real numbers The declaration of this CL record is described in next chapter 9 2 Definition of CL records in CAM postwriter Example of a CL record specification CL REC record number 5000 sub type surf name surf index x apt y apt z apt VAR record number integer sub type integer o IS UMA UNA surf name char 6 surf index integer ACTION N N block incr if fedrat motion then Gcode 1 NC BLOCK N Gcode x apt y apt END Date printed 14 September 2005 Page 18 Barc OS O User Manual CAM postwriter Version 3 1 Date 17 April 2005 NOTE The line numbers in this example are not part of the specification but are only used for explanation The CL record declaration is started with the keyword CL REC on line 2 On line 3 and 4 the CL record declaration is found a seguence of parameters The declaration of the parameters in the CL record starts at line 6 with the keyword VAR The actual parameters are declared on line 7 to10 The parameters may have been declared in another part of the specification file before the declaration of the CL record The action which will be executed by the CL record is defined on line 13 to 15 proceeded by the keyword ACTION on line 12 After the keyword ACTION one can specify which specific
8. can be added or deleted from the used set and coding of the words may be changed also to meet the reguirements of your CAM NC programming system When your CAM NC programming system does use a different set of major and or minor words contact CAM postwriter You will be provided with a set which meets the requirements of your CAM NC programming system CAM postwriter is initially provided with a set of major words and a set of minor words These sets are listed below List of major words and integer code numbers Major teen Major ILE word code word code number number AIR 1011 PARTNO 1045 AUXFUN 1022 PENDWN 12 CHECK 1023 PENUP t1 CHUCK 1032 PICKUP 9 CLAMP 1060 PITCH 1050 CLEARP 1004 PLOT 1041 CLRSRF 1057 PPLOT 1014 COOLNT 1030 PPRINT 1044 COPY 1040 PREFUN 1048 COUPLE 1049 RAPID 5 CUTCOM 1007 RESET 15 CYCLE 1054 RETRCT 7 DELA 1010 REVERS 1008 DRAFT 1059 REWIND 1006 END 1 ROTABL 1026 FEDRAT 1009 ROTHED 1035 HEAD 1002 SAFETY 1028 INDEX 1039 SELCTL 1056 INTCOD 1020 SEQNO 1019 INSERT 1046 SPINDL 1031 EADER 1013 STOP 2 ETTER 1043 SWITCH 6 OADTL 1055 THREAD 1036 MACHIN 1015 TMARK 1005 MCHTOL 1016 TOOLNO 1025 MODE 1003 TRACUT 1038 OPSKIP 1012 TRANS 1037 OPSTOP
9. correction at the machine tool in the workshop where it implies loss of production time There are many simple rules that can be checked with warning or error messages displayed when these rules are violated Some examples are e Warning if a tool is not selected at the start of the program e Warning ifa table is not indexed at the start of the program e Warning ifno workpiece offset is activated at the start of the program or after indexing of the table e Warming if axes travel beyond their limits e Andsoon With CAM postwriter you can define your own rules and put them in the logic of the postprocessor Postprocessors give a higher degree of automation in the process of part programming Take for example the tool change sequence The possible steps which may be automated in the logic of the postprocessor are Date printed 14 September 2005 Page 5 Page 6 of 56 User Manual CA M postwriter Version 3 1 Date 17 April 2005 Stop coolant Retract to tool change position Z retract and XY retract or XY Z retract Tool change Select range and start spindle Activate diameter and length compensation in next motion s Pre select next tool This tool change sequence may be activated by one simple LOADTL statement With CAM postwriter you can define your own level of automation and specify this in the logic of the postprocessor Post processors can also work around limitations and bugs in the CAM system or i
10. operand fi Full minor elem Full cl record Full nc group f Full register f Full ext file Full parameter Full action fil Too many action blocks in action file ent list list ile ile list e Date printed 14 September 2005 Page 55 Page 56 of 1 User Manual CA M postwriter Version 3 1 Date 17 April 2005 Appendix 4 List of Runtime error messages Runtime errors Input errors Overflow of operand in cl record Underflow of operand in cl record Unknown cl record in input Unknown postprocessor statement format Overflow of operand in postprocessor statement Underflow of operand in postprocessor statement Non fatal runtime errors Operand overflow Operand underflow Reference of a not initialized operand Information printed in NCLIST beyond position 132 Information printed into file longer than 128 characters Fatal runtime errors String too long Function argument out of range Integer overflow Integer underflow Real overflow Real underflow Square root of a negative number Division by zero File is not in write mode File is not in read mode Trying to read past end of line Trying to read past end of file Syntax error Array out of bounds Date printed 14 September 2005 Page 56
11. page number is listed See example on one of the next pages The space below the fixed header is available for a user defined header A HEAD or HEADLN statement writes each user defined header line The string specified in the HEAD LN statement is appended to the user defined header The HEADLN lt string gt statement appends lt string gt to the user defined header and positions on the next line The parameter in the HEAD LN statement may be a string constant or the name of a parameter The maximum number of lines in the user defined header is 10 Next an example of the definition of a user defined header in the NC listing In this example a part of the specification file is given The user defined header is defined here by using character constants in the HEADLN statements In one HEADLN statement the name of a variable is used partno string This variable is given a value by the PARTNO postprocessor statement and gives a description of the part to be machined The value of the variable will be printed in the user defined header on each page When the value changes the new value will be printed in the next user defined header The last 5 lines in the example define a mask for each line of information in the NC listing below the fixed header and the user defined header The purpose is to create columns in which the values of the NC groups can be listed One of the attributes of a NC group is the position on the line on which its value will b
12. the CL records one by one until the MACHIN statement is met The machine statement contains the name of the specific machine Once this name is known the specific postprocessor knowledge files will be opened The CL file is rewind the records will be read again but now they will be processed as specified in the postprocessor specification This process will end when the FINI statement is read from the CL file The postprocessor can also be started separately The only condition is there has to be a CL file It is also possible to start the postprocessor before the CL file is finished This means that every record generated by the CAM NC programming system in the CL file will be processed immediately by the postprocessor This means that besides some other restrictions the machine statement has to be one of the first statements The command file campost starts the postprocessor So if you want to start the postprocessor automatically from your NC programming system this file has to be activated See also the Installation Manual Date printed 14 September 2005 Page 9 Page 10 of 56 User Manual CA M postwriter Version 3 1 Date 17 April 2005 6 CAM postwriter specification language 6 1 General The specification file contains the specification of the postprocessor The extension of this file has to be spc So the input file is lt filename gt spc This file is only used as input and will not be altered by C
13. variable The expression may result in a value that lies outside the range of the variable Content of the specification VAR icount 1 5 string CHAR 128 ACTION icount Example of the resulting error message RUNTIME ERROR Operand overflow On line 992 Item ICOUNT Notice that in this case the line number of action in the specification file is printed in which the error occurred Date printed 14 September 2005 Page 14 Race IS CS O User Manual CAM postwriter Version 31 Date 17 April 2005 7 2 3 Fatal runtime errors Fatal runtime errors are much like normal runtime errors except that they lead to impossible situations Examples are an expression which result in a value greater than max integer when it is evaluated or the reference of a not existing array element FATAL RUNTIME ERROR Array out of bounds On line 483 Item I ARRAY Date printed 14 September 2005 Page 15 Page 16 of 56 User Manual CA M postwriter Version 3 1 Date 17 April 2005 8 The Cutter Location File CL file 8 1 General A Cutter Location file CL file or CLDATA is output from a CAM system The CL file consists of a sequence of records CL records A CL file contains hundreds sometimes thousands of CL records Most of these records give the position or location of the cutting tool This explains the name Cutter Location File Another name is CLD
14. you are machining is another aspect One example is where you manufacture a shape by just one tool and a very long tool path The part in this example is called geometry driven The opposite is for example a part where you use many tools and relatively less geometry in the tool paths The part in this example is called technology driven The contribution of a postprocessor in the part programming of the last example is in general much more than in the first example However parts are in general not completely geometry driven or technology driven There may be a mix of these two types in the parts you have to machine Other aspect may be whether you machine unique parts one of or when the parts are machined regularly in small or larger batches in time The accuracy of the parts and the procedures and protocols to follow may be another aspect You have to consider how much effort money you invest in a postprocessor the higher the quality the more expensive the postprocessor How does this effort contribute to your production process All these aspects and maybe more have to be taken in consideration when you build your postprocessor Date printed 14 September 2005 Page 7 Page 8 of 56 User Manual CA M postwriter Version 3 1 Date 17 April 2005 4 How does CAM postwriter work The next simplified schema illustrates the main components of CAM postwriter In the building stage there is a postprocessor specific
15. 000 1000 1000 1000 1000 2000 3000 6000 14000 15000 5000 5 5000 6 5000 6 Each new sequence of records is started with a type 1000 record However there are implementations of the CL file that don t use a type 1000 record at all This is solved in the interface of CAM postwriter by generating a type 1000 record In this way the definition of CL records in CAM postwriter becomes independent of the NC programming system s implementation of the CL file A special sequence of records is shown in the second column First a type 1000 record The type 1000 record contains the statement number of the part program Next a type 3000 record which contains the circle geometry center point and radius The next record is a type 5000 subtype 5 record The movement of the tool is split into short linear motions along the circle The number of end coordinates in the record is implementation dependent e g 35 endpoints If necessary a continuation of linear motions along the circle will be given in a type 5000 subtype 6 records The number of linear motions depends on the tolerance the radius of the circle and the part of the circle that has to be machined The last column shows the compact alternative without linear motions along the circle The type 15000 record contains all the information of the circular motion start point center point end point radius and direction of movement In both cases the circular interpolation mode
16. 132 Only significant when attribute nc list true If the value of attribute nc list true and output of this NC group is written the first character will be written into NCLIST on column specified by attribute position Date printed 14 September 2005 Page 28 Page 29 of 56 User Manual CA M postwriter Version 3 1 Date 17 April 2005 12 NCLIST 12 1 General The purpose of the NC listing NCLIST file is to present the information in the NCDATA in a more readable format In the NCLIST file additional information can be presented like the geometry names the statement numbers of the part program or the processing time of the workpiece Errors and warnings automatically generated by the postprocessor will be written into the NCLIST file Note NCLIST has to be reviewed for possible errors or messages At the end of NCLIST a summary of the number of errors will be reported Whether or not the output of NC blocks in particularly NC words is written into the NCDATA or NCLIST files depends on the attributes nc data and nc list specified in the declaration of the NC group The width and length of the pages in NCLIST are set in a configuration file The same applies for the number of empty lines at the top and at the bottom of each page The first 2 lines of NCLIST hold a fixed header This fixed header can t be changed In this 2 lines the name CAM postwriter and version the date and time and the
17. 3 TURRET 1033 ORIGIN 1027 UNLOAD 10 Date printed 14 September 2005 Page 50 User Manual CA M postwriter Page Version Date Si ot 3 1 17 April 2005 List of minor words and integer code numbers nor nte el ER LIMESCiSie word code word code number number ALL 51 ON 71 ARC 182 OUT 49 AT 189 PARAB 77 ATANGL 1 PARLEL 17 AUTO 88 PAST 70 AVOID 187 PERPTO 18 BEVEL 201 RADIUS 23 BORE 82 RANDOM 183 BOTH 83 RANGE 145 CCLW 59 REAM 167 CENTER 2 RETAIN 184 CIRCUL 75 RIGHT 24 CLW 60 ROTREF 68 DEEP 153 ROUND 202 DRILL 163 RPM 78 FACE 81 RTHETA 106 FLOOD 89 SAME 54 GRID 67 SCALE 25 HIGH 62 SFM 115 IN 48 SMALL 26 INTOF 5 START 57 INCR 66 STEP 92 INVERS 6 TANTO 27 IPM 73 TAP 168 IPR 74 THRU 152 ARGE 7 TIME 28 EFT 8 TO 69 INEAR 76 TRANSL 29 LOW 63 TURN 80 MAIN 93 XAXIS 84 MANUAL 158 XCOORD 116 MAXIPM 96 XLARGE 31 MAXRPM 79 XSMALL 32 MEDIUM 61 XYPLAN 33 MILL 151 XYROT 34 MIRROR 56 YAXIS 85 MIST 90 YCOORD 117 MMPM 13 YLARGE 35 MMPR 74 YSMALL 36 MODIFY 55 YZPLAN 37 NOMORE 53 ZCOORD 118 O
18. 7 Page 28 of 56 User Manual CA M postwriter Version 3 1 Date 17 April 2005 Attribute Possible Default Meaning values plus sign true false false If plus sign true then the sign will be used in positive values of the NC group minus sign true false true If minus sign true then the sign will be used in negative values of the NC group sign pos front rear front This attribute gives the position of the sign s leading zeros true false false If leading zeros true then leading zeros will not be removed from the value of the NC group X 299 8 will be output as X 00299 8 If leading zeros false then leading zeros will be removed from the value of the NC group X 299 8 will be output as X 299 8 trailing zeros true false false Iftrailing zeros true then trailing zeros will not be removed from the value of the NC group X 299 8 will be output as X 299 800 If trailing zeros false then trailing zeros will be removed from the value of the NC group X 299 8 will be output as X 299 8 spaces true false true Only significant when attribute nc data true If spaces false then all spaces will be removed from the NC group before it is written to the NCDATA ne list true false true This attribute specifies whether this NC group is written to NCLIST or not If the attribute is false the output will never be written into NCLIST position 1
19. AM postwriter When the specification file is processed a new file is created with the extension Ist The output file is lt filename gt Ist This second file is a copy of the specification file except that page headers and line numbers have been added In case of errors error messages are listed in this file describing the type of error in detail At the end of this file a summary will be given of the total number of errors if any 6 2 Syntax and Syntax Diagrams In this document only parts of the syntax will be given for explanation of specific details The complete syntax of the CAM postwriter language is described in the document CAM postwriter Syntax Diagrams For a full detailed description of the syntax see this document In this document the specification language of CAM postwriter is described by means of syntax diagrams A syntax diagram consists of three types of elements e arectangle e a bar with round ends and e anarrow See the example below END The rectangle represents a terminal This is an element in the language that cannot be split into smaller parts You will recognize these elements one on one in the specification language In the above example the rectangle with the word END means you will find the keyword END in the specification language A bar with round ends represents a non terminal Non terminals are elements that can be split into smaller parts In other words a non terminal consis
20. ATA The CL file is a binary file it is not man readable Some systems generate a man readable CL file In fact this is an APT file with only simple APT statements like GOTO lt x y z gt This type of CL file can be transformed into a binary CL file that in its turn can be read by a postprocessor The content of the CL file is described in standard ISO 3592 Numerical control of machines NC processor output Logical structure and major words Implementation of this standard may differ between manufacturers of CAD CAM or NC programming systems However the differences are most of the time minor They can be solved in the interface This interface reads the contents of the CL file and inputs information into the postprocessor Once this interface is build for a specific system it is available for everyone So if you want to use CAM postwriter for your CAM system contact us 8 2 CE records A Cutter Location Record is a seguence of binary values Each value representing a value for a specific parameter A value can be one of the following types integer real or character The CL records with their specific parameters are described in the standard ISO 3592 An example of a CL record is given below number 4 1 bes ype value meaning 4 integer record seguence number 4 integer 5000 type 5000 record linear motion 4 integer 5 6 5 first motion record
21. FF 72 ZXPLAN 41 OMIT 186 Date printed 14 September 2005 Page 51 Bac O User Manual CAM postwriter Version 3 1 Date 17 April 2005 Appendix 2 Operators and Functions Priori Operand 1 Operand 2 Result Ya Operator 1 ty one fe ne Description OR 11 logical logical logical Logical or AND 10 logical logical logical Logical and NOT 9 logical logical Logical not gt 7 integer integer logical Greater or equal real real logical char char logical lt 7 integer Integer logical Less or equal real real logical char char logical lt gt 7 integer Integer logical Not equal real real logical char char logical gt 7 integer Integer logical Greater than real real logical char char logical lt 7 integer Integer logical Less than real real logical char char logical 7 integer Integer logical Egual real real logical char char logical logical logical logical 6 char char char Concatenate 4 integer integer integer Addition real real real 4 integer integer integer Subtraction real real real 3 integer integer integer Multiply real real real 3 integer integer integer Divide real real real kk 2 integer integer integer Power real real real 1 integer integer Positive sign real real 1 integer integer Negative sign real real 1
22. N ELSE statement The IF THEN statement is a conditional statement This means that the statement only will be executed if the condition is true Another form is the IF THEN ELSE statement In this statement also a statement is given which will be executed if the condition is false In next figure the syntax of the IF statement is given expression statement The expression has to be of type logical Date printed 14 September 2005 Page 45 Page 46 of 1 User Manual CA M postwriter Version 3 1 Date 17 April 2005 19 Compound statement In next figure the syntax of the compound statement is given The purpose of the compound statement is to group several statements together as one Loop statements and if then statements for example contain only one statement in their syntax By using the compound statement one can group statements together and use them as one statement in a loop See the example below ACTION Example of FOR statement without compound statement FOR i 1 TO 10 DO i array i i r array i float i Example of FOR statement with compound statement FOR i 1 TO 10 DO BEGIN i arrayl i i r arrayl float i ii c arrayl END Example The first FOR statement is a FOR loop with just one statement The only statement in the loop is the assignment of a value to an array element of i array The
23. OW DOES CAM POSTWRITER WORK ccccccsssssssscsscsssssssccscesscsssscsseccsccescssseecceecessssceseceseeseces 8 5 STARTING THE POSTPROCESSOR ssssssscsssssssscsscscccsssssessccscecssessecsccecscscsscssececcesscssesccesesesseseess 9 6 CAM POSTWRITER SPECIFICATION LANGUAGE ccccccssssscsscccsssssscsccccscsssssssececcesscsssscecscees 10 Gil GENERAL sce RP P R dit id EARE eevee edecanes 10 6 2 SYNTAX AND SYNTAX DIAGRAMS cccccccccccecsesssececececsesseaececececsesseaececececseseaaeaecececsessseaeceesesenensea 10 3 COMMENTS vestida cdas 11 G4 STATEMENTS id 11 Ts LITA cvoesescevensecpsvesvessoesvaseoeveivs 12 71 COMPILE ERRORS ccccesesesesesesesssesesesesesseeveceseseveseseseeesesesereseresesesereseresesesereseresereeesecerecerecereeereeens 12 VIAS ANNO AIN 13 8 THE CUTTER LOCATION FILE CL FILE cccsssssscsssesssssssssccsssccsscsssscssnsesssscssseesssssssnesssssseees 16 Sd A ee ob E o eres 16 8 2 CERES 16 9 CL RECORD SPECIFICATION csssssssscsssssssessscccssssscsccccccsssscsssenccsecssscescseccecssscsssscececcesscssesceseess 18 9 NEHER AT autocad e o do bo nt os is o be eo SME o o bo oo neo 18 9 2 DEFINITION OF CL RECORDS IN CAM POSTWRITER sssssseseseseseseseseseeesesesesesersseseseresereseresereeens 18 9 3 EXECUTION OF CL RECORDS BY THE POSTPROCESSOR sssssseseseseseveseeeseveseseseseseeesereeeseeereeeneeens 19 10 POSTPROCESSOR STATEMENTS
24. Web www CAM postwriter com E mail info CAM postwriter com Fax 31 0 84 756 0953 CAM postwriter User Manual version 3 1 date 17 april 2005 Document http CAM postwriter com manuals User Manual vs3 1 pdf Copyright O 2005 by CAM postwriter All rights reserved No part of this publication may be reproduced stored in a retrieval system or transmitted in any form or by any means electronic mechanical photocopying recording or otherwise without the prior written permission of the publisher Page 2 of 56 User Manual CA M postwriter Version 3 1 Date 17 April 2005 Contents 1 DOCUMENT HISTORY ssssssssscssscossecsscceccesssoassesscnescess co oneosesvonsesesoassesocvonsese cosvocsacuoseose dass n soecescesesesyeusoseeneus 4 Tel DOCUMENT LOCATION aia 4 1 2 VERSION HISTORY cccccccccssssssscecececeesesseaecececsesenseaececececsesuaesecececsensaeceseceesesseaesececsesenseaeeeeeesenensea 4 1 3 DISTRIBUTION cremi merno coctestsssonesuge cocuevedvasyeies sehen s edeus ian cedndus EEES bustedahcbauces eE Ea a EES EESE iam s das 4 2 WHAT IS CAM POSTWRITER sssscccscssssssssssscccsssssssenscceescssssseecceesescescencceecsescssescecseescssessesereesceeses 5 2 1 POST PROCESSING IN GENERAL 525203 6056005006603 Vod vond dnde Irado E Gee Sia E ESSA e dod na dinar crece 5 3 HOW DO YOU BUILD A POSTPROCESSOR cccceereerererereemenereesererenmencereseressemeacecesosssnsenceresess 7 4 H
25. actions will be executed after the CL record is read from the CL file For example an action to generate a NC block which contains the coordinates to move towards The declaration of the CL record is closed by the keyword END on line 16 The number 5000 is only present in the CL record declaration It is recognized as an integer constant with a value equal 5000 The second parameter in the CL record is always used to recognize the type of CL record In some cases also the third parameter is used as CL record identification So the second parameter has to be a constant and the third parameter may be a constant The following requirements must be fulfilled e The first three parameters in the CL record must be of type integer e Only the second and third parameter may be constants e A CL record specification cannot contain more than 20 parameters e All parameters must have been declared at the end of the CL record declaration 9 3 Execution of CL records by the postprocessor When the postprocessor is started it will read CL records from the CL file one by one For each CL record will be determined whether there exist a CL record specification or not If no specification exists an error message will be given and the next CL record will be read If there is a CL record specification the value of the parameters in the postprocessor will be updated with the value of the same parameters in the CL record The next step is to determine w
26. ariable block incr Suppose N 110 and block incr 10 The new value of N becomes 120 In this example is chosen for a NC group named N and an address attribute of this NC group equal N Another name for the NC group may be block number having the same address attribute The statement on line 15 then would be block number block number block incr But the output would be exactly the same This shows the independence of the name of the NC group and the address of the NC word On line 14 is evaluated whether feedrate mode is on or not Suppose it is not This means that the NC group Gcode becomes the value 0 This NC group has an address attribute equal G On line 15 the output of a NC block is specified In this example the values ofx apt y_apt and z apt in the CL record is directly stored in the NC groups x_apt y_apt and z apt These NC groups have the address attribute X Y and Z So the NC block looks like N120 G0 X0 Y50 Z100 3 The next record will be read from the CL file Date printed 14 September 2005 Page 20 Barc CS O User Manual CAM postwriter Version 3 1 Date 17 April 2005 10 Postprocessor statements 10 1 General The type 2000 CL records are a special type of records in the CL file Type 2000 CL records are postprocessor statements or machine commands Postprocessor statements are directions to the machine to perform a specific action For example to load a tool start the sp
27. as to be specified in case of a simple type NO indices In CAM postwriter the concept of strong typing is used This means that NO implicit type conversion takes place The type of the result of the expression has to be equal to the type of the variable Integer real character or logical Signaled compilation errors in an assignment statement are Unknown variable in an assign statement Trying to assign a value to a constant Type conflict in an assign statement Incorrect number of subscripts Signaled runtime errors in an assignment statement are Array out of bounds Operand overflow Operand underflow Below a few examples of this error messages The line number referenced here is the line number of the specification file The item is the variable that is attempted to assign a value to which is too large or small See also the chapter about error messages RUNTIME ERROR Operand overflow On line 99 Item C ARRAY RUNTIME ERROR Operand underflow On line 103 Item I2 FATAL RUNTIME ERROR Array out of bounds On line 112 Item C ARRAY Date printed 14 September 2005 Page 36 Baco O User Manual CAM postwriter Version 3 1 Date 17 April 2005 15 Expression An expression consists of operand s operators functions and possibly one or more sub expressions An operand is a variable constant or an array elem
28. assignment of a value to an array element of r_ array is outside the loop In the second FOR statement a compound statement is used A compound statement is interpreted by CAM postwriter as one statement The compound statement can contain an unlimited number of statements So in the second FOR statement assignments are made to the array elements of i array r array and c array Date printed 14 September 2005 Page 46 Page 47 of 1 User Manual CA M postwriter Version 3 1 Date 17 April 2005 20 OUTPUT and INPUT to files 20 1 General The write statement allows writing of information to external files files on disk or to internal files internal files are just character strings See the syntax of the write statement in next diagram WRITELN jd file identifier jc REWRITE a file identifier m A write statement containing a file identifier writes information into an external file A write statement without a file identifier writes information into NCLIST Positioning on a new line of the file is accomplished by the keyword WRITELN When all information in the write statement is written to the file the last action will be to position on a new line to write a newline When the keyword WRITE is used no newline will be written at the end of the action The next write statement will append information to the same line The PAGE statement positions on a new page of NCLIST The SCREEN statement enables you
29. ation file This is an ASCII text file The postprocessor specification file is processed by CAM postwriter and information is stored in the knowledge base CAM postwriter ae ase Listing errors postprocessor specification file Building of the postprocessor Compilation stage Use of the postprocessor Execution stage The knowledge base contains information about how the postprocessor has to operate It tells the postprocessor how information in the CL file tool path information and machine information has to be translated into NCDATA which checks has to be made and in case of errors which messages has to be generated The NCDATA can be sent directly to the machine control to produce the workpiece The file NCLIST contains the same NCDATA presented in a more human readable form and possible warnings or error messages for the part programmer Date printed 14 September 2005 Page 8 Bac CO O User Manual CAM postwriter Version 3 1 Date 17 April 2005 5 Starting the postprocessor In most cases the postprocessor will be triggered to execute when the CAM NC programming system has finished the calculation of all tool paths The last statement of a part program is the FINI statement This statement stops the generation of the Cutter Location file CL file and is also the last statement in the CL file Next step is to start the postprocessor The postprocessor will open the CL file and read
30. ators power NOT plus sign and minus sign Here evaluation from right to left takes place Examples expression evaluation order wrong evaluation order 12 6 2 12 6 2 4 12 6 2 1 4 RD 4 3 2 262144 4 3 2 409 not false or true not false or true true not false or true false Signaled compilation errors in an expression are Too many expression items in an expression Unknown operand in an expression Type conflict in an expression Unknown file identifier Date printed 14 September 2005 Page 38 Page 39 of 1 User Manual CA M postwriter Version 3 1 Date 17 April 2005 16 NC BLOCK statement The next syntax diagrams describe the syntax of a nc block statement Nc block statement NC BLOCK nc block specification EE Ne block specification o nc group identifier 0 FER nc group identifier ab A The nc block statement allows the construction of a NC block A NC block is one line of information for the machine control Depending on the attributes of the NC groups information will be written to the files NCLIST and NCDATA Nc groups specified between square brackets and will be output optionally The attribute MODAL of nc groups specified for optional output must be equal TRUE In other words only modal nc groups can be specified to be conditional output When nc groups are enclosed between square brackets they will be output only
31. ceptions to the rules above exist for the major words PARTNO PPRINT and INSERT These statements have a predefined format e PARTNO lt text gt e PPRINT lt text gt e INSERT lt text gt Everything that follows these major words is considered as a string The maximum length of the string is dependent on the CAM system while the number of characters in a data field in a CL record is also These dependencies however are solved by the CAM postwriter CL file interface Date printed 14 September 2005 Page 21 Pages 22 i SO User Manual CAM postwriter Version 3 1 Date 17 April 2005 10 2 Definition of postprocessor statements in CAM postwriter Below an example of the definition of a postprocessor statement CLW CCLW AUTO revolutions per min SFM surface speed SFM surface speed CIW SFM surface speed CCIW OFF OFF orientation angle O JOGRNRUNE nana ana un va AE MAS o k revolutions per min SFM surface speed MNR_LMNT OFF orientation angle END The definition of the postprocessor statement starts with the keyword PP_STAT on line 1 On line 2 to 10 all occurrences are listed of the SPINDL statement Each postprocessor statement has a specific purpose and is declared by the postprocessor writer with this purpose in mind On line 5 an example of a minor element without a minor word On line 12 to 38 all occurrences of minor elements are declared in the
32. d the value of the first expression This value is called the START value The STOP value of the counter is specified in the second expression in the FOR statement Both expressions are evaluated only once at the start of the FOR loop The counter and the expressions have to be of type integer When the counter is in the range of the START and STOP value the statement will be executed After execution of the statement the counter will be increment or decrement by 1 depending on the counting direction TO or DOWNTO After this the counter will be checked again to be in the range of the START and STOP value When it is the statement will be executed once again and so on until the counter has a value outside the range of the START and STOP value The value of the counter cannot be changed in the statement This process is showed in next flow diagram which illustrates the FOR loop Date printed 14 September 2005 Page 41 User Manual CA M postwriter Page Version Date 42 of 1 3 1 17 April 2005 Execute statement Decrement counter Evaluate START value Evaluate STOP value Assign START value to counter upward counting no no Execute statement Increment counter 17 2 WHILE statement In next figure the syntax of the WHILE loop is given expression DO The WHILE loop is a conditional loop At the start of the loop the value of the expression will be
33. e file Line 61 brings the file in read mode and positions on the first character in the file On the line 62 the variable message is filled with 13 characters from the file so message contains Error message 20 4 Internal files An internal file is a variable of type character One can write and read information to and from an internal file by the internal write or internal read statement An internal write statement is in fact an assignment The same rules for the assign statement apply here A value can be assigned to the internal file the variable string in the internal write statements in the example below Or a value can be read from the internal file and assigned to a variable On line 83 in the example below a value is assigned to variable 1 Notice that the string has to represent a valid integer number otherwise an error message will be returned Examples VAR string CHA i INTE ACTION INTERNAL E string Error message INTERNAL E string On linenr stat_nr 4 Rapid Circle motion EAD string 1 15 Date printed 14 September 2005 Page 49 Page 50 of 1 CA M postwriter Version 3 1 Date 17 April 2005 User Manual Appendix 1 List of major and minor words Depending on the CAM NC programming system you are using there might be small differences See the documentation of the CAM NC programming system Major and minor words
34. e postprocessor statement an error message will be given On line 14 to 18 the actions are defined What will happen when a SPINDL postprocessor statement is read from the CL file When a postprocessor statement is read from the CL file the first action is to see if it is declared in a postprocessor statement block If it is an unknown postprocessor statement the major word is not used in a postprocessor statement block the postprocessor statement is ignored and the next record is read from the CL file When the postprocessor statement is recognized it will be broken down in its components and checked against the declared postprocessor statements If there is no match an error message is given x INPUT ERROR Unknown postprocessor statement format On line of part program If the postprocessor statement in the CL file matches a postprocessor statement declaration the parameters in the minor elements are given the corresponding values in the CL record Example The postprocessor statement SPINDL CLW SFM surface speed is declared in the specification of the postprocessor See previous example In the CAM NC programming system a command is given to the machine to start the spindle in clockwise direction and the rotation speed of the spindle has to meet a surface speed of 350 m s at the tool tip This command is given by the postprocessor statement SPINDL CLW SFM 350 The postprocessor statement i
35. e printed Date printed 14 September 2005 Page 29 Page 30 of 56 User Manual CA M postwriter Version 3 1 Date 17 April 2005 NC LIST HEAD HEADLN trt HEADLN KKKKK KKK KN r r VK KKK KKK KKK KKK KKK KKK T y HEADIN Postprocessor ERCMC1 lt COMPANY NAME gt HEADLN Mazak H400 Mazatrol M32 lt LOCATION gt POOR O a r r NI IRR XK RAT gt partno string 66 O N G G L H D P X I E Y J K Y R I l P J A Q 1 Z MACH TIME DRIVE SURF END NC LIST MASK MASK MASK MASK END The pictures below show the result The fixed header is given in the first example here but comes before every user defined header The user defined header will be printed on each new page in the NC listing On the position of lt partno_string gt the value of this variable will be printed The last 4 lines in the last example are masks for each line below the user defined header The purpose is to separate the output of the different NC groups The NC listing has a maximum width of 132 characters You can of course use less depending on your needs The example below uses a very small character size to show the full width of the NC listing Normally you will use a landscape orientation to keep it readable Date printed 14 September 2005 Page 30 Pass 3 o il User Manual C AM po stwriter Version 3 1 Date 17 April 2005 Example of fixed heade
36. ent The syntax diagram of an expression is given in next figure A unsigned_number string function expression No type conflicts are allowed in an expression This means that the right type of operands and operators or functions has to be used For example the addition of an integer and a real is not allowed One has to use an explicit type conversion of one of the numbers to add the numbers For a complete list of operators functions and their number and type of operands the resulting type and priority see Appendix 2 Operators and Functions Compilation stage In case of a type conflict in an expression an error message will be generated The number of items in an expression is limited For the current version is the maximum number of items 128 When this number is exceeded an error message will be given Date printed 14 September 2005 Page 37 Page 38 of 1 User Manual CA M postwriter Version 3 1 Date 17 April 2005 Execution stage At the time evaluation of the value of an expression takes place all the operands in the expression must have a value A value can be assigned by initialization during declaration or by an earlier assignment in the execution stage When an operand is referenced without an initial value an error message is given When operators are equal in priority and and 3 are omitted evaluation of the expression takes place from left to right An exception on this rule are the oper
37. fier 7 1 2 Semantic errors A semantic error refers to the meaning of the found item In the example below the declaration of the two variables too short string and too long string is syntactically correct However in CAM postwriter the minimum length of a string is 1 and the maximum length of a string is 128 The description of the error the line number and the item will be listed in the semantic error message Date printed 14 September 2005 Page 12 Page 13 of 56 User Manual CA M postwriter Version 3 1 Date 17 April 2005 89 VAR too short string CHAR 0 SEMANTIC ERROR Length specification out of rang On line 89 Item 0 90 too long string CHAR 129 SEMANTIC ERROR Length specification out of rang On line 90 Item 129 7 1 3 System errors System errors are errors due to the restrictions of the system For example there may not be enough memory in the system to hold all the variables specified by the user In case of a system error contact CAM postwriter to adjust the system Below an example of a system error There is no memory available to hold the variable string2 10989 VAR stringl CHAR 128 10990 string2 CHAR 128 SYSTEM ERROR Full operand file On line 10990 Item string2 7 2 Runtime errors Runtime errors are detected during runtime of the postprocessor This means that runtime errors are detected duri
38. for loop counter must be of type integer Unknown for loop counter in a for statement A for loop bound must be an integer expression A condition must be a logical expression Too many write parameters in a write statement Unknown operand in a write statement Decimal field length gt field length No decimal field length allowed for others than type real Constant of an illegal type Operand must be a constant Constant doesn t exist Lower and upper range bound not of the same type Too many expression items in an expression Unknown operand in an expression Type conflict in an expression Field length must be greater than 0 and less or equal 128 Multiple declaration of an action_block Multiple use of a for loop counter in nested for loops Too many nested for loops A for loop counter cannot be modified Too many nested call statements Unknown action identifier in call statement Existing minor element here specified with different identifier Number of different minor elements in a pp statement block lt 32 Only one major word allowed in a pp statement block Number of identifiers in a minor element must be less or equal 16 Operands in an minor element must be of type variable Date printed 14 September 2005 Page 54 User Manual Page 55 of 1 CA M postwriter Version 3 1 Date 17 April 2005 Operands in an Unk
39. fore you start building a postprocessor you have to consider several aspects First of all you build a postprocessor for a specific machine You have to consider the capabilities of this machine and answer the question if and in which way you want to control these capabilities by means of a postprocessor Next there is the machine control All the available features are documented in the Programming Manual of the machine control Some of these features may not apply to your machine E g your machine may not be able to perform a helical interpolation while the subject is documented in the Programming Manual Perhaps you are lucky and you have a Programming Manual written by the manufacturer of the machine Such a Programming Manual is written with the possibilities of the machine and control combination in mind Another aspect is the NC programming system CAM system or CAD CAM system The output of the system has to be a Cutter Location file CL file All these systems will more or less automatically generate a tool path Important matter is in which way machine commands can be inserted in this tool path These machine commands are defined in the postprocessor as postprocessor statements Examples are setting a feed rate for a motion the loading of a tool starting the machine spindle activating a cutter compensation indexing a rotary table and selecting a new workpiece offset before machining a new tool path The type of parts
40. hether a CL record action is defined This action is defined after the keyword ACTION in previous example If a CL record action is defined this action will be executed A CL record action can consist of many sub actions After the CL record action is completed or if there was no CL record action the next CL record will be read The processing of CL records will stop after a type 14000 record a FINI record has been read from the CL file Next an example of the processing of a CL record by CAM postwriter This example refers to the previous given example in Definition of CL records in CAM postwriter First the APT statements are given which result m output in the CL file Your CAM system may produce this result in a different way Date printed 14 September 2005 Page 19 Page 20 of 56 User Manual CA M postwriter Version 3 1 Date 17 April 2005 APT statements STRPNT POINT 0 50 100 GOTO STRPNT Result in CL file here man readable displayed 13 5000 5 STRPNT 0 0 000 50 000 100 000 Actions taken by postprocessor 1 Cl record is read and values are stored in parameters 13 5000 5 STRPNT 0 0 000 50 000 100 000 record number 5000 sub type surf name surf index x apt y apt z apt 13 5 STRPNT 0 0 000 50 000 100 000 2 Action specified with CL record is executed On line 13 the NC group N is incremented by v
41. indle rotate the machine table and so on In CAM postwriter the type 2000 CL records are threated also in a special way They are not specified in a CL record declaration See previous chapter Instead postprocessor statements are defined directly in CAM postwriter Below a few examples of postprocessor statements LOADTL toolnr FEDRAT MMPR feedmmpr COOLNT ON ROTABL CLW angle END The major and minor words in this example are typed in bold case parameters are typed in italic case Postprocessor statements are assembled from major words and zero or more minor elements If there are minor elements the major word and the minor elements are separated by a The major word is always the first word in the postprocessor statement There can only be one major word in a postprocessor statement A minor element consists of a minor word followed by zero or more parameters There is one exception in CAM postwriter to this rule In only the first minor element after the the minor word can be omitted See above example on line 1 A list of major and minor words will be found in appendix 1 You can build postprocessor statements from any combination of major words minor words and parameters The major and minor words are predefined you have to choose from the list in appendix 1 For the parameters you can choose any name within the given restrictions So the number of postprocessor statements you can build is enormous Ex
42. lement is part of current postprocessor statement else false ONLY MNR LMNT ACT minor element logical Returns true if minor element is the only minor element in current postprocessor statement else false ONLY MIR ACT logical Returns true if there are no minor elements in current postprocessor statement else false Date printed 14 September 2005 Page 53 Page 54 of 1 User Manual CAM postwriter Version 3 1 Date 17 April 2005 Appendix 3 List of Compile error messages Compile errors Syntax errors Unexpected item in input file Illegal identifier Illegal character in unsigned integer number Illegal character in unsigned real number Source file exhausted Illegal character in input Illegal post processor identifier Semantic errors Unknown item in a cl record declaration Illegal key in a cl record declaration Too many items in a cl record declaration Too many items in a variable declaration Integer overflow Real overflow Operand already declared Lower range bound gt upper range bound Length specification out of range Variable doesn t exist Variable already initialized Variable initialized beyond its range Variable and initial value of different type Trying to assign a value to a constant Unknown variable in an assign _ statement Type conflict in an assign statement A
43. list of postprocessor statements Notice that the minor element CLW is used in the postprocessor statements on line 2 and 7 The minor element SFM surface speed is used in the postprocessor statements on line 6 7 and 8 Date printed 14 September 2005 Page 22 Page 23 of 56 User Manual CA M postwriter Version 3 1 Date 17 April 2005 Important The minor word and the number of parameters uniquely identify a minor element Not the name of the parameters in the minor element In a CL record a postprocessor statement is recognized by the 2000 record type The minor element in this record is recognized by the integer code number of the minor word followed by a number of values These values represent the values of the parameters in the minor element So there can t be made a difference between the minor element SFM surface speed and the minor element SFM speed Does the value belong to the parameter surface speed or speed The postprocessor statements SPINDL SFM surface speed CLW and SPINDL CLw have a common minor element CLW When an existing minor element is declared once again with different parameters an error message will be given Notice The postprocessor statements LOADTL SFM surface speed and SPINDL SFM surface speed have a NO common minor element The first minor element is part of a LOADT statement and the second is part ofa SPINDL statement They however might use the same paramete
44. lock with the specified parameters Date printed 14 September 2005 Page 25 Page 26 of 56 User Manual CA M postwriter Version 3 1 Date 17 April 2005 11 NCDATA 11 1 General The output of the part program by the postprocessor is called the NCDATA The NCDATA is ready to be fed into the machine control to manufacture the part on the machine The NCDATA is not the only output of the postprocessor There may be a tooling list a set up list etc The NCDATA consists of NC blocks A NC block is 1 line of information The NCDATA is a text file Next an example of a few lines NC blocks of the NCDATA file N0010 G0 X100 Y50 M03 N0020 Z2 N0030 G01 Z 20 F0 2 Each NC block consists of NC words For example the G codes and M codes are NC words A NC word consists of an address and a value In the NC word G01 the address is G and the value is 01 In CAM postwriter the concept of NC groups is introduced This is because specific ranges of values in NC words have a specific meaning For example G0 G1 G2 and G3 are motion interpolation modes while G53 G54 G55 G56 and G57 activate coordinate systems In fact different purposes are supported by 1 NC word In CAM postwriter and also in some machine control programming manuals the NC words are separated in specific NC groups to keep this aspect in mind 11 2 Ne group block A NC group is declared in anc group block The syntax of a nc group block is described belo
45. lues of the variable In next example the declaration of a variable with the declaration of the range of the variable Example VAR tool number 1 surface speed 10 In this example a variable tool number is declared The variable is of type integer This is because the range itself is of type integer The variable surface speed is of type real The lower and upper ranges have to be of the same type and the lower range has to be smaller than the upper range Possible values of tool number are 1 2 3 and 4 Assigning any other value to tool number will result in a error message By using ranges for variables the user is capable of generating implicit error messages Example The number of tool positions on a machine is for example 1 to 4 The variable tool number is used in a postprocessor statement to activate a tool change on the machine The statement looks like LOADTL tool number By defining a range for tool number any value used outside the range will result in an error message This without having any code written to check the tool number Date printed 14 September 2005 Page 35 Page 36 of 1 User Manual CA M postwriter Version 3 1 Date 17 April 2005 14 Assign statement The following figure describes the syntax of an assign statement A ear An assign statement is used to assign a value to a variable The variable can be a simple type or of type array The right number of array indices h
46. mallest and biggest real numbers Character Variables of type character are capable of representing strings of characters The maximum length of a string is 128 characters A character is one of the set of ASCII characters Logical A variable of type logical is capable of representing logical values There are only two logical values true and false Two constants TRUE and FALSE are predefined 13 4 Arrays All types of variables can be declared as an array The upper bound and lower bound are not limited they have to be greater or egual MIN INTEGER and less or egual MAX INTEGER However the upper and lower bound determine the number of array elements in the array Large numbers of array elements might probably result in a storage problem in CAM postwriter You will get an error message in this situation In case you encounter this problem contact CAM postwriter to increase the storage capabilities The maximum dimension of an array is 4 This means that the maximum number of subscripts is 4 Next an example of the declaration of an array and the assignment of a value to an array element VAR I array ARRAY eis sito 10 1 10 OF INTEGE ACTION I_arrayl 1 Date printed 14 September 2005 Page 34 Page 35 of 1 User Manual CA M postwriter Version 3 1 Date 17 April 2005 13 5 Range of variables For variables of type integer and real a range can be specified This range describes the legal va
47. n the CL file is represented by a sequence of numbers See the first row The next row gives an explanation of the meaning of the numbers CL record 2000 1031 60 115 350 000 type 2000 code for code for CLW code for SFM value 350 record SPINDL When the postprocessor reads the CL file the postprocessor statement is recognized by the number 2000 The number 1031 indicate it is a SPINDL statement Next the minor elements CLW and SFM surface speed are recognized The first minor element has no parameters so no update takes place The second minor element has one parameter surface_speed This parameter will be assigned the value 350 The next step is to see if there are actions defined for major word or the minor elements In this example there is no major action It could have been defined between line 19 and 21 There are 2 Date printed 14 September 2005 Page 24 Page 25 of 56 User Manual CA M postwriter Version 3 1 Date 17 April 2005 minor element actions defined for this example The first minor element CL W has the action that the spindle rotation direction is set to CLW The second minor element performs several sub actions line number action 14 increments the block number 15 sets the G code for surface speed machining 16 sets the S word with the value of the surface speed 17 sets the M code for the direction of spindle rotation 18 outputs a NC b
48. n the machine tool It is generally far easier to change the post processor than it is to get a new revision of the CAM system or a new revision for the NC controller An example of extend possibilities is a machine tool equipped with an adjustable square head On this machine tool the coordinate system couldn t be tilted by the machine control while the tool could In this case the postprocessor took care of XYZ axis transformation The important point to be made here is that the NC programmer should not be concerned about specific details and peculiar characteristics of the machine tool that do not directly affect the production of a job A good postprocessor should hide these details as much as possible within Enabling the NC programmer to focus entirely on the job Standard CAM systems standard NC machines standard CLDATA and standard postprocessor vocabulary can not all be simple mixed together to instantly produce a working system There are too many variables in the real world to achieve integration with off the shelf components Postprocessors put it all together and good postprocessors can do this with a minimum of effort of the part programmer Post processing works best when it is transparent With CAM postwriter you have the perfect tool to put this all together Date printed 14 September 2005 Page 6 Race OO O User Manual CAM postwriter Version 3 1 Date 17 April 2005 3 How do you build a postprocessor Be
49. ng processing the CLDATA and performing the actions specified in the specification file of the postprocessor Actions that result in a runtime error are NOT executed CAM postwriter will continue processing subsequent actions which however may result in other runtime errors Important When runtime errors occur this means that the output of the postprocessor is not what you expected it to be You have to analyze and correct the problem Runtime errors are listed in the output of the postprocessor NCLIST and on the screen of your workstation At the end of NCLIST you will find a summary of the number of errors if any Date printed 14 September 2005 Page 13 Page 14 of 56 User Manual CA M postwriter Version 3 1 Date 17 April 2005 7 2 1 Input errors The input of the postprocessor is read from the CLDATA so input errors refer to the information in the CLDATA In case of an input error a reference is made to the line number of the part program This is the statement in your part program that caused the error INPUT ERROR Overflow of operand in postprocessor statement On line 13 of part program Item MCODE EX INPUT ERROR Unknown postprocessor statement format On line 15 of part program 7 2 2 Runtime errors Runtime errors are errors that occur while performing an action or sub action in the postprocessor specification An example is the assignment of the value of an expression to a
50. nown identif Unknown minor e Undefined minor minor element of type logical not allowed ier in an minor element lement in this context _element Multiple declar Multiple declar ation of an minor element ation of a pp statement block First three cl Multiple declar record items must be of type integer ation of a cl _record Unknown operand List position o No constants al in this nc group declaration f nc group out of range and third item Unknown nc grou Too many nc gro Optional output Too many read p Unknown operand nknown file id nknown operand arameter of wr ncorrect numbe o decimal fiel n n u U ternal file m Number of bound Lower bound mus Array out of bo Incorrect numbe A nc_group cann Subscript must Lower bound mus System errors known operand lowed in a cl record declaration except for the second p in an nc block specification ups in an nc block specification can only be specified for a modal nc group arameters in a read statement in a read statement entifier in a parameter list ong type r of parameters d length specified for type real ust be of type character 1 s must be less or equal 4 t be less than upper bound unds r of subscripts ot be an array be of type integer t be less or equal upper bound le Full
51. of the machine control can be used In the case of the sequence with type 3000 record the linear motions are not output to the machine control In the case the circle radius is too large to use the circular interpolation mode of the machine control only the sequence with type 3000 record can be used Date printed 14 September 2005 Page 17 Page 18 of 56 User Manual CAM postwriter Version 3 1 Date 17 April 2005 9 CL record specification 9 1 General In a CL record specification a connection is made between the value of the parameter in the CL record and the parameter in the postprocessor The name of the parameter can be chosen freely However a significant name makes the specification readable and easier to understand The type and position of the parameters are determined by the structure of the CL record The structure of the CL records in the CL file doesn t change Provided the CL file is generated by the same CAM system So this part of the specification is for each postprocessors the same Example of a CL record in the CL file number 4 1 a amics ype value meaning 4 integer record seguence number 4 integer 5000 type 5000 record linear motion 4 integer 5 6 5 first motion record 6 continuation record 4 char name of geometry in programming system 4 integer index of geometry in programming system 4 real X coordinat endpoint 4 real Y coordinat endpoint 4 real
52. r time 10 14 56 date 15 7 2004 CAM Postwriter C 3 03 released 17 4 2004 Example of user defined header and user defined mask KKK KKK KK AKA A RK AKA KKK KA KK KKK RARA AAA KKK KK KK KKK RK AK KKK KA KK KKK KK KK KKK KKK Postprocessor ERCMC1 lt COMPANY NAME gt ad Mazak H400 Mazatrol M32 e lt LOCATION gt RR RR RR RR RR RR AA A A A A AXA A A A AA AA kA AA KAKXKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKkX lt partno string gt TIME DRIVE SURF Date printed 14 September 2005 Page 31 Page 33 of 1 User Manual CA M postwriter Version 3 1 Date 17 April 2005 13 User defined variables and constants 13 1 General In CAM postwriter the user can define variables and constants The constants have a fixed value which cannot be changed set at the moment of declaration The variables and constants have a name also called identifier by which their values can be referenced Variables and constants have to be declared before their values can be referenced in for example an eguation The CAM postwriter specification file is read from begin to end the declaration has to occur before the reference A name of a variable or constant can only be used once in a declaration and the identifier has to be unigue The name of the variables and constants consist of alphanumeric characters and has to start with a letter The name may also contain underscore s The complete set of characters for an identifier is
53. r s and perform the same action 10 3 Execution of postprocessor statements by the postprocessor Below an example of the definition of a postprocessor statement PP STAT SPINDL CLW SFM surface speed MNR LMNT CLW VAR rotation direction CHAR 4 INIT rotation direction ACTION rotation direction CLW END o IO UG M UN FE MNR IMNT SFM surface speed VAR surface speed 0 1000 ACTION block nr block nr block incr G 96 S surface speed if rotation direction CLW then Mcod NC BLOCK N G S M The structure of line 1 to 21 is called a postprocessor statement block On line 2 the postprocessor statement is declared In this example only one there could have been many more spindle statements Date printed 14 September 2005 Page 23 Page 24 of 56 User Manual CA M postwriter Version 3 1 Date 17 April 2005 All the used minor elements in the declared postprocessor statements have to be declared in the same postprocessor statement block This is done on line 4 through 9 and 11 through 19 On line 5 the parameter rotation direction is declared on the next line this parameter is given an initial value On line 12 the parameter surface speed is declared This parameter is part of the minor element and used here for the first time The parameter surface speed is given here a specific range of possible values When a value outside this range is given in th
54. rd is initialized X coord has an initial value of 999 999 Next follows an explanation of all attributes their meaning and default values Attribute Possible Default Meaning values ne data true false true This attribute specifies whether this NC group is part of the NCDATA or not If the value of this attribute is true and output of this NC group is written it will be written into the NCDATA If the attribute is false the output will never be written into the NCDATA address lt string gt This attribute contains the address of the NC word The address is a string of up to 32 characters The address and name of the NC group doesn t have to be the same modal true false false Only when the value of the NC word has changed it will be output in the NC block The output of a non modal NC group will be repeated in every NC block it is specified format lt field gt lt l decimal Gives the format of the output of the NC word For NC groups of type field gt lt l_field gt REAL the format has the form lt l_field gt lt l_decimal_field gt lt field gt specifies the total field length included with the address of the NC group lt l_decimal_field gt specifies the decimal field length of the NC group lt l_decimal_field gt 3 specifies 3 digits behind the For NC groups of type INTEGER or CHAR the format has the form lt field gt Date printed 14 September 2005 Page 2
55. rite information into NCLIST For example to generate a remark warning or error message 20 3 External files Before information can be written to an external file the file has to be declared and has to be in write mode You can open a file in write mode by the rewrite statement If the file doesn t exist it will be created by the rewrite statement If the file does exist all information in the file will be overwritten and the file will be empty Before you can read information from a file it also has to be declared and the file has to be in read mode You can open a file in read mode by the reset statement The reset statement opens the file and positions on the first character in the file If the file doesn t exist the reset statement will create an empty file Date printed 14 September 2005 Page 48 Page 49 of 1 User Manual CA M postwriter Version 3 1 Date 17 April 2005 Example VAR text file message ACTION REWRITE text file WRITE text file Error message WRITELN text file ESET text file READ text file message 13 On line 52 is the declaration of the external file The rewrite statement on line 57 creates and brings the file in write mode We assume here that the file didn t exist before this action On line 58 the characters Error message are written into the file while line 59 appends a new line to th
56. svecteeesse 39 17 LOOP STATEMENTS cccccccssssssscscssscssccrcccscscsssenscecccesssscsenccescessssenececcsesesssscenscsecsssssscececssescssescess 41 17 1 FOR STATEMENT asa art iii 41 17 2 WHILE STATEMENT cesos air dial id sos k 42 17 3 REPEAT STATEMENT dicos 43 18 IF THEN ELSE STATEMENT ssovsssecsossecesnsssonssvennssenvecssvesnseteossvenseeednsssonesvonssenauecsanessennsecess 45 19 COMPOUND STATEMEN D wisvsccsscscsccsssscsecoscsscccsceecdssencecsecsesesdsenvabesecdssecdevess ssssesedscesstedesssoesdesesesedesdosesss 46 20 OUTPUT AND INPUT TO FILES wivisssccsssssessesssscvsesvasecesecdsesvescecevvos svscuwscnscesscosteovaseosseseusdepeveseseeendsesseevs 47 20 1 GENERAL arras 47 20 2 QUTPUTTO NEL naaa 48 20 3 EXTERNAL FILES 00 ici Pita Rrisni Er Eni IP isod eba sado bass itha Sn VaR isore RREPTA R isik 48 20 4 INTERNAL FILES ooo na a a a a aa a a ee a aa ea hs dR a Re 49 APPENDIX 1 LIST OF MAJOR AND MINOR WORDS ccsscssscssssssssccessssssseccccscscsssssececcesscssescesecess 50 APPENDIX 2 OPERATORS AND FUNCTIONS cssssssssssssssssccsscccsssccscccccesssssssseccccsesesssssececesesescesceseees 52 APPENDIX 3 LIST OF COMPILE ERROR MESSAGES esesesssessoesesssesoosoesesssoseoseeeseesooeoesesesooeoeeeesssseese 54 APPENDIX 4 LIST OF RUNTIME ERROR MESSAGES eesessssseossesssesoosoesesesossosseeesosoosoesesesooeoeseeesossose 56 Date printed 14 September 2005 Page 3 Page 4 of 56
57. tements you are able to build your one checks and logic into the postprocessor The specification language is very powerful and yet simple to understand In the past fifteen years the concept of the specification language has proved to be able to specify postprocessors for very complex machines Postprocessors build by CAM postwriter can meet a very high degree of automation and production process checking With a high guality postprocessor the part programmer doesn t have to worry about the specific details of the machine the postprocessor will solve them Yet CAM postwriter enables you to build a very simple postprocessor that simply translates CLDATA to NC machine codes The complexity of the postprocessor depends on the logic you put into it and CAM postwriter enables you to put in as many as you want You don t need high level programming expertise to accomplish this The level of automation and checking depends on the level you want to reach and satisfies you 2 1 Post processing in general Post processors can do many other things besides translating CLDATA to NC machine codes NCDATA For example a post processor may summarize maximum axes travel feed and speed limits job runtime and tool usage information which enables better selection and scheduling of resources More sophisticated postprocessors may validate the program before it is run by the machine tool This means that the program can be corrected at the CAM system instead of
58. to write information to the monitor of your workstation The read statement allows reading of information from external or internal files See the syntax of the read statement in next diagram Date printed 14 September 2005 Page 47 Page 48 of 1 User Manual CA M postwriter Version 3 1 Date 17 April 2005 file identifier pa file identifier A file_identifier ye vs ta u ti 4 The reading of information starts form the first character in the external or internal file The positioning on a new line is accomplished by the keyword READLN Any characters left on the current line are ignored Important in the process of reading information from file are the functions EOF and EOLN These functions inform you whether you arrived at an end of file or an end of line performing the read actions Performing a READ action when you arrived at the end of a line while result in an error You have to position first on the next line if any with the READLN action before you read the next character When you arrived at the end of a file any new READ action from this file would result in an error 20 2 Output to NCLIST A write statement without a file identifier writes information into NCLIST NCLIST is a special kind of external file CAM postwriter writes output to NCLIST NC blocks and for example page headers are written by CAM postwriter into NCLIST CAM postwriter also provides you with the possibility to w
59. ts of elements on a lower level When you meet a non terminal in a syntax diagram this means that there has to be a syntax diagram that describes the non terminal This syntax diagram however may contain other non terminals On the lowest level only terminals exist The arrows give the paths and direction in the syntax diagram The elements one encounters along a path are a syntactically correct construction in the specification language Date printed 14 September 2005 Page 10 Page 11 of 56 User Manual CAM postwriter Version 3 1 Date 17 April 2005 6 3 Comments Comments in the specification file are placed between and y The comment starts with and ends with A comment can cover several lines A new line doesn t mean the end of a comment Comments can be nested This means that after for example two comment opening characters there have to be two comment closing characters to end the comment All characters in a comment are ignored by CAM postwriter 6 4 Statements A new line does NOT terminate a statement This means that a statement can cover multiple lines or that there can be more than one statement on one line Date printed 14 September 2005 Page 11 Race IRON User Manual CAM postwriter Version 3 1 Date 17 April 2005 7 Error messages Error messages generated by CAM postwriter can be divided in compile errors and runtime errors The first three error t
60. w Also an example and explanation is given NC GROUP X coord 999 9999 999 9999 ATTR nc data true address XL modal false format 9 4 plus sign false minus sign true sign pos front leading zeros false trailing zeros false spaces false nclist true position 24 INIT X coord 999 9999 END Date printed 14 September 2005 Page 26 Page 27 of 56 User Manual CA M postwriter Version 3 1 Date 17 April 2005 The ne group block starts with the keyword NC GROUP Next follows the identifier of the NC group the name of a parameter a colon a type specification and a semicolon The identifier is the name of a variable It cannot be the name of a constant The type of the variable is integer real or character In this case a specific range is given The control is not capable of processing smaller or larger values By limiting the value of the NC word in this way an error message will be generated when the listed values are exceeded On line 3 the keyword ATTR On the next lines follow a number of attributes of this NC group In this example all attributes are listed and explained Most attributes have default values that match modern machine controls Using these defaults the same example may be written like NC GROUP X coord 999 9999 999 9999 ATTR address X format 9 4 position 24 X coord 999 9999 On line 16 the value of the NC group X coo
61. when their value has changed since their last output Nc groups not enclosed between square brackets will be unconditional output The maximum number of nc groups in a nc block statement is 32 When this number is exceeded a warning will be given Signaled compilation errors in a nc block statement are Unknown nc group in an nc block specification Optional output can only be specified for a modal nc group Too many nc groups in een nc block specification Date printed 14 September 2005 Page 39 Page 40 of 1 User Manual CA M postwriter Version 3 1 Date 17 April 2005 Examples TOS nc block unknown var SEMANTIC ERROR Unknown nc group in an nc block specification On line 703 Item unknown var 707 nc block block number SEMANTIC ERROR Optional output can only be specified for a modal nc group On line 707 Item block number Date printed 14 September 2005 Page 40 Page 41 of 1 User Manual CAM postwriter Version 31 Date 17 April 2005 17 Loop statements As many programming languages CAM postwriter provides loops Loops are used to perform specific actions several times 17 1 FOR statement In next figure the syntax of the FOR loop is given identifier expression The FOR loop is a counting loop The counter is the identifier specified in the syntax diagram At the start of the FOR loop the counter is assigne
62. ypes syntax errors semantic errors and system errors are compiling errors and are detected during the compilation of the specification file Runtime errors are detected during runtime of the postprocessor For a complete list of error messages see Appendix 3 7 1 Compile errors Compile errors are signaled during the process of scanning the specification file and transforming the specification into the knowledge base 7 1 1 Syntax errors A syntax error in the specification file is reported to the postwriter The message is listed on the screen and in the output file lt filename gt Ist The line number and the incorrect item will be listed in the syntax error message An attempt will be made to restart the scanning of the specification file for possible more errors Syntax errors and other errors between the point of the signaled syntax error and the point where the process comes in track again are not signaled They will however be found after correction of the first syntax error An example of a syntax error report is given below 31 32 record number 33 stat nr 34 card idl card id2 38 illegal identifier SYNTAX ERROR Unexpected item in specification file On line 38 Item illegal identifier On line 38 is attempted to declare a variable with the name illegal identifier However an identifier has to start with a letter so the item is not recognized as an identi
Download Pdf Manuals
Related Search
Related Contents
Mellerware PRIMA 26400 User's Manual Samsung SC21F50UG POLIZA DE GARANTIA QSC Professional Power Amplifier EX 1600 User's Manual Tefal BL142A42 blender M3903 - Mitel Edocs PDF版 - (CEマーク)取得 株式会社サーテック Certec Copyright © All rights reserved.
Failed to retrieve file